diff --git a/AI.php b/AI.php index 34c7dc21..0fa85209 100644 --- a/AI.php +++ b/AI.php @@ -7,234 +7,221 @@ */ -if(isset($_GET['m1'])) { - define('GAME',true); - - setlocale(LC_CTYPE ,"ru_RU.CP1251"); - - include('_incl_data/__config.php'); - include('_incl_data/class/__db_connect.php'); - - $sp = mysql_query('SELECT * FROM `users_recombats` WHERE `email` != "" ORDER BY `name` DESC LIMIT 7000'); - while( $pl = mysql_fetch_array($sp) ) { - echo "
".$pl['email']; - } -}elseif(isset($_GET['bk1'])) { - define('GAME',true); - - setlocale(LC_CTYPE ,"ru_RU.CP1251"); - - include('_incl_data/__config.php'); - include('_incl_data/class/__db_connect.php'); - include('_incl_data/class/__user.php'); - - $ins = ' -1:
'; - $sp = mysql_query('SELECT * FROM `items_main` WHERE `geni` = 1'); - while( $pl = mysql_fetch_array($sp) ) { - - $po = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$pl['id'].'" LIMIT 1')); - $po = $u->lookStats($po['data']); - - if(!isset($po['add_minAtack']) && isset($po['sv_minAtack'])) { - $po['add_minAtack'] = $po['sv_minAtack']; - $po['add_maxAtack'] = $po['sv_maxAtack']; - } - - $ins .= 'INSERT INTO `items_main` ( +if (isset($_GET['m1'])) { + define('GAME', true); + + setlocale(LC_CTYPE, "ru_RU.CP1251"); + + include_once '_incl_data/__config.php'; + include_once '_incl_data/class/__db_connect.php'; + + $sp = mysql_query('SELECT * FROM `users_recombats` WHERE `email` != "" ORDER BY `name` DESC LIMIT 7000'); + while ($pl = mysql_fetch_array($sp)) { + echo "
" . $pl['email']; + } +} elseif (isset($_GET['bk1'])) { + define('GAME', true); + + setlocale(LC_CTYPE, "ru_RU.CP1251"); + + include('_incl_data/__config.php'); + include('_incl_data/class/__db_connect.php'); + $u = User::start(); + + $ins = ' -1:
'; + $sp = mysql_query('SELECT * FROM `items_main` WHERE `geni` = 1'); + while ($pl = mysql_fetch_array($sp)) { + + $po = mysql_fetch_array( + mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $pl['id'] . '" LIMIT 1') + ); + $po = $u->lookStats($po['data']); + + if (!isset($po['add_minAtack']) && isset($po['sv_minAtack'])) { + $po['add_minAtack'] = $po['sv_minAtack']; + $po['add_maxAtack'] = $po['sv_maxAtack']; + } + + $ins .= 'INSERT INTO `items_main` ( `id`, `name`, `img`, `art`, `type`, `inslot`, `use_magic`, `price`, `price2`, `iznosMAXi`, `massa`, `tr_level`, `tr_s1`, `tr_s2`, `tr_s3`, `tr_s4`, `tr_s5`, `tr_s6`, `add_s1`, `add_s2`, `add_s3`, `add_s4`, `add_s5`, `add_s6`, `add_hp`, `add_mp`, `add_m1`, `add_m2`, `add_m3`, `add_m4`, `add_b1`, `add_b2`, `add_b3`, `add_b4`, `add_attack_min`, `add_attack_max` ,`tr_a1`,`tr_a2`,`tr_a3`,`tr_a4`,`tr_mg1`,`tr_mg2`,`tr_mg3`,`tr_mg4`,`tr_mg5`,`tr_mg6`,`tr_mg7` ,`add_a1`,`add_a2`,`add_a3`,`add_a4`,`add_mg1`,`add_mg2`,`add_mg3`,`add_mg4`,`add_mg5`,`add_mg6`,`add_mg7` ) VALUES '; - $ins .= '( + $ins .= '( NULL, - "'.$pl['name'].'", - "'.$pl['img'].'", - "'.( 0 + round( $po['art'] ) ).'", - "'.$pl['type'].'", - "'.$pl['inslot'].'", + "' . $pl['name'] . '", + "' . $pl['img'] . '", + "' . (0 + round($po['art'])) . '", + "' . $pl['type'] . '", + "' . $pl['inslot'] . '", "", - "'.$pl['price1'].'", - "'.$pl['price2'].'", - "'.$pl['iznosMAXi'].'", - "'.$pl['massa'].'", - "'.( 0 + round( $po['tr_lvl'] ) ).'", - "'.( 0 + round( $po['tr_s1'] ) ).'", - "'.( 0 + round( $po['tr_s2'] ) ).'", - "'.( 0 + round( $po['tr_s3'] ) ).'", - "'.( 0 + round( $po['tr_s4'] ) ).'", - "'.( 0 + round( $po['tr_s5'] ) ).'", - "'.( 0 + round( $po['tr_s6'] ) ).'", - "'.( 0 + round( $po['add_s1'] ) ).'", - "'.( 0 + round( $po['add_s2'] ) ).'", - "'.( 0 + round( $po['add_s3'] ) ).'", - "'.( 0 + round( $po['add_s4'] ) ).'", - "'.( 0 + round( $po['add_s5'] ) ).'", - "'.( 0 + round( $po['add_s6'] ) ).'", - "'.( 0 + round( $po['add_hpAll'] ) ).'", - "'.( 0 + round( $po['add_mpAll'] ) ).'", - "'.( 0 + round( $po['add_m1'] ) ).'", - "'.( 0 + round( $po['add_m2'] ) ).'", - "'.( 0 + round( $po['add_m3'] ) ).'", - "'.( 0 + round( $po['add_m4'] ) ).'", - "'.( 0 + round( $po['add_mib1'] ) ).'", - "'.( 0 + round( $po['add_mib2'] ) ).'", - "'.( 0 + round( $po['add_mib3'] ) ).'", - "'.( 0 + round( $po['add_mib4'] ) ).'", - "'.( 0 + round( $po['add_minAtack'] ) ).'", - "'.( 0 + round( $po['add_maxAtack'] ) ).'", - "'.( 0 + round( $po['tr_a1'] ) ).'", - "'.( 0 + round( $po['tr_a2'] ) ).'", - "'.( 0 + round( $po['tr_a3'] ) ).'", - "'.( 0 + round( $po['tr_a4'] ) ).'", - "'.( 0 + round( $po['tr_mg1'] ) ).'", - "'.( 0 + round( $po['tr_mg2'] ) ).'", - "'.( 0 + round( $po['tr_mg3'] ) ).'", - "'.( 0 + round( $po['tr_mg4'] ) ).'", - "'.( 0 + round( $po['tr_mg5'] ) ).'", - "'.( 0 + round( $po['tr_mg6'] ) ).'", - "'.( 0 + round( $po['tr_mg7'] ) ).'", - "'.( 0 + round( $po['add_a1'] ) ).'", - "'.( 0 + round( $po['add_a2'] ) ).'", - "'.( 0 + round( $po['add_a3'] ) ).'", - "'.( 0 + round( $po['add_a4'] ) ).'", - "'.( 0 + round( $po['add_mg1'] ) ).'", - "'.( 0 + round( $po['add_mg2'] ) ).'", - "'.( 0 + round( $po['add_mg3'] ) ).'", - "'.( 0 + round( $po['add_mg4'] ) ).'", - "'.( 0 + round( $po['add_mg5'] ) ).'", - "'.( 0 + round( $po['add_mg6'] ) ).'", - "'.( 0 + round( $po['add_mg7'] ) ).'" + "' . $pl['price1'] . '", + "' . $pl['price2'] . '", + "' . $pl['iznosMAXi'] . '", + "' . $pl['massa'] . '", + "' . (0 + round($po['tr_lvl'])) . '", + "' . (0 + round($po['tr_s1'])) . '", + "' . (0 + round($po['tr_s2'])) . '", + "' . (0 + round($po['tr_s3'])) . '", + "' . (0 + round($po['tr_s4'])) . '", + "' . (0 + round($po['tr_s5'])) . '", + "' . (0 + round($po['tr_s6'])) . '", + "' . (0 + round($po['add_s1'])) . '", + "' . (0 + round($po['add_s2'])) . '", + "' . (0 + round($po['add_s3'])) . '", + "' . (0 + round($po['add_s4'])) . '", + "' . (0 + round($po['add_s5'])) . '", + "' . (0 + round($po['add_s6'])) . '", + "' . (0 + round($po['add_hpAll'])) . '", + "' . (0 + round($po['add_mpAll'])) . '", + "' . (0 + round($po['add_m1'])) . '", + "' . (0 + round($po['add_m2'])) . '", + "' . (0 + round($po['add_m3'])) . '", + "' . (0 + round($po['add_m4'])) . '", + "' . (0 + round($po['add_mib1'])) . '", + "' . (0 + round($po['add_mib2'])) . '", + "' . (0 + round($po['add_mib3'])) . '", + "' . (0 + round($po['add_mib4'])) . '", + "' . (0 + round($po['add_minAtack'])) . '", + "' . (0 + round($po['add_maxAtack'])) . '", + "' . (0 + round($po['tr_a1'])) . '", + "' . (0 + round($po['tr_a2'])) . '", + "' . (0 + round($po['tr_a3'])) . '", + "' . (0 + round($po['tr_a4'])) . '", + "' . (0 + round($po['tr_mg1'])) . '", + "' . (0 + round($po['tr_mg2'])) . '", + "' . (0 + round($po['tr_mg3'])) . '", + "' . (0 + round($po['tr_mg4'])) . '", + "' . (0 + round($po['tr_mg5'])) . '", + "' . (0 + round($po['tr_mg6'])) . '", + "' . (0 + round($po['tr_mg7'])) . '", + "' . (0 + round($po['add_a1'])) . '", + "' . (0 + round($po['add_a2'])) . '", + "' . (0 + round($po['add_a3'])) . '", + "' . (0 + round($po['add_a4'])) . '", + "' . (0 + round($po['add_mg1'])) . '", + "' . (0 + round($po['add_mg2'])) . '", + "' . (0 + round($po['add_mg3'])) . '", + "' . (0 + round($po['add_mg4'])) . '", + "' . (0 + round($po['add_mg5'])) . '", + "' . (0 + round($po['add_mg6'])) . '", + "' . (0 + round($po['add_mg7'])) . '" );'; - $ins .= "\n".'
'; - } - - echo $ins; - - die(); + $ins .= "\n" . '
'; + } + + echo $ins; + + die(); } -if( isset($_GET['test'])) { - $i = 3; - - - function yrn($sila) { - $r = 0; - - $level = $_GET['test']; - - $r = 2 + $level + $sila - round($sila / 5); - - return $r; - } - - - while( $i <= 100 ) { - echo ' '; - echo $i.' = '.yrn($i).''; - echo ''; - $i++; - } - - die(); +if (isset($_GET['test'])) { + $i = 3; + + + function yrn($sila) + { + return 2 + $_GET['test'] + $sila - round($sila / 5); + } + + + while ($i <= 100) { + echo ' '; + echo $i . ' = ' . yrn($i); + echo ''; + $i++; + } + + die(); } -function getIP() { - if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP']; - return $_SERVER['REMOTE_ADDR']; +function getIP() +{ + return isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR']; } -if(isset($_GET['robot'])) { - -}elseif(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP() != '31.131.116.166') { - if( !isset($_GET['test'])) { - die(getIP().'
'.$_SERVER['SERVER_ADDR']); - } +if (!isset($_GET['robot']) && getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP( + ) != '31.131.116.166' && !isset($_GET['test'])) { + die(getIP() . '
' . $_SERVER['SERVER_ADDR']); } -define('GAME',true); +const GAME = true; -setlocale(LC_CTYPE ,"ru_RU.CP1251"); +setlocale(LC_CTYPE, "ru_RU.CP1251"); include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/bot.priem.php'); -include('_incl_data/class/bot.logic.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').' ( ): '.mysql_real_escape_string($t).'","capitalcity","LEL","6","1","-1")'); +$count = [0, 0, 0, 0, 0, 0]; + +function inuser_go_btl($id) +{ + if (isset($id['id'])) { + file_get_contents( + 'https://new-combats.com/jx/battle/refresh.php?uid=' . $id['id'] . '&cron_core=' . md5( + $id['id'] . '_brfCOreW@!_' . $id['pass'] + ) . '&pass=' . $id['pass'] + ); + } } -$count = array( - 0, - 0, - 0, - 0, - 0, - 0 +$sp = mysql_query( + 'SELECT `u`.* , `s`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `u`.`pass` = "botforpeople" ORDER BY `s`.`nextAct` ASC LIMIT 200' ); -function inuser_go_btl($id) { - if(isset($id['id'])) { - file_get_contents('https://new-combats.com/jx/battle/refresh.php?uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass']); - } +$btltest = []; + +while ($pl = mysql_fetch_array($sp)) { + + $i++; + + if ($pl['zv'] == 0 && ($pl['battle'] == 0 || !isset($btltest[$pl['battle']]) || $btltest[$pl['battle']] < 10)) { + + $btltest[$pl['battle']]++; + + if ($pl['timereg'] == 0) { + mysql_query('UPDATE `users` SET `timereg` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } else { + mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + + if ($pl['bot'] == 0) { + mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + + mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + + BotLogic::start($pl['id']); + + } else { + + if ($pl['zv'] > 0) { + BotLogic::start($pl['id']); + } + + if ($pl['timereg'] == 0) { + mysql_query('UPDATE `users` SET `timereg` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } else { + mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + + if ($pl['bot'] == 0) { + mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + mysql_query('UPDATE `stats` SET `nextAct` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + + echo '*'; + } + echo '+'; + echo '[' . $pl['login'] . '] -> : ' . $pl['ipreg'] . ' , : ' . ($pl['timeMain'] - time( + )) . ' ., : ' . $pl['zv'] . ', : ' . $pl['battle'] . ''; + echo '
'; } - -$sp = mysql_query('SELECT `u`.* , `s`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `u`.`pass` = "botforpeople" ORDER BY `s`.`nextAct` ASC LIMIT 200'); - -$btltest = array(); - -while($pl = mysql_fetch_array($sp)) { - - $i++; - - if( $pl['zv'] == 0 && ($pl['battle'] == 0 || !isset($btltest[$pl['battle']]) || $btltest[$pl['battle']] < 10)) { - - $btltest[$pl['battle']]++; - - if( $pl['timereg'] == 0 ) { - mysql_query('UPDATE `users` SET `timereg` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }else{ - mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - if( $pl['bot'] == 0 ) { - mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - - botLogic::start( $pl['id'] ); - - }else{ - - if( $pl['zv'] > 0 ) { - botLogic::start( $pl['id'] ); - } - - if( $pl['timereg'] == 0 ) { - mysql_query('UPDATE `users` SET `timereg` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }else{ - mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - if( $pl['bot'] == 0 ) { - mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - mysql_query('UPDATE `stats` SET `nextAct` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - - echo '*'; - } - echo '+'; - echo '['.$pl['login'].'] -> : '.$pl['ipreg'].' , : '.($pl['timeMain']-time()).' ., : '.$pl['zv'].', : '.$pl['battle'].''; - echo '
'; -} -?> diff --git a/_incl_data/.htaccess b/_incl_data/.htaccess index 3418e55a..8d2f2563 100644 --- a/_incl_data/.htaccess +++ b/_incl_data/.htaccess @@ -1 +1 @@ -deny from all \ No newline at end of file +deny from all diff --git a/_incl_data/__config.php b/_incl_data/__config.php index ea039956..b7ba8941 100644 --- a/_incl_data/__config.php +++ b/_incl_data/__config.php @@ -5,81 +5,18 @@ ini_set('display_errors', 'Off'); setlocale(LC_CTYPE, "ru_RU.CP1251"); date_default_timezone_set('Europe/Moscow'); -$c = [ - 'ver' => '1.8.3.7', -]; -/* */ -$c['name'] = ' '; -$c['title'] = '' . $c['name'] . ' - , '; // -$c['title2'] = ' - , !'; -$c['title3'] = $c['name']; -$c['keys'] = $c['name'] . ', combats.com, ' . $c['name'] . ' , ' . $c['name'] . ' , ' . $c['name'] . ', ' . $c['name'] . ', ' . $c['name'] . ' , ' . $c['name'] . ' , ' . $c['name'] . ', , , , , , , ' . $c['name'] . ', , combats, , combats ru, combats com, OldBK, oldbk ru, oldbk com, , old bk, , mycombats, rebk, recombats, oldcombats, obk2'; // META -$c['desc'] = '' . $c['name'] . ' 2004-2009, . ' . $c['name'] . ' 2004-2009, , , .'; // META +header('Cache-Control: no-cache, no-store, must-revalidate'); +header('Pragma: no-cache'); +header('Expires: 0'); -// -$c['host'] = 'new-combats.com'; -$c['forum'] = 'forum.' . $c['host']; -$c['img'] = 'img' . $c['host']; -$c['thiscity'] = 'capitalcity'; -$c['capitalcity'] = $c['host']; -$c['abandonedplain'] = $c['host']; -$c['exit'] = ''; +require_once 'mysql_override.php'; -// -$c['curency_name'] = 'RUB'; -$c['curency_value'] = 36; - -// -$c['bot_level'] = 0; // () -$c['propsk_die'] = 0; // , 0 - . , >= 1 - - -// -$c['exp'] = 0; // -$c['shop_type1'] = 100; // -$c['shop_type2'] = 90; // -$c['shop_all'] = 0; // ! , 0 - . -$c['shop_all_type1'] = 100; // ! , 0 - . -$c['shop_all_type2'] = 100; // ! , 0 - . -// -$c['nosanich'] = true; // - true , - false -$c['zuby'] = false; // -$c['limitedexp'] = false; // -$c['infinity5level'] = false; // 5 -$c['expstop'] = 2999999; //9; // 11 149999999 -$c['expstopu'] = 2999999; // -$c['noobgade'] = false; // () -$c['bonusonline'] = true; // -$c['level_ransfer'] = 8; // -$c['znahar'] = true; // -$c['nolevel'] = false; // -$c['noitembuy'] = false; // -$c['effz'] = 0; // -$c['money_haot'] = true; // -$c['crtoecr'] = 500; // ( 0, ) -$c['ecrtocr'] = 200; // -$c['bonuslevel'] = true; // -$c['bonussocial'] = false; // - -$c['w'] = date('w'); -$c['m'] = date('m'); - -$code = '1'; -$c['counters'] = ''; -$c['counters_noFrm'] = ''; -$c['securetime'] = 0; // ( ) - -$c['copyright'] = 'Copyright ' . date('Y') . ' '; - -if (isset($_GET['version'])) { - die('Version: ' . $c['ver']); -} - -// , . +// Для всех доработок, пока нет автозагрузки классов. require_once 'class/Insallah/Config.php'; -// . -// ! -// " ." +// Попробуем в автозагрузку. +// Никогда не заработает с такими названиями классов и файлов! +// "На потом." spl_autoload_register(function ($className) { # 1 with namespaces # 2 without @@ -87,9 +24,16 @@ spl_autoload_register(function ($className) { __DIR__ . '/class/' . str_replace('\\', '/', $className . '.php'), __DIR__ . '/class/' . $className . '.php' ]; - foreach ($fileName as $file) - if (file_exists($file)) { - require_once $file; - break; + foreach ($fileName as $file) { + if (file_exists($file)) { + require_once $file; + break; + } } }); + +$code = '1'; +$c = (new \Core\Config())->get(); +if (isset($_GET['version'])) { + die('Version: ' . $c['ver']); +} diff --git a/_incl_data/autoload.php b/_incl_data/autoload.php new file mode 100644 index 00000000..2cbd855d --- /dev/null +++ b/_incl_data/autoload.php @@ -0,0 +1,45 @@ + __DIR__ . '/class/', + 'Insallah' => __DIR__ . '/class/Insallah/', + ]; + $parts = explode('\\', $classname); + $namespace = array_shift($parts); + $classFile = array_pop($parts) . '.php'; + + if (!array_key_exists($namespace, $classMap)) { + return; + } + + $path = implode(DIRECTORY_SEPARATOR, $parts); + $file = $classMap[$namespace] . $path . DIRECTORY_SEPARATOR . $classFile; + + if (!file_exists($file) && !class_exists($classname)) { + return; + } + + require_once $file; +}); diff --git a/_incl_data/class/Core/Mail.php b/_incl_data/class/Core/Mail.php new file mode 100644 index 00000000..3683a255 --- /dev/null +++ b/_incl_data/class/Core/Mail.php @@ -0,0 +1,40 @@ +IsSMTP(); // Set mailer to use SMTP + $mail->Host = 'smtp.mail.yahoo.com'; // Specify main and backup server + $mail->SMTPAuth = true; // Enable SMTP authentication + $mail->Username = 'newcombats@yahoo.com'; // SMTP username + $mail->Password = 'uqcdbnsoagxcyysh'; + $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted + $mail->Port = 587; + $mail->CharSet = 'UTF-8'; + + $mail->From = 'newcombats@yahoo.com'; + $mail->FromName = mb_convert_encoding(' ', 'UTF-8', 'CP1251'); + $mail->AddAddress($to); // Add a recipient + + $mail->IsHTML(true); // Set email format to HTML + + $mail->Subject = $subject; + $mail->Body = '
' . $message . '
'; + $mail->AltBody = $message; + + if (!$mail->Send()) { + return 'Message could not be sent. Mailer Error: ' . $mail->ErrorInfo; + } + return 1; + } +} \ No newline at end of file diff --git a/_incl_data/class/Insallah/Achievements.php b/_incl_data/class/Insallah/Achievements.php index 9fdbd3eb..ac26441f 100644 --- a/_incl_data/class/Insallah/Achievements.php +++ b/_incl_data/class/Insallah/Achievements.php @@ -93,7 +93,7 @@ class Achievements ], ]; - public function __construct(\user $user) + public function __construct(\User $user) { $this->user = $user; $this->info = Db::getRow('select * from users_achiv where id = ?', [$user->info['id']]); diff --git a/_incl_data/class/Insallah/Config.php b/_incl_data/class/Insallah/Config.php index ab123b1b..02d1d4f9 100644 --- a/_incl_data/class/Insallah/Config.php +++ b/_incl_data/class/Insallah/Config.php @@ -10,7 +10,6 @@ require_once 'Tournament/Tournament.php'; require_once 'Tournament/TournamentModel.php'; require_once 'Achievements.php'; - // . if (Tournament::IS_ENABLED) { (new Tournament())->startAllBattles(); diff --git a/_incl_data/class/Insallah/Core/Db.php b/_incl_data/class/Insallah/Core/Db.php index fcdcc9fe..e64b9728 100644 --- a/_incl_data/class/Insallah/Core/Db.php +++ b/_incl_data/class/Insallah/Core/Db.php @@ -2,7 +2,9 @@ namespace Insallah; +use Core\Database; use Exception; +use http\Message; use PDO; use PDOException; use PDOStatement; @@ -35,21 +37,23 @@ class Db * DB constructor. * @throws Exception */ - public function __construct(){ - if (self::$instance === null){ + public function __construct() + { + if (self::$instance === null) { try { self::$db = new PDO( - 'mysql:host='.self::DB_HOST.';dbname='.self::DB_NAME, + 'mysql:host=' . self::DB_HOST . ';dbname=' . self::DB_PREFIX . self::DB_NAME, self::DB_USER, self::DB_PASSWORD, - $options = [ + [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES ".self::CHARSET + PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES " . self::CHARSET, ] ); +// self::$db = Database::pdoinit(); } catch (PDOException $e) { - throw new Exception ($e->getMessage()); + throw new Exception($e->getMessage()); } } return self::$instance; @@ -59,7 +63,8 @@ class Db * @param $stmt * @return PDOStatement */ - public static function query($stmt) { + public static function query($stmt) + { return self::$db->query($stmt); } @@ -67,7 +72,8 @@ class Db * @param $stmt * @return PDOStatement */ - public static function prepare($stmt) { + public static function prepare($stmt) + { return self::$db->prepare($stmt); } @@ -75,25 +81,28 @@ class Db * @param $query * @return int */ - static public function exec($query) { + static public function exec($query) + { return self::$db->exec($query); } /** * @return string */ - static public function lastInsertId() { + static public function lastInsertId() + { return self::$db->lastInsertId(); } /** - * @param $query + * @param $query * @param array $args * @return PDOStatement * @throws Exception */ - public static function run($query, $args = []) { - try{ + public static function run($query, $args = []) + { + try { if (!$args) { return self::query($query); } @@ -106,29 +115,32 @@ class Db } /** - * @param $query + * @param $query * @param array $args * @return mixed */ - public static function getRow($query, $args = []) { + public static function getRow($query, $args = []) + { return self::run($query, $args)->fetch(); } /** - * @param $query + * @param $query * @param array $args * @return array */ - public static function getRows($query, $args = []) { + public static function getRows($query, $args = []) + { return self::run($query, $args)->fetchAll(); } /** - * @param $query + * @param $query * @param array $args * @return mixed */ - public static function getValue($query, $args = []) { + public static function getValue($query, $args = []) + { $result = self::getRow($query, $args); if (!empty($result)) { $result = array_shift($result); @@ -137,11 +149,12 @@ class Db } /** - * @param $query + * @param $query * @param array $args * @return array */ - public static function getColumn($query, $args = []) { + public static function getColumn($query, $args = []) + { return self::run($query, $args)->fetchAll(PDO::FETCH_COLUMN); } diff --git a/_incl_data/class/Insallah/Runes/Runes.php b/_incl_data/class/Insallah/Runes/Runes.php index e8cafdcc..e40b76c1 100644 --- a/_incl_data/class/Insallah/Runes/Runes.php +++ b/_incl_data/class/Insallah/Runes/Runes.php @@ -4,8 +4,7 @@ namespace Insallah; class Runes { - /** Создаём руну в зависимости от уровня. - * + /** . * @param $level * * @return array @@ -15,7 +14,7 @@ class Runes if (!in_array($level, [8, 9, 10])) { return []; } - $power = [8 => 3, 9 => 5, 10 => 7]; + $power = [8 => 3, 9 => 3, 10 => 5]; $stats = [8 => 1, 9 => 3, 10 => 3]; $rand9 = array_rand(array_flip(['hpAll', 'm2', 'm5'])); $runes = [ @@ -27,24 +26,24 @@ class Runes ['s5', 'm11', 'mpAll', 'pzm'] ]; $vars = [ - 's1' => ['Сила', mt_rand(1, $stats[$level])], - 's2' => ['Ловкость', mt_rand(1, $stats[$level])], - 's3' => ['Интуиция', mt_rand(1, $stats[$level])], - 's5' => ['Интеллект', mt_rand(1, $stats[$level])], - 'pa1' => ['Мощности Колющего урона', mt_rand(1, $power[$level])], - 'pa2' => ['Мощности Рубящего урона', mt_rand(1, $power[$level])], - 'pa3' => ['Мощности Дробящего урона', mt_rand(1, $power[$level])], - 'pa4' => ['Мощности Режущего урона', mt_rand(1, $power[$level])], - 'm2' => ['мф. Против Критического Удара', mt_rand(5, 15)], - 'm3' => ['МК', mt_rand(1, 3)], - 'antm3' => ['ПМК', mt_rand(1, 3)], - 'm5' => ['мф. Против Увертывания', mt_rand(5, 10)], - 'm11' => ['Мощности Магии стихии', mt_rand(1, $power[$level])], + 's1' => ['', mt_rand(1, $stats[$level])], + 's2' => ['', mt_rand(1, $stats[$level])], + 's3' => ['', mt_rand(1, $stats[$level])], + 's5' => ['', mt_rand(1, $stats[$level])], + 'pa1' => [' ', mt_rand(1, $power[$level])], + 'pa2' => [' ', mt_rand(1, $power[$level])], + 'pa3' => [' ', mt_rand(1, $power[$level])], + 'pa4' => [' ', mt_rand(1, $power[$level])], + 'm2' => ['. ', mt_rand(5, 15)], + 'm3' => ['', mt_rand(1, 3)], + 'antm3' => ['', mt_rand(1, 3)], + 'm5' => ['. ', mt_rand(5, 10)], + 'm11' => [' ', mt_rand(1, $power[$level])], 'hpAll' => ['HP', mt_rand(5, 15)], 'mpAll' => ['MP', mt_rand(10, 20)], - 'pzm' => ['Подавление защиты от магии', 1], - 'za' => ['Защита от Урона', mt_rand(5, 10)], - 'zma' => ['Защита от Магии', mt_rand(5, 10)] + 'pzm' => [' ', 1], + 'za' => [' ', mt_rand(5, 10)], + 'zma' => [' ', mt_rand(5, 10)] ]; $rune = $runes[array_rand($runes)]; // arr (s, pa\m, rand9\mpAll, other) @@ -52,40 +51,40 @@ class Runes $runeVals = [$vars[$rune[0]][1], $vars[$rune[1]][1], $vars[$rune[2]][1], $vars[$rune[3]][1]]; $resultRune = array_combine($rune, $runeVals); $resultText = array_combine($runeTxt, $runeVals); - if ($level < 10) { // Отрезаем параметр 4. + if ($level < 10) { // 4. array_pop($resultRune); array_pop($resultText); } - if ($level < 9) { // Отрезаем параметр 3. + if ($level < 9) { // 3. array_pop($resultRune); array_pop($resultText); } - //Строчка data в базу + // data $returnData = '|' . http_build_query($resultRune, '', '|'); $returnData = str_replace('|', '|add_', $returnData); - //Строчка человекопонятных параметров в статус. - $returnText = urldecode(http_build_query($resultText, '', ', ')); - $returnText = 'Характеристики Руны: ' . str_replace('=', ': +', $returnText) . '.'; + // . + $returnText = urldecode(http_build_query($resultText, '', ', ')); + $returnText = ' : ' . str_replace('=', ': +', $returnText) . '.'; return [$returnData, $returnText]; } - /** Выкусывает руну из предмета. + /** . * * @param array $itemDataArray - * data предмета + * data * - * @return array массив, item - предмет, rune - руна из предмета, rune_id - id руны. - * Оба в подготовленном строчном формате для data + * @return array , item - , rune - , rune_id - id . + * data */ public static function removeRuneData($itemDataArray) { - # Ищем есть ли в предмете руна определённого типа. + # . $runeid = array_search('rune_id', array_flip($itemDataArray)); if (!in_array($runeid, [6001, 6002, 6003])) { return []; } $bonusArgs = 0; - # В зависимости от типа руны считаем количество элементов-бонусов. + # -. if ($runeid === 6001) { $bonusArgs = 2; } diff --git a/_incl_data/class/PriemsMain.php b/_incl_data/class/PriemsMain.php deleted file mode 100644 index 3843c79c..00000000 --- a/_incl_data/class/PriemsMain.php +++ /dev/null @@ -1,14 +0,0 @@ -users[$this->uids[$u1]]['login']); - $v_z = 0 + $this->stats[$this->uids[$u2]]['zm' . $type]; // - $v_p = 0 + round(($this->stats[$this->uids[$u1]]['pzm' . $type] + $this->stats[$this->uids[$u1]]['pzm']) * 0.4); // - $v_m = 0 + $this->stats[$this->uids[$u1]]['pm' . $type]; // - // - return ' magelogin=' . $v_l . ' onMouseOver=top.hi(this,maginfo(' . $v_z . ',' . $v_p . ',' . $v_m . ',this),event,3,1,1,1,null); onMouseOut=top.hic(); onMouseDown=top.hic(); '; - } - - public function typeBattle($x) - { - $r = [0, 0, ' ', ' ']; - if ($x < 50000) { - // - } elseif ($x >= 50000 && $x < 100000) { - $r = [25, 50, ' ', ' ']; - } elseif ($x < 500000) { - $r = [50, 75, ' ', ' ']; - } elseif ($x < 1000000) { - $r = [75, 100, ' ', ' ']; - } elseif ($x < 2500000) { - $r = [100, 125, ' ', ' ']; - } elseif ($x >= 5000000) { - $r = [150, 150, ' ', ' ']; - } - return $r; - } - - public $mncolor = [ - 1 => '006699', - 2 => '006699', - 3 => '006699', - 4 => '006699', - 5 => '006699', - 6 => '006699', - 7 => '006699', - ]; // - public $mcolor = [ - 1 => 'A00000', - 2 => '008080', - 3 => '0000FF', - 4 => 'A52A2A', - 5 => '006699', - 6 => '006699', - 7 => '006699', - ]; // - public $mname = [ - '' => 1, - '' => 2, - '' => 3, - '' => 4, - '' => 5, - '' => 6, - '' => 7, - ]; - public $prm = [ - /* - act: 1 - - 2 - - type_of: 1 - - 2 - - 3 - - 4 - - 5 - - */ - 1 => ['name' => '', 'act' => 1, 'type_of' => 5], - 2 => ['name' => '', 'act' => 2, 'type_of' => 3], - 4 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 7 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - - - 290 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - - // - //291 => array( 'name' => ' ', 'act' => 2, 'type_of' => 4 ), - - // - 294 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 295 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 296 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 297 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 298 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - // - - 141 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 147 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 148 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 149 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 150 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - - - 142 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 144 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 146 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 145 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - - 8 => ['name' => ' ', 'act' => 1, 'type_of' => 1], - 9 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 10 => ['name' => '', 'act' => 1, 'type_of' => 1], - 11 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - - 45 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - - 47 => ['name' => ' ', 'act' => 2, 'type_of' => 2], - 48 => ['name' => ' ', 'act' => 1, 'type_of' => 1], - 49 => ['name' => ' ', 'act' => 1, 'type_of' => 1], - 138 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 140 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - 193 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - //204 => array( 'name' => '', 'act' => 2 , 'type_of' => 5 ), - 204 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 211 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - 213 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - 215 => ['name' => ' ', 'act' => 1, 'type_of' => 1], - 216 => ['name' => ' ', 'act' => 2, 'type_of' => 2], - 217 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 219 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 220 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 222 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 225 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - 226 => ['name' => '', 'act' => 1, 'type_of' => 4], - 231 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 234 => ['name' => '', 'act' => 2, 'type_of' => 4], - 235 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 342 => ['name' => ' ', 'act' => 0, 'type_of' => 0], - 343 => ['name' => '', 'act' => 0, 'type_of' => 0], - - 237 => ['name' => ' ', 'act' => 2, 'type_of' => 3 /*, 'moment' => 3*/], - - 239 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 240 => ['name' => ' ', 'act' => 2, 'type_of' => 5] - - // - , - 21 => ['name' => ' [4]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 73 => ['name' => ' [5]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 74 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 75 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 76 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 77 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 78 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 79 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - - // - , - 22 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 80 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 81 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 82 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 83 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 84 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - - // - , - 36 => ['name' => ' [5]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 85 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 86 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 87 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 88 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 89 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 90 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - - // - , - 23 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 70 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 71 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 72 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - - // - , - 269 => ['name' => ' [8]', 'act' => 2, 'type_of' => 9] - , - 276 => ['name' => ' [9]', 'act' => 2, 'type_of' => 9] - , - 277 => ['name' => ' [10]', 'act' => 2, 'type_of' => 9] - - // - , - 270 => ['name' => ' ', 'act' => 2, 'type_of' => 5, 'type_sec' => 5] - - // - , - 280 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - - // - , - 281 => ['name' => ' ', 'act' => 2, 'type_of' => 5] - - // - , - 282 => ['name' => ' ', 'act' => 2, 'type_of' => 5] - - // - // - - // - , - 24 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 3] - - // - , - 210 => ['name' => ' [4]', 'act' => 2, 'type_of' => 8] - , - 209 => ['name' => ' [7]', 'act' => 2, 'type_of' => 8] - , - 208 => ['name' => ' [8]', 'act' => 2, 'type_of' => 8] - , - 207 => ['name' => ' [9]', 'act' => 2, 'type_of' => 8] - , - 206 => ['name' => ' [10]', 'act' => 2, 'type_of' => 8] - , - 284 => ['name' => ' [11]', 'act' => 2, 'type_of' => 8] - - // - , - 175 => ['name' => ' [7]', 'act' => 2, 'type_of' => 8] - , - 176 => ['name' => ' [8]', 'act' => 2, 'type_of' => 8] - , - 177 => ['name' => ' [9]', 'act' => 2, 'type_of' => 8] - , - 178 => ['name' => ' [10]', 'act' => 2, 'type_of' => 8] - , - 179 => ['name' => ' [11]', 'act' => 2, 'type_of' => 8] - - // - // - - // - , - 42 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 121 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 122 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 123 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 124 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 125 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - - // - , - 249 => ['name' => ' ', 'act' => 2, 'type_of' => 4] - - // - , - 248 => ['name' => ' ', 'act' => 2, 'type_of' => 4] - - // - , - 251 => ['name' => ': ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 252 => ['name' => ': ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - - // - // - - // - , - 273 => ['name' => ' [10]', 'act' => 1, 'type_of' => 4] - , - 286 => ['name' => ' [9]', 'act' => 1, 'type_of' => 4] - , - 287 => ['name' => ' [8]', 'act' => 1, 'type_of' => 4] - , - 288 => ['name' => ' [7]', 'act' => 1, 'type_of' => 4] - - // - , - 255 => ['name' => ' ', 'act' => 2, 'type_of' => 8] - - // - // - - // - , - 337 => ['name' => ' ', 'act' => 2, 'type_of' => 5] - - // - , - 33 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 56 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 57 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 58 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 59 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 60 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - - // - , - 245 => ['name' => ' ', 'act' => 2, 'type_of' => 9] - // - , - 327 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3] - , - 328 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 329 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 330 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 331 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 332 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 333 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3] - , - 334 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 335 => [ - 'name' => ' ', - 'act' => 2, - 'type_of' => 0, - 'moment' => 0, - 'moment_end' => 3, - ] - //1 , - , - 299 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 300 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 301 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 302 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 303 => ['name' => ' ', 'act' => 2, 'type_of' => 4] - , - 304 => ['name' => ' !', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3] - , - 305 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - ]; - - // - public function saveLogs($id, $type) - { - if ($type == 'all') { - $type = ''; - mysql_query('INSERT INTO `battle_logs_save` SELECT `id`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type` FROM `battle_logs` WHERE `battle` = "' . $this->info['id'] . '" AND `id_hod` <= ' . ($this->hodID) . ''); - } else { - mysql_query('INSERT INTO `battle_logs_save` SELECT `id`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type` FROM `battle_logs` WHERE `battle` = "' . $this->info['id'] . '" AND `id_hod` <= ' . ($this->hodID - 5) . ''); - } - mysql_query('DELETE FROM `battle_logs` WHERE `battle` = "' . $this->info['id'] . '" ' . $type . ''); - mysql_query('DELETE FROM `battle_stat` WHERE `battle` < "' . ($this->info['id'] - 100) . '" '); - mysql_query('DELETE FROM `battle_actions` WHERE `btl` = "' . $this->info['id'] . '" '); - //mysql_query('OPTIMIZE TABLE `battle_logs`'); - //mysql_query('OPTIMIZE TABLE `battle_stat`'); - //mysql_query('OPTIMIZE TABLE `battle_actions`'); - } - - public function hphe($uid, $hp, $false_t7 = false) - { - global $u; - if (!isset($this->stats[$this->uids[$uid]])) { - echo 'WARNING! ! !'; - } else { - $hpnow = floor($this->stats[$this->uids[$uid]]['hpNow']); - $hpall = $this->stats[$this->uids[$uid]]['hpAll']; - if ($hp > 0) { - // - if ($hpnow + $hp > $hpall) { - $hpli = $hpnow + $hp - $hpall; - $hp -= $hpli; - } - if (isset($this->stats[$this->uids[$uid]]['min_heal_proc']) && $this->stats[$this->uids[$uid]]['min_heal_proc'] < -99) { - $hp = 0; - } else { - $hp = $hp / 100 * (100 + $this->stats[$this->uids[$uid]]['min_heal_proc']); - } - // - if ($false_t7 == false) { - if ($this->users[$this->uids[$uid]]['tactic7'] <= 0) { - $hp = 0; - $this->users[$this->uids[$uid]]['tactic7'] = 0; - $this->stats[$this->uids[$uid]]['tactic7'] = $this->users[$this->uids[$uid]]['tactic7']; - } else { - $gdhh = round($hp / $this->stats[$this->uids[$uid]]['hpAll'] * 10, 2); - if ($gdhh == 0) { - $gdhh = 0.01; - } - - $gdhd = round($this->users[$this->uids[$uid]]['tactic7'] / $gdhh * 100); - - $this->users[$this->uids[$uid]]['tactic7'] = round(($this->users[$this->uids[$uid]]['tactic7'] - $gdhh), - 2); - if ($this->users[$this->uids[$uid]]['tactic7'] < 0) { - $this->users[$this->uids[$uid]]['tactic7'] = 0; - } - $this->stats[$this->uids[$uid]]['tactic7'] = $this->users[$this->uids[$uid]]['tactic7']; - if ($gdhd < 100) { - $hp = floor($hp / 100 * $gdhd); - } - } - } - } elseif ($hp < 0) { - // - if ($hpnow + $hp < 0) { - $hpli = $hpnow + $hp; - $hp += -($hpli); - } - } - - if ($this->stats[$this->uids[$uid]]['hpNow'] < 1) { - $hp = 0; - } - - $this->stats[$this->uids[$uid]]['last_hp'] = -$hp; - mysql_query('UPDATE `stats` SET - `last_hp` = "' . $this->users[$this->uids[$uid]]['last_hp'] . '", - `tactic7` = "' . $this->users[$this->uids[$uid]]['tactic7'] . '" - WHERE `id` = "' . $uid . '" LIMIT 1'); - } - - return floor($hp); - } - - public function deleffm($pid, $uid, $id) - { - if ($id > 0) { - if (!mysql_query('DELETE FROM `eff_users` WHERE `id` = "' . mysql_real_escape_string($id) . '" AND `v1` = "priem" AND `v2` != "0" LIMIT 1')) { - echo '[* [' . $id . ',' . $pid . ',' . $uid . ']]'; - } - } else { - if (!mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . mysql_real_escape_string($uid) . '" AND `v1` = "priem" AND `v2` = "' . $pid . '"')) { - } - } - //echo '['.$id.','.$pid.','.$uid.']'; - } - - - public $e, // () - $cached = false, // - $expCoef = 0, # % - $aBexp = 0, // - $mainStatus = 1, // (1 - , 2 - , 3 - . ) - $info = [], // - $users = [], // - $stats = [], // - $uids = [], // id stats users id = 555 , $uids[555] users \ stats - $atacks = [], // () - $ga = [], // uid $ga[ {id } ][ {id } ] - $ag = [], // uid $ga[ {id } ][ {id } ] - $na = 1, // - $np = 1, // - $nm = 1, // - $hodID = 0, - $stnZbVs = 0, - $bots = [], // ID - $iBots = [], // i - $stnZb = [], - $uAtc = [ - 'id' => 0, - 'a' => [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0], - 'b' => 0, - ], // - $lg_itm = [ - 0 => [ - '', - ' ', - '', - '', - '', - ' ', - ' ', - '', - ], - 1 => ['', ' ', ' ', ' '], - 2 => [' ', '', ' ', '', ' '], - 3 => ['', '', ' ', '', ' ', ' '], - 4 => [ - '', - '', - '', - ' ', - ' ', - ' ', - ' ', - ' ', - ], - 5 => [' ', '', ' ', ' ', ' '], - 22 => [''], - ], // - $lg_zon = [ - 1 => [ - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ], - 2 => [' ', ' ', ' ', ' ', ' '], - 3 => [' ', ' ', ' ', ' '], - 4 => [' < >', ' ', ' ', ' ', ' '], - 5 => [' ', ' ', ' ', ' ', ' '], - ]; // - public $is = [], $items = []; - - // ... - public $uclearc = [], $ucleari = []; - - public function clear_cache($uid) - { - if ($uid > 0 && !isset($this->uclearc[$uid])) { - $this->uclearc[$uid] = true; - $this->ucleari[] = $uid; - } - } - - public function clear_cache_start() - { - $i = 0; - while ($i < count($this->ucleari)) { - mysql_query('DELETE FROM `battle_cache` WHERE `uid` = "' . mysql_real_escape_string($this->ucleari[$i]) . '"'); - $i++; - } - } - - // - public function testYronPriemAttack($pid, $u1, $u2, $hp) - { - // 1 2 pid hp . - - /* - - */ - // - $eff = $this->stats[$this->uids[$u2]]['effects']; - $j = 0; - while ($j <= count($eff)) { - if (isset($eff[$j]) && $eff[$j]['id_eff'] == 22 && $eff[$j]['v1'] == 'priem' && $eff[$j]['v2'] > 0) { - // id $eff[$j]['v2'] - if ($eff[$j]['v2'] == 140 || $eff[$j]['v2'] == 211 || $eff[$j]['v2'] == 45) { //|| $eff[$j]['v2'] == 45 - // = 1 , 0 - $hp['y'] = -1; - $hp['r'] = 1; - $hp['k'] = 2; - $hp['m_y'] = 1; - $hp['m_k'] = 2; - } - } - $j++; - } - unset($eff); - - return $hp; - } - - // . - public function magKrit($l2, $t) - { - $r = 0; - $r = $l2 * 2 - 7; - if ($r > $t) { - // ( , 2 ) 6% - //250 . 1% - //$r = -1; , -- - $r = 0; - } else { - // 3% - $r = ceil($t * 0.75); - if ($r > 30) { - $r = 30; - } - if (rand(0, 10000) < $r * 100) { - // - $r = 1; - } else { - $r = 0; - } - } - return $r; - } - - - // - public function hpRef() - { - } - - // - public function testExp($y, $s1, $s2, $id1, $id2) - { - global $u, $c; - - - // - $oplevel = [ // . - 0 => 1, - 1 => 1, - 2 => 1, - 3 => 1, - 4 => 2, - 5 => 2, - 6 => 2, - 7 => 2, - 8 => 3, - 9 => 4, - 10 => 5, - 11 => 6, - 12 => 7, - 13 => 50, - 14 => 75, - ]; - - if ($y < 0) { - $y = 0; - } - if ($s2['hpNow'] < 0) { - //echo '[f]'; - $y = 0; - } - if ($s2['hpNow'] < $y) { - //echo '[d]'; - $y = $s2['hpNow']; - } - 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]; - // - if ($texp > 5) { - $addExp = $addExp * 0.00; - } elseif ($texp > 4) { - $addExp = $addExp * 0.50; - } elseif ($texp > 3) { - $addExp = $addExp * 0.75; - } elseif ($texp > 2) { - $addExp = $addExp * 1.00; - } elseif ($texp > 1) { - $addExp = $addExp * 1.00; - } else { - $addExp = $addExp * 1.00; - } - } - // - if ($this->users[$this->uids[$s2['id']]]['bot'] > 0) { - //$addExp = round($addExp/5); - } - unset($doexp); - } else { - $addExp = 0; - } - - /* - if($s1['level'] > $s2['level']){ - $minProc = 100 - 33*( $s1['level']-$s2['level'] ); - if($minProc < 1) { - $minProc = 1; - } - $addExp = round($addExp/100*$minProc); - } - */ - - if ($this->users[$this->uids[$s2['id']]]['bot_id'] == 0 && $this->stats[$this->uids[$s2['id']]]['itmslvl'] == 0) { - //$addExp = 0; - } - - if ($this->info['typeBattle'] == 9) { - // - // 8 - /*if( $this->users[$this->uids[$s1['id']]]['level'] > $this->users[$this->uids[$s2['id']]]['level'] ) { - if( $this->users[$this->uids[$s2['id']]]['level'] <= 8 ) { - $addExp = 0; - } - }*/ - } - - return $addExp; - } - - // \ - public function takeExp($id, $y, $id1, $id2, $mgregen = false, $nobattle_uron = false) - { - global $u; - if (isset($this->users[$this->uids[$id]])) { - $s1 = $this->stats[$this->uids[$id1]]; - $s2 = $this->stats[$this->uids[$id2]]; - if ($id1 != $id2) { - $e = $this->testExp($y, $s1, $s2, $id1, $id2); - } 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 = [ // . - 4 => 750, - 5 => 1500, - 6 => 3500, - 7 => 8000, - 8 => 25000, - 9 => 50000, - 10 => 75000, - 11 => 125000, - 12 => 250000, - 13 => 500000, - 14 => 750000, - ]; - $dun_expFactor = [ // . - 4 => 5, - 5 => 5, - 6 => 5, - 7 => 5, - 8 => 5, - 9 => 3, - 10 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - ]; - - if (isset($dun_expFactor[(int)$this->users[$this->uids[$id1]]['level']])) { - $e = $e * $dun_expFactor[(int)$this->users[$this->uids[$id1]]['level']]; - } - if ($this->info['dungeon'] > 1 && $this->users[$this->uids[$id1]]['battle'] > 0) { // - $dun_exp = []; // . - $rep = mysql_fetch_array(mysql_query('SELECT `dungeonexp`,`id` FROM `rep` WHERE `id` = "' . $this->users[$this->uids[$id1]]['id'] . '" LIMIT 1')); - $rep = explode(',', $rep['dungeonexp']); - foreach ($rep as $key => $val) { - $val = explode('=', $val); - if (isset($val[0]) && isset($val[1]) && $val[0] != '' && $val[1] != 0) { - $dun_exp[(int)$val[0]] = (int)$val[1]; - } // - } - unset($rep); - - if (!isset($dun_exp[$this->info['dungeon']])) { - $dun_exp[$this->info['dungeon']] = 0; - } - if (!isset($dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']])) { // , . - $e = 0; - } elseif ( - isset($dun_exp[$this->info['dungeon']]) && - $dun_exp[$this->info['dungeon']] >= $dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']] - ) { // , . - $e = 0; - } elseif ( - isset($dun_exp[$this->info['dungeon']]) && - $dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']] > $dun_exp[$this->info['dungeon']] - ) { // . - if (($dun_exp[$this->info['dungeon']] + $e) > $dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']]) { - // , . - $e = abs($e - abs($dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']] - ($e + $dun_exp[$this->info['dungeon']]))); - $dun_exp[$this->info['dungeon']] += $e; - } elseif ($dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']] > ($dun_exp[$this->info['dungeon']] + $e)) { - // , . - $e = $e; - $dun_exp[$this->info['dungeon']] += $e; - } else { - $e = 0; - } - } else { // . - $e = 0; - } - } else { - $e = $e; - } // . - if ($this->info['dungeon'] == 102 && (int)$this->users[$this->uids[$id1]]['bot_id'] == 0) { - $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.']'; - // - if ($mgregen == false && $nobattle_uron == false) { - $this->users[$this->uids[$id1]]['battle_yron'] += floor($y); - if ($this->stats[$this->uids[$id1]]['notactic'] != 1) { - if ($s2['hpAll'] <= 1000) { - if ($this->stats[$this->uids[$id2]]['this_animal'] == 0) { - $this->users[$this->uids[$id1]]['tactic6'] += round(0.1 * (floor($y) / $s2['hpAll'] * 100), - 10); - } else { - $this->users[$this->uids[$id1]]['tactic6'] += round(0.1 * (floor($y) / $s2['hpAll'] * 100), - 10) / 3; - } - } else { - if ($this->stats[$this->uids[$id2]]['this_animal'] == 0) { - $this->users[$this->uids[$id1]]['tactic6'] += round(0.1 * (floor($y) / 1000 * 100), 10); - } else { - $this->users[$this->uids[$id1]]['tactic6'] += round(0.1 * (floor($y) / 1000 * 100), 10) / 3; - } - } - } - } - - //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 '[ ]'; - } else { - $this->stats[$this->uids[$id1]]['battle_exp'] = $this->users[$this->uids[$id1]]['battle_exp']; - $this->clear_cache($id1); - $this->stats[$this->uids[$id1]]['tactic6'] = $this->users[$this->uids[$id1]]['tactic6']; - if ($id1 == $u->info['id']) { - $u->info['tactic6'] = $this->users[$this->uids[$id1]]['tactic6']; - $u->stats['tactic6'] = $this->users[$this->uids[$id1]]['tactic6']; - $u->info['battle_exp'] = $this->users[$this->uids[$id1]]['battle_exp']; - $u->info['battle_yron'] = $this->users[$this->uids[$id1]]['battle_yron']; - $u->info['notactic'] = $this->users[$this->uids[$id1]]['notactic']; - $u->stats['notactic'] = $this->users[$this->uids[$id1]]['notactic']; - } - } - unset($s1, $s2); - } - } - - // - public function takeYronNow($uid, $y) - { - global $u; - if (!is_numeric($y) || !is_numeric($uid)) { - return; - } - (int)$y = floor($y); - $this->users[$this->uids[$uid]]['battle_yron'] += $y; - $this->stats[$this->uids[$uid]]['battle_yron'] += $y; - if ($uid == $u->info['id']) { - $u->info['battle_yron'] += $y; - $u->stats['battle_yron'] += $y; - } - mysql_query("UPDATE stats SET battle_yron = battle_yron + $y WHERE id = " . $uid); - } - - //JS - public function myInfo($id, $t) - { - global $c, $u; - if (isset($this->users[$this->uids[$id]]) || $u->info['id'] == $id) { - if ($u->info['id'] == $id || ($u->info['enemy'] == $id && $id > 0)) { - // - $this->users[$this->uids[$id]] = mysql_fetch_array(mysql_query('SELECT - - `u`.`zag`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`online`,`u`.`admin`,`u`.`city`,`u`.`cityreg`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`, - `u`.`level`,`u`.`money`,`u`.`money3`,`u`.`money2`,`u`.`money4`,`u`.`battle`,`u`.`sex`,`u`.`obraz`,`u`.`win`,`u`.`win_t`, - `u`.`lose`,`u`.`lose_t`,`u`.`nich`,`u`.`timeMain`,`u`.`invis`,`u`.`bot_id`,`u`.`animal`,`u`.`type_pers`, - `u`.`notrhod`,`u`.`bot_room`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`activ`,`u`.`stopexp`,`u`.`real`, - - `st`.* - - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id` = "' . $id . '" LIMIT 1')); - $this->stats[$this->uids[$id]] = $u->getStats($this->users[$this->uids[$id]], 0, 0, false, false, true); - $this->stats[$this->uids[$id]]['items'] = $this->stats[$this->uids[$id]]['items']; - $this->stats[$this->uids[$id]]['effects'] = $this->stats[$this->uids[$id]]['effects']; - /* - $ur = $this->users[$this->uids[$id]]; - $st = $this->stats[$this->uids[$id]]; - $itm = $this->stats[$this->uids[$id]]['items']; - $eff = $this->stats[$this->uids[$id]]['effects']; - */ - } - - //ssecho '['.$id.' -> '.$this->users[$this->uids[$id]]['last_hp'].']'; - - $ur = $this->users[$this->uids[$id]]; - $st = $this->stats[$this->uids[$id]]; - $itm = $this->stats[$this->uids[$id]]['items']; - $eff = $this->stats[$this->uids[$id]]['effects']; - $ef = ''; - $i = 0; - //effs_hide.gif - if ($u->info['seff'] < 1) { - //$ef .= '
'; - $ef .= '
\',event,3,1,1,1,\'\');\" onmouseout=\"top.hic();\" onmousedown=\"top.hic();\">
'; - - while ($i != -1) { - $nseef = 0; - if ($this->users[$this->uids[$ur['id']]]['id'] != $u->info['id'] && $ur['id'] != 0) { - if ($this->stats[$this->uids[$ur['id']]]['seeAllEff'] != 1) { - $nseef = 1; - if ($eff[$i]['v1'] == 'priem') { - $eff[$i]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $eff[$i]['v2'] . '" LIMIT 1')); - } - if (isset($eff[$i]['priem']['id']) && $eff[$i]['priem']['neg'] == 1) { - $nseef = 0; - } - } - } - - if (isset($eff[$i]) && $eff[$i] != 'delete') { - if ($nseef == 0) { - $ei = '' . $eff[$i]['name'] . ''; - if ($eff[$i]['x'] > 1) { - //$ei .= ' [x'.$eff[$i]['x'].'] '; - $ei .= ' x' . $eff[$i]['x'] . ' '; - } - if ($eff[$i]['type1'] > 0 && $eff[$i]['type1'] < 7) { - $ei .= ' ()'; - } elseif (($eff[$i]['type1'] > 6 && $eff[$i]['type1'] < 11) || $eff[$i]['type1'] == 16) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 14) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 15) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 17) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 18 || $eff[$i]['type1'] == 19) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 20) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 22) { - $ei .= ' ()'; - } else { - $ei .= ' ()'; - } - $ei .= '
'; - - $out = ''; - $time_still = ($eff[$i]['timeUse'] + ($eff[$i]['timeAce'] - $eff[$i]['timeUse']) + $eff[$i]['actionTime']); - if ($eff[$i]['timeAce'] == 0) { - $time_still += $eff[$i]['timeUse']; - } - $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 { - if ($eff[$i]['timeUse'] != 77 && $eff[$i]['hod'] < 1) { - $ei .= ': ' . $u->timeOut($time_still) . ''; - //$ei .= ': '.$out.'
'; - } elseif ($eff[$i]['hod'] >= 0) { - $ei .= ': ' . $eff[$i]['hod'] . ''; - } - } - - if ($eff[$i]['user_use'] != '') { - if ($this->users[$this->uids[$eff[$i]['user_use']]]['login2'] != '') { - $ei .= '
: ' . $this->users[$this->uids[$eff[$i]['user_use']]]['login2'] . ''; - } elseif ($this->users[$this->uids[$eff[$i]['user_use']]]['login'] != '') { - $ei .= '
: ' . $this->users[$this->uids[$eff[$i]['user_use']]]['login'] . ''; - } - } - - // - $tr = ''; - $ti = $u->items['add']; - $x = 0; - $ed = $u->lookStats($eff[$i]['data']); - while ($x < count($ti)) { - $n = $ti[$x]; - if (isset($ed['add_' . $n], $u->is[$n]) && $n != 'pog') { - $z = ''; - if ($ed['add_' . $n] > 0) { - $z = '+'; - } - $tr .= '
' . $u->is[$n] . ': ' . $z . '' . $ed['add_' . $n]; - } - $x++; - } - - if ($ed['add_mib1'] != 0) { - if ($ed['add_mab1'] != 0) { - $tr .= '
: ' . $ed['add_mib1'] . '-' . $ed['add_mab1'] . ''; - } else { - $m1l = $ed['add_mib1']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= '
: ' . $m1l . ''; - } - } - if ($ed['add_mib2'] != 0) { - if ($ed['add_mab2'] != 0) { - $tr .= '
: ' . $ed['add_mib2'] . '-' . $ed['add_mab2'] . ''; - } else { - $m1l = $ed['add_mib2']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= '
: ' . $m1l . ''; - } - } - if ($ed['add_mib3'] != 0) { - if ($ed['add_mab3'] != 0) { - $tr .= '
: ' . $ed['add_mib3'] . '-' . $ed['add_mab3'] . ''; - } else { - $m1l = $ed['add_mib3']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= '
: ' . $m1l . ''; - } - } - if ($ed['add_mib4'] != 0) { - if ($ed['add_mab4'] != 0) { - $tr .= '
: ' . $ed['add_mib4'] . '-' . $ed['add_mab4'] . ''; - } else { - $m1l = $ed['add_mib4']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= '
: ' . $m1l . ''; - } - } - - $efix = 0; - if (isset($ed['add_pog2']) && $ed['add_pog2'] > 0) { - $efix = $ed['add_pog2']; - } - if (isset($ed['add_pog'])) { - $tr .= '
' . $ed['add_pog'] . ' . '; - } - if (isset($ed['add_pog2'])) { - $tr .= '
' . $ed['add_pog2'] . ' . (' . $ed['add_pog2p'] . '%)'; - } - - if ($tr != '') { - $ei .= $tr; - } - if ($eff[$i]['info'] != '') { - $ei .= '
:
' . $eff[$i]['info']; - } - - //$ef .= ''; - $ef .= '
'; - unset($efix); - } - } elseif ($eff[$i] != 'delete') { - $i = -2; - } - $i++; - } - } else { - $ef .= '
\',event,3,1,1,1,\'\');\" onmouseout=\"top.hic();\" onmousedown=\"top.hic();\">
'; - } - if ($st['itmslvl'] == 0 && $ur['bot_id'] == 0) { - //$ef .= '
()
: \">
'; - } - - $ca = ''; - if ($ur['clan'] > 0) { - $cl = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $ur['clan'] . '" LIMIT 1')); - if (isset($cl['id'])) { - $ca = ''; - } - } - if ($ur['align'] > 0) { - $ca = '' . $ca; - } - if ($ur['login2'] == '') { - $ur['login2'] = $ur['login']; - } - if (floor($st['hpNow']) > $st['hpAll']) { - $st['hpNow'] = $st['hpAll']; - } - if (floor($st['mpNow']) > $st['mpAll']) { - $st['mpNow'] = $st['mpAll']; - } - $stsua = '' . $ur['login2'] . ''; - $stsua .= '
: ' . $st['s1']; - $stsua .= '
: ' . $st['s2']; - $stsua .= '
: ' . $st['s3']; - $stsua .= '
: ' . $st['s4']; - if ($st['s5'] != 0) { - $stsua .= '
: ' . $st['s5']; - } - if ($st['s6'] != 0) { - $stsua .= '
: ' . $st['s6']; - } - if ($st['s7'] != 0) { - $stsua .= '
: ' . $st['s7']; - } - if ($u->info['admin'] > 0) { - if (isset($ur['align']) && $ur['align'] == 9) { - $align = $ur['align']; - } else { - $align = $ur['align']; - } - } - $tp_img = [ - 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 - ]; - $info = 'info_reflesh(' . $t . ',' . $ur['id'] . ',"' . $ca . '' . $ur['login2'] . ' [' . $ur['level'] . '] ","' . $ur['obraz'] . '",' . floor($st['hpNow']) . ',' . floor($st['hpAll']) . ',' . floor($st['mpNow']) . ',' . floor($st['mpAll']) . ',0,' . $ur['sex'] . ',"' . $ef . '","' . $stsua . '", "' . $align . '", "' . $ur['zag'] . '");shpb();'; - $i = 0; - while ($i < count($itm)) { - // - if (isset($st['items_img'][$tp_img[$itm[$i]['inOdet']]])) { - $itm[$i]['img'] = $st['items_img'][$tp_img[$itm[$i]['inOdet']]]; - } - // - $ttl = '' . $itm[$i]['name'] . ''; - $td = $u->lookStats($itm[$i]['data']); - $lvar = ''; - if ($td['add_hpAll'] > 0) { - if ($td['add_hpAll'] > 0) { - $td['add_hpAll'] = '+' . $td['add_hpAll']; - } - $lvar .= '
: ' . $td['add_hpAll'] . ''; - } - if ($td['sv_yron_max'] > 0 || $td['sv_yron_min'] > 0) { - $lvar .= '
: ' . (0 + $td['sv_yron_min']) . '-' . (0 + $td['sv_yron_max']) . ''; - } - if ($td['add_mab1'] > 0) { - if ($td['add_mib1'] == $td['add_mab1'] && $pl['geniration'] == 1) { - $m1l = '+'; - if ($td['add_mab1'] < 0) { - $m1l = ''; - } - $lvar .= '
: ' . $m1l . '' . (0 + $td['add_mab1']) . ''; - } else { - $lvar .= '
: ' . (0 + $td['add_mib1']) . '-' . (0 + $td['add_mab1']) . ''; - } - } - if ($td['add_mab2'] > 0) { - if ($td['add_mib2'] == $td['add_mab2'] && $pl['geniration'] == 1) { - $m1l = '+'; - if ($td['add_mab2'] < 0) { - $m1l = ''; - } - $lvar .= '
: ' . $m1l . '' . (0 + $td['add_mab2']) . ''; - } else { - $lvar .= '
: ' . (0 + $td['add_mib2']) . '-' . (0 + $td['add_mab2']) . ''; - } - } - if ($td['add_mab3'] > 0) { - if ($td['add_mib3'] == $td['add_mab3'] && $pl['geniration'] == 1) { - $m1l = '+'; - if ($td['add_mab3'] < 0) { - $m1l = ''; - } - $lvar .= '
: ' . $m1l . '' . (0 + $td['add_mab3']) . ''; - } else { - $lvar .= '
: ' . (0 + $td['add_mib3']) . '-' . (0 + $td['add_mab3']) . ''; - } - } - if ($td['add_mab4'] > 0) { - if ($td['add_mib4'] == $td['add_mab4'] && $pl['geniration'] == 1) { - $m1l = '+'; - if ($td['add_mab4'] < 0) { - $m1l = ''; - } - $lvar .= '
: ' . $m1l . '' . (0 + $td['add_mab4']) . ''; - } else { - $lvar .= '
: ' . (0 + $td['add_mib4']) . '-' . (0 + $td['add_mab4']) . ''; - } - } - if ($itm[$i]['iznosMAX'] > 0) { - if ($itm[$i]['iznosMAXi'] == 999999999) { - $lvar .= '
: '; - } else { - $lvar .= '
: ' . floor($itm[$i]['iznosNOW']) . '/' . floor($itm[$i]['iznosMAX']); - } - } - $ttl .= $lvar; - $ccv = ''; - - if ($itm[$i]['magic_inci'] != '' || $itm[$i]['magic_inc'] != '') { - if ($itm[$i]['magic_inc'] == '') { - $itm[$i]['magic_inc'] = $itm[$i]['magic_inci']; - } - $mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $itm[$i]['magic_inc'] . '" AND `type1` = "12345" LIMIT 1')); - if (isset($mgi['id2'])) { - $mgilog = ''; - $ccv .= 'top.useMagicBattle(\'' . $mgi['mname'] . '\',' . $itm[$i]['id'] . ',\'' . $mgi['img'] . '\',1,2);'; - } - } - - $info .= 'abitms(' . (0 + $t) . ',' . (0 + $itm[$i]['uid']) . ',' . (0 + $itm[$i]['id']) . ',' . (0 + $itm[$i]['inOdet']) . ',"' . $itm[$i]['name'] . '","' . $ttl . '","' . $itm[$i]['img'] . '","' . $ccv . '");'; - $i++; - } - - return $info; - } else { - return false; - } - } - - // - public function testUsersLive() - { - $r = false; - $tl = 0; - $i = 0; - $j = 0; - while ($i < count($this->uids)) { - if ($this->stats[$i]['id'] > 0) { - if (floor($this->stats[$i]['hpNow']) < 1) { - $this->stats[$i]['hpNow'] = 0; - } - $hp[$this->users[$i]['team']] += floor($this->stats[$i]['hpNow']); - if (!isset($tml[$this->users[$i]['team']]) && floor($this->stats[$i]['hpNow']) >= 1) { - $tml[$this->users[$i]['team']] = 1; - $tmv[$j] = $this->users[$i]['team']; - $tl++; - } - } - $i++; - } - if ($tl > 1) { - $r = true; - } - return $r; - } - - // - public function miniLogAdd($user, $text) - { - $txt = $text; - $vLog = 'at1=00000||at2=00000||zb1=0||zb2=0||bl1=0||bl2=0||time1=' . time() . '||time2=' . time() . '||s1=' . $user['sex'] . '||t1=' . $user['team'] . '||login1=' . $user['login'] . '||'; - $mas1 = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => ($this->hodID + 1), - 'text' => '', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $mas1['text'] = $txt; - $this->add_log($mas1); - } - - // - public function testFinish() - { - global $u; - // - mysql_query('START TRANSACTION;'); - // - $test = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `team_win` = -1 LIMIT 1 FOR UPDATE')); - //mysql_query('UPDATE `battle` SET `testfinish` = "'.$u->info['id'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - // - mysql_query('COMMIT;'); - // - if ($this->info['team_win'] == -1 && isset($test['id'])) { - $hp = []; - $tml = []; - $tmv = []; - $tl = 0; - $i = 0; - $j = 0; - while ($i < count($this->uids)) { - if ($this->stats[$i]['id'] > 0) { - if (floor($this->stats[$i]['hpNow']) < 1) { - $this->stats[$i]['hpNow'] = 0; - } - $hp[$this->users[$i]['team']] += floor($this->stats[$i]['hpNow']); - if (!isset($tml[$this->users[$i]['team']]) && floor($this->stats[$i]['hpNow']) >= 1) { - $tml[$this->users[$i]['team']] = 1; - $tmv[$j] = $this->users[$i]['team']; - $tl++; - } - } - $i++; - } - - if ($tl <= 1) { - //. - $tmHpNow = []; - $tmNow = []; - $sp = mysql_query('SELECT `u`.`login`,`u`.`id`,`u`.`battle`,`s`.`team`,`s`.`hpNow` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`battle` = "' . $this->info['id'] . '"'); - while ($pl = mysql_fetch_array($sp)) { - if (!isset($tmHpNow[$pl['team']])) { - $tmHpNow[$pl['team']] = 0; - $tmNow[] = $pl['team']; - } - $hpTm = floor($pl['hpNow']); - if ($hpTm < 0) { - $hpTm = 0; - } - if ($hpTm > 0) { - $tmHpNow[$pl['team']] += $pl['hpNow']; - } - } - $gdj = 0; - $i = 0; - while ($i < count($tmNow)) { - if (isset($tmNow[$i])) { - $j = $tmNow[$i]; - if ($tmHpNow[$j] > 0) { - $gdj++; - } - } - $i++; - } - if ($gdj > 1) { - $tl = $gdj; - echo ' ... ( )'; - } - } - - if ($tl <= 1) { - // , - , - - $i = 0; - $tmwin = 0; - while ($i < count($tmv)) { - if ($tmv[$i] >= 1 && $tml[$tmv[$i]] > 0) { - $tmwin = $tmv[$i]; - } - $i++; - } - - if ($this->info['izlom'] == 0) { - $rs = ''; - $ts = []; - $tsi = 0; - if ($this->info['id'] > 0) { - // - unset($this->users, $this->stats, $this->uids, $this->bots, $this->iBots); - $trl = mysql_query('SELECT `u`.`no_ip`,`u`.`id`,`u`.`notrhod`,`u`.`login`,`u`.`login2`,`u`.`sex`,`u`.`online`,`u`.`admin`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`,`u`.`level`,`u`.`battle`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`animal`,`st`.`stats`,`st`.`hpNow`,`st`.`mpNow`,`st`.`exp`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`battle_text`,`st`.`upLevel`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`bot`,`st`.`lider`,`st`.`btl_cof`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`id`,`st`.`last_hp`,`st`.`last_pr`,`u`.`sex`,`u`.`money`,`u`.`money3`,`u`.`money2`,`u`.`bot_id` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle` = "' . $this->info['id'] . '" ORDER BY `st`.`bot` DESC'); - $ir = 0; - $bi = 0; - $this->users = null; - $this->stats = null; - $this->uids = null; - $this->bots = null; - $this->iBots = null; - while ($pl = mysql_fetch_array($trl)) { - // - if ($pl['login2'] == '') { - $pl['login2'] = $pl['login']; - } - $this->users[$ir] = $pl; - $this->uids[$pl['id']] = $ir; - if ($pl['bot'] > 0) { - $this->bots[$bi] = $pl['id']; - $this->iBots[$pl['id']] = $bi; - $bi++; - } - // - $this->stats[$ir] = $u->getStats($pl, 0, 0, false, false, true); - $ir++; - } - } - } elseif (!isset($this->uids[$u->info['id']])) { - $rs = ''; - $ts = []; - $tsi = 0; - if ($this->info['id'] > 0) { - // - $trl = mysql_query('SELECT `u`.`no_ip`,`u`.`id`,`u`.`notrhod`,`u`.`login`,`u`.`login2`,`u`.`sex`,`u`.`online`,`u`.`admin`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`,`u`.`level`,`u`.`battle`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`animal`,`st`.`stats`,`st`.`hpNow`,`st`.`mpNow`,`st`.`exp`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`battle_text`,`st`.`upLevel`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`bot`,`st`.`lider`,`st`.`btl_cof`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`id`,`st`.`last_hp`,`st`.`last_pr`,`u`.`sex`,`u`.`money`,`u`.`bot_id`,`u`.`money3`,`u`.`money2` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id` = "' . $this->info['id'] . '" LIMIT 1'); - $pl = mysql_fetch_array($trl); - // - if ($pl['login2'] == '') { - $pl['login2'] = $pl['login']; - } - $this->users[count($this->users)] = $pl; - $this->uids[$pl['id']] = $ir; - if ($pl['bot'] > 0) { - $this->bots[count($this->bots)] = $pl['id']; - $this->iBots[$pl['id']] = $bi; - } - // - $this->stats[count($this->stats)] = $u->getStats($pl, 0, 0, false, false, true); - } - } - - - if ($this->info['izlom'] > 0 && $tmwin == 1) { - // - $i = 0; - $dlt = ''; - $dlt2 = ''; - $sp = mysql_query('SELECT `users`.`id`,`stats`.`bot`,`stats`.`team` FROM `users`,`stats` WHERE `users`.`battle` = "' . $this->info['id'] . '" AND `stats`.`id` = `users`.`id` LIMIT 250'); - while ($pl = mysql_fetch_array($sp)) { - if ($pl['bot'] == 1 && $pl['team'] != $u->info['team']) { - $dlt .= ' `id`="' . $pl['id'] . '" OR'; - $dlt2 .= ' `uid`="' . $pl['id'] . '" OR'; - $i++; - } - } - - if ($i > 0) { - $dlt = trim($dlt, 'OR'); - $dlt2 = trim($dlt2, 'OR'); - mysql_query('DELETE FROM `users` WHERE ' . $dlt . ' LIMIT ' . $i); - mysql_query('DELETE FROM `stats` WHERE ' . $dlt . ' LIMIT ' . $i); - mysql_query('DELETE FROM `items_users` WHERE ' . $dlt2 . ' LIMIT ' . ($i * 100)); - mysql_query('DELETE FROM `eff_users` WHERE ' . $dlt2 . ' LIMIT ' . ($i * 100)); - } - - unset($i, $dlt, $dlt2); - - $j = 0; - $k = 0; - $obr = 0; - - // , - if ($this->get_chanse(20) == true) { - // - if ($this->info['izlomLvl'] == 8) { - $bots = [ - ' ', - ' ', - '', - ' ', - ' ', - ]; - //$bots = array( ' ' ); - } - $logins_bot = []; - // - echo '
...
'; - // - $id2 = rand(0, (count($bots) - 1)); - $id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "' . $bots[$id2] . '" AND `pishera` != "" AND `active` = "1" ORDER BY `level` DESC LIMIT 1')); - $bot = $u->addNewbot($id['id'], null, null, $logins_bot, null, - round($this->info['izlomRoundSee'])); - if (isset($id['id']) && $bot != false) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - $u->addAction(time(), 'win_bot_' . $id['id'], '', $this->users[$i]['id']); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - } else { - // - if ($this->info['izlomLvl'] == 8) { - $bots = [ - '', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]; - } - $logins_bot = []; - // - $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, - ($this->info['izlomRoundSee'] * 2)); - if (isset($id['id']) && $bot != false) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - // - $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, $this->info['izlomRoundSee']); - if (isset($id['id']) && $bot != false) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - // - if (rand(0, 100) < 70) { - $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, - $this->info['izlomRoundSee']); - if (isset($id['id']) && $bot != false) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - } - // 10 = +1 - $irb = floor($this->info['izlomRoundSee'] / 10); - while ($irb > 0) { - // - if (rand(0, 100) < 20) { - $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, - $this->info['izlomRoundSee']); - if (isset($id['id']) && $bot != false) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - } - $irb--; - } - } - // - 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($i0) - { - $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); - $fin1 = mysql_query('INSERT INTO `izlom_rating` (`uid`,`time`,`voln`,`level`,`bots`,`rep`,`obr`,`btl`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $this->info['izlomRoundSee'] . '","' . $this->info['izlomLvl'] . '","0","0","' . ($this->info['izlomObr'] - $this->info['izlomObrNow']) . '","' . $this->info['id'] . '")'); - } else { - $this->info['izlomRound'] = $iz['round']; - mysql_query('UPDATE `battle` SET `izlomObrNow` = ' . $obr . ',`izlomObr` = `izlomObr` + ' . $obr . ',`timeout` = (`timeout`+5),`izlomRound` = "' . ($this->info['izlomRound'] + 1) . '",`izlomRoundSee` = `izlomRoundSee`+1 WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - $this->stats[$this->uids[$u->info['id']]]['hpNow'] += $this->stats[$this->uids[$u->info['id']]]['hpAll'] * 0.25; - $this->stats[$this->uids[$u->info['id']]]['mpNow'] += $this->stats[$this->uids[$u->info['id']]]['mpAll'] * 0.25; - $this->users[$this->uids[$u->info['id']]]['hpNow'] = $this->stats[$this->uids[$u->info['id']]]['hpAll']; - $this->users[$this->uids[$u->info['id']]]['mpNow'] = $this->stats[$this->uids[$u->info['id']]]['mpAll']; - $vLog = 'at1=00000||at2=00000||zb1=' . $this->stats[$this->uids[$u1]]['zonb'] . '||zb2=' . $this->stats[$this->uids[$u2]]['zonb'] . '||bl1=' . $this->atacks[$id]['b' . $a] . '||bl2=' . $this->atacks[$id]['b' . $b] . '||time1=' . $this->atacks[$id]['time'] . '||time2=' . $this->atacks[$id]['time2'] . '||s2=' . $this->users[$this->uids[$u2]]['sex'] . '||s1=' . $this->users[$this->uids[$u1]]['sex'] . '||t2=' . $this->users[$this->uids[$u2]]['team'] . '||t1=' . $this->users[$this->uids[$u1]]['team'] . '||login1=' . $this->users[$this->uids[$u1]]['login2'] . '||login2=' . $this->users[$this->uids[$u2]]['login2'] . ''; - - $mas = [ - 'text' => '', - 'time' => time(), - 'vars' => '', - 'battle' => $this->info['id'], - 'id_hod' => ($this->hodID + 1), - 'vars' => $vLog, - 'type' => 1, - ]; - if ($u->info['sex'] == 1) { - $mas['text'] = '' . date('H:i') . ' ' . $u->info['login'] . ' "".'; - } else { - $mas['text'] = '' . date('H:i') . ' ' . $u->info['login'] . ' "".'; - } - if ($u->stats['hpNow'] < $u->stats['hpAll']) { - $hpSks = floor(($u->stats['hpAll'] * ((rand(15, 25)) / 100))); - if ($hpSks > floor($u->stats['hpAll'] - $u->stats['hpNow'])) { - $hpSks = floor($u->stats['hpAll'] - $u->stats['hpNow']); - } - $mas['text'] .= ' +' . $hpSks . ''; - } else { - $hpSks = 0; - $mas['text'] .= ' --'; - } - $mas['text'] .= ' [' . floor($u->info['hpNow'] + $hpSks) . '/' . $u->stats['hpAll'] . ']'; - $this->add_log($mas); - - mysql_query('UPDATE `stats` SET `hpNow` = "' . ($u->info['hpNow'] + ($u->stats['hpAll'] * ((rand(15, - 25)) / 100))) . '",`mpNow` = "' . ($u->info['mpNow'] + ($u->stats['mpAll'] * 0.25)) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - } - } else { - // - $this->finishBattle($tml, $tmv, null, $tl); - if ($this->info['izlom'] > 0) { - $fin1 = mysql_query('INSERT INTO `izlom_rating` (`uid`,`time`,`voln`,`level`,`bots`,`rep`,`obr`,`btl`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $this->info['izlomRoundSee'] . '","' . $this->info['izlomLvl'] . '","0","0","' . ($this->info['izlomObr'] - $this->info['izlomObrNow']) . '","' . $this->info['id'] . '")'); - } - } - if (isset($fin1)) { - mysql_query('INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","31","23","' . $u->info['id'] . '"," ","nofastfinisheff=1","' . time() . '")'); - 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'] . "',' ""x" . (($this->info['izlomObr'] - $this->info['izlomObrNow']) * 7) . "','" . time() . "','6','0')"); - $i01 = 1; - while ($i01 <= (($this->info['izlomObr'] - $this->info['izlomObrNow'])) * 7) { - $u->addItem(1226, $u->info['id'], '|sudba=' . $u->info['login']); - $i01++; - } - mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $u->info['id'] . '","' . time() . '","capitalcity","' . $u->info['room'] . '","izlom"," ","","")'); - unset($fin1); - } - } - } else { - mysql_query('START TRANSACTION;'); - $test = mysql_fetch_array(mysql_query('SELECT `id`,`team_win`, `testfinish` FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `team_win` != -1 LIMIT 1 FOR UPDATE')); - mysql_query('COMMIT;'); - if (isset($test['id'])) { - $this->finishBattle(null, null, 10, $tl); - } - } - // - //mysql_query('UPDATE `battle` SET `testfinish` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - - // - public function finishBattle($t, $v, $nl, $tl) - { - global $magic, $u, $q, $c; - mysql_query('LOCK TABLES users,stats,battle,battle_last,battle_end,chat WRITE'); - $frtu = false; - $test = mysql_fetch_array(mysql_query('SELECT `id`,`team_win`,`testfinish` FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `team_win` != -1 LIMIT 1;')); - if ($test['testfinish'] != -1) { //$frtu == false - $trtt = mysql_query('UPDATE `battle` SET `testfinish` = "-1" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - $relbf = $this->info['team_win']; - if ($nl != 10) { - $i = 0; - $dnr = 0; - if ($this->info['team_win'] == -1) { - $this->info['team_win'] = 0; - while ($i < count($v)) { - if ($v[$i] >= 1 && $t[$v[$i]] > 0) { - $this->info['team_win'] = $v[$i]; - } - $i++; - } - } - } - - - // - $t = mysql_query('SELECT `u`.`stopexp`,`u`.`twink`,`u`.`city`,`u`.`room`,`u`.`no_ip`,`u`.`pass`,`u`.`id`,`u`.`notrhod`,`u`.`login`,`u`.`login2`,`u`.`sex`,`u`.`online`,`u`.`admin`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`,`u`.`level`,`u`.`battle`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`animal`,`st`.`stats`,`st`.`hpNow`,`st`.`mpNow`,`st`.`exp`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`battle_text`,`st`.`upLevel`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`bot`,`st`.`lider`,`st`.`btl_cof`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`id`,`st`.`last_hp`,`st`.`last_pr`,`u`.`sex`,`u`.`money`,`u`.`bot_id`,`u`.`money3`,`u`.`money2` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle` = "' . $this->info['id'] . '"'); - $i = 0; - $bi = 0; - 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, 0, false, false, true); - $i++; - } - unset($pl, $t); - - if ($this->info['time_over'] == 0) { - $tststrt = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `time_over` = "0" LIMIT 1')); - if (isset($tststrt['id'])) { - if ($this->info['inTurnir'] == 0 || $this->info['type'] == 500) { - mysql_query('UPDATE `battle` SET `time_over` = "' . time() . '",`team_win` = "' . $this->info['team_win'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - } - mysql_query('UPDATE `battle_stat` SET `team_win` = "' . $this->info['team_win'] . '" WHERE `battle_id` = "' . $this->info['id'] . '"'); - // - $i = 0; - $vl = ''; - $vtvl = ''; - $relu = 0; - while ($i < count($this->users)) { - /*if( $this->user[$i]['clon'] == 0 && $this->user[$i]['bot'] == 0 ) { - $relu++; - }*/ - $vl .= '("' . $this->users[$i]['login'] . '","' . $this->users[$i]['city'] . '","' . $this->info['id'] . '","' . $this->users[$i]['id'] . '","' . time() . '","' . $this->users[$i]['team'] . '","' . $this->users[$i]['level'] . '","' . $this->users[$i]['align'] . '","' . $this->users[$i]['clan'] . '","' . $this->users[$i]['exp'] . '","' . $this->users[$i]['bot'] . '","' . $this->users[$i]['money'] . '","' . $this->users[$i]['money2'] . '","' . $this->users[$i]['money3'] . '"),'; - if ($this->users[$i]['team'] == $this->info['team_win'] && $this->info['team_win'] > 0) { - $vtvl .= '' . $this->users[$i]['login'] . ', '; - } - $i++; - } - - $this->info['players_c'] = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `login` NOT LIKE "%(%" AND `battle` = "' . $this->info['id'] . '" LIMIT 1')); - $this->info['players_c'] = $this->info['players_c'][0]; - - mysql_query('UPDATE `battle` SET `players_c` = "' . $this->info['players_c'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - - if ($vtvl != '') { - $vtvl = rtrim($vtvl, ', '); - $vtvl = str_replace('"', '\\\\\"', $vtvl); - $this->hodID++; - $vLog = 'time1=' . time(); - $mass = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => 'test', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $vtvl = ' , ' . $vtvl . '.'; - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - } else { - $this->info['players_cc'] = mysql_fetch_array(mysql_query('SELECT COUNT(`u`.`id`) FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `s`.`hpNow` > 0 AND `u`.`battle` = "' . $this->info['id'] . '" AND `s`.`team` != "' . $u->info['team'] . '" LIMIT 1')); - $this->info['players_cc'] = $this->info['players_cc'][0]; - $this->info['players_cc2'] = mysql_fetch_array(mysql_query('SELECT COUNT(`u`.`id`) FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `s`.`hpNow` >= 1 AND `u`.`battle` = "' . $this->info['id'] . '" AND `s`.`team` != "' . $u->info['team'] . '" LIMIT 1')); - $this->info['players_cc2'] = $this->info['players_cc2'][0]; - $inf_test = ', users: ' . $this->info['players_cc'] . ' and ' . $this->info['players_cc2'] . ''; - $this->hodID++; - $vLog = 'time1=' . time(); - $mass = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => 'test', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $vtvl = ' , .'; - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - } - - $this->saveLogs($this->info['id'], 'all'); - //$this->hodID++; - - if ($this->info['type'] == 99) { - //$this->hodID++; - $vLog = 'time1=' . time(); - $mass = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => 'test', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $vtvl = ' ...'; - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - $i = 0; - $vtvl = ''; - $tr_nm = [ - 1 => '', - 2 => '', - 3 => '', - 4 => '', - ]; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] != $this->info['team_win']) { - $tr_pl = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = "' . $this->users[$i]['id'] . '" AND `delete` = "0" ORDER BY `v1` DESC LIMIT 1')); - if (!isset($tr_pl['id']) || $tr_pl['v1'] < 3) { - if ($this->info['smert'] == 1) { - $tr_tp = 4; - } else { - $tr_tp = rand(1, 3); - } - if (isset($tr_pl['id'])) { - $tr_tp = rand(($tr_pl['v1'] + 1), 3); - } - if ($this->users[$i]['sex'] == 1) { - $vtvl = '' . $this->users[$i]['login'] . ' : ' . $tr_nm[$tr_tp] . ' .
' . $vtvl; - } else { - $vtvl = '' . $this->users[$i]['login'] . ' : ' . $tr_nm[$tr_tp] . ' .
' . $vtvl; - } - $this->addTravm($this->users[$i]['id'], $tr_tp, rand(3, 5)); - } - } - $i++; - } - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - } - - if ($vl != '') { - $vl = rtrim($vl, ','); - mysql_query('INSERT INTO `battle_last` (`login`,`city`,`battle_id`,`uid`,`time`,`team`,`lvl`,`align`,`clan`,`exp`,`bot`,`money`,`money2`,`money3`) VALUES ' . $vl . ''); - } - - mysql_query('INSERT INTO `battle_end` (`battle_id`,`city`,`time`,`team_win`) VALUES ("' . $this->info['id'] . '","' . $this->info['city'] . '","' . $this->info['time_start'] . '","' . $this->info['team_win'] . '")'); - } - - - $vLog = 'time1=' . time(); - $mass = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => 'test', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - //$vtvl = ''; - //$ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.$mass['time'].'","'.$mass['battle'].'","'.$mass['id_hod'].'","'.$vtvl.'","'.$mass['vars'].'","'.$mass['zona1'].'","'.$mass['zonb1'].'","'.$mass['zona2'].'","'.$mass['zonb2'].'","'.$mass['type'].'")'); - $i = 0; - $vtvl = ''; - $tr_nm = [ - 1 => '', - 2 => '', - 3 => '', - 4 => '', - ]; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] != $this->info['team_win'] && $this->info['team_win'] > 0) { - $tr_pl = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "priem" AND `v2` = 292 AND `uid` = "' . $this->users[$i]['id'] . '" AND `delete` = "0" LIMIT 1')); - - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl2 . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - - if (isset($tr_pl['id'])) { - if (rand(0, 100) < $tr_pl['data']) { - $tr_tp = rand(1, 3); - if (isset($tr_pl['id'])) { - $tr_tp = rand(($tr_pl['v1'] + 1), 3); - } - if ($this->users[$i]['sex'] == 1) { - $vtvl = '' . $this->users[$i]['login'] . ' (, : ' . $this->users[$this->uids[$tr_pl['user_use']]]['login'] . '): ' . $tr_nm[$tr_tp] . ' .
' . $vtvl; - } else { - $vtvl = '' . $this->users[$i]['login'] . ' (, : ' . $this->users[$this->uids[$tr_pl['user_use']]]['login'] . '): ' . $tr_nm[$tr_tp] . ' .
' . $vtvl; - } - $this->addTravm($this->users[$i]['id'], $tr_tp, rand(3, 5)); - } - } - } - $i++; - } - if ($vtvl != '') { - if ($this->info['type'] != 99) { - $vtvl2 = ' ...'; - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl2 . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - } - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - } - - // - if ($this->info['inTurnir'] > 0 && $this->info['dungeon'] != 15 && $u->info['room'] != 413) { - $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "' . $this->info['inTurnir'] . '" LIMIT 1')); - $i = 0; - $j = 0; - while ($i < count($this->users)) { - if ($this->stats[$i]['hpNow'] < 1 && $this->users[$i]['clone'] == 0 && $this->stats[$i]['clone'] == 0) { - // - //echo '['.$this->users[$i]['login'].']'; - // - if ($this->users[$i]['sex'] == 0) { - $text .= '{u1} '; - } else { - $text .= '{u1} '; - } - // - $spik = mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `delete` ="0"'); - while ($plik = mysql_fetch_array($spik)) { - /* - -1 - mysql_query('INSERT INTO `bs_items` (`x`,`y`,`bid`,`count`,`item_id`) VALUES ( - "'.$this->users[$i]['x'].'","'.$this->users[$i]['y'].'","'.$bs['id'].'","'.$bs['count'].'","'.$plik['item_id'].'" - )'); - */ - mysql_query('INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ( - "' . $this->users[$i]['dnow'] . '","' . $plik['item_id'] . '","' . (time() - 600) . '","' . $this->users[$i]['x'] . '","' . $this->users[$i]['y'] . '" - )'); - } - unset($spik, $plik); - // - $usrreal = ''; - $usr_real = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `login` = "' . $this->users[$i]['login'] . '" AND `inUser` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if (!isset($usr_real['id'])) { - $usr_real = $this->users[$i]; - } - if (isset($usr_real['id'])) { - $usrreal = ''; - if ($usr_real['align'] > 0) { - $usrreal .= ''; - } - if ($usr_real['clan'] > 0) { - $usrreal .= ''; - } - $usrreal .= '' . $usr_real['login'] . '[' . $usr_real['level'] . ']'; - } else { - $mereal = '[??]'; - } - $text = str_replace('{u1}', $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 . '" - )'); - // - // - 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 `actions` WHERE `uid` = "' . $this->users[$i]['id'] . '"'); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $this->users[$i]['id'] . '"'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $this->users[$i]['id'] . '"'); - mysql_query('DELETE FROM `users_delo` WHERE `uid` = "' . $this->users[$i]['id'] . '"'); - // - mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `login` = "' . $this->users[$i]['login'] . '" OR `inUser` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - mysql_query('UPDATE `bs_zv` SET `off` = "' . time() . '" WHERE `inBot` = "' . $this->users[$i]['id'] . '" AND `off` = "0" LIMIT 1'); - unset($text, $usrreal, $usr_real); - if ($this->users[$i]['pass'] != 'bstowerbot') { - $bs['users']--; - $bs['users_finish']++; - } else { - $bs['arhiv']--; - } - $j++; - } - $i++; - } - if ($j > 0) { - mysql_query('UPDATE `bs_turnirs` SET `arhiv` = "' . $bs['arhiv'] . '",`users` = "' . $bs['users'] . '",`users_finish` = "' . $bs['users_finish'] . '" WHERE `id` = "' . $bs['id'] . '" LIMIT 1'); - } - - unset($bs, $j); - } - - // - if ($this->info['type'] == 500 && isset($tststrt['id'])) { - // - - $i = 0; - while ($i < count($this->users)) { - if ($this->users[$i]['no_ip'] == 'trupojor') { - $mon = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_monsters` WHERE `uid` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if (isset($mon['id'])) { - if ($this->info['team_win'] == 0) { - // - mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$i]['hpAll'] . '",`mpNow` = "' . $this->stats[$i]['mpAll'] . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("! ' . mysql_real_escape_string(str_replace('{b}', - '' . $this->users[$i]['login'] . ' [' . $this->users[$i]['level'] . ']users[$i]['id'] . ' >', - $mon['nich_text'])) . ' ","' . $this->users[$i]['city'] . '","","6","1","' . time() . '")'); - } elseif ($this->info['team_win'] != $this->users[$i]['team']) { - // - $j = 0; - $usrwin = ''; - while ($j < count($this->users)) { - if ($this->users[$j]['no_ip'] != 'trupojor' && $this->users[$j]['bot'] == 0) { - if ($this->stats[$j]['hpNow'] > 0) { - $usrwin .= ', '; - if ($this->users[$j]['align'] > 0) { - $usrwin .= 'users[$j]['align'] . '.gif >'; - } - if ($this->users[$j]['clan'] > 0) { - $usrwin .= 'users[$j]['clan'] . '.gif >'; - } - $usrwin .= '' . $this->users[$j]['login'] . ' [' . $this->users[$j]['level'] . ']users[$j]['id'] . ' >'; - } - } - $j++; - } - if ($usrwin != '') { - $usrwin = ltrim($usrwin, ', '); - } else { - $usrwin = ' '; - } - - - 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'); - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("! ' . mysql_real_escape_string(str_replace('{b}', - '' . $this->users[$i]['login'] . ' [' . $this->users[$i]['level'] . ']users[$i]['id'] . ' >', - str_replace('{u}', $usrwin, - $mon['win_text']))) . ' ","' . $this->users[$i]['city'] . '","","6","1","' . time() . '")'); - unset($usrwin); - } else { - // - if ($mon['win_back'] == 1) { - mysql_query('UPDATE `users` SET `room` = "303" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } - mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$i]['hpAll'] . '",`mpNow` = "' . $this->stats[$i]['mpAll'] . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("! ' . mysql_real_escape_string(str_replace('{b}', - '' . $this->users[$i]['login'] . ' [' . $this->users[$i]['level'] . ']users[$i]['id'] . ' >', - $mon['lose_text'])) . ' ","' . $this->users[$i]['city'] . '","","6","1","' . time() . '")'); - } - } - } - $i++; - } - } - } - - // - $i = 0; - $botsi = 0; - if (isset($tststrt['id'])) { - while ($i < count($this->users)) { - // - if ($this->info['type'] == 33) { - $plde = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if (isset($plde['mail']) && $plde['mail'] == "haot@new-combats.com") { - $pld = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `inUser` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - - if (isset($pld['id'])) { - if ($this->users[$i]['battle_yron'] >= 500) { - $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'], ''); - $pld['battle_text'] .= ' (x5). '; - mysql_query('UPDATE `users_achiv` SET `pg`= `pg`+1 WHERE `id` = "' . $pld['id'] . '" LIMIT 1'); - - - if ($this->users[$i]['team'] == $this->info['team_win']) { - if (rand(1, 100) <= 5) { - $u->addItem(10020, $pld['id'], ''); - $pld['battle_text'] .= ' . '; - } - } - } else { - $pld['battle_text'] .= ' . 500 .'; - } - - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $pld['city'] . "','" . $pld['room'] . "','','" . $pld['login'] . "','" . $pld['battle_text'] . "','-1','6','0')"); - 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'); - mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `inUser` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `users` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } - } - - unset ($plde, $pld); - } - - if ($this->users[$i]['bot'] == 1) { - $botsi++; - 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'); - } elseif ($this->users[$i]['bot'] == 2) { - $this->users[$i]['battle'] = 0; - mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "0",`exp` = `exp` + `battle_exp`,`battle_exp` = "0",`battle_yron` = "0",`enemy` = "0", `timeGo` = "' . time() . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - //mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "0",`exp` = `exp` + `battle_exp`,`battle_exp` = "0",`timeGo` = "'.time().'" WHERE `id` = "'.$this->users[$i]['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" LIMIT 100'); - } elseif ($this->users[$i]['bot'] > 0) { - $this->users[$i]['battle'] = 0; - mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "0",`exp` = `exp` + `battle_exp`,`battle_exp` = "0",`battle_yron` = "0",`enemy` = "0", `timeGo` = "' . time() . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" LIMIT 100'); - } - if ($this->users[$i]['clone'] > 0 && $this->users[$i]['bot'] > 0 && isset($this->users[$this->uids[$this->users[$i]['clone']]]['id']) && $this->users[$this->uids[$this->users[$i]['clone']]]['team'] != $this->users[$i]['team']) { - // - if ($this->users[$this->uids[$this->users[$i]['clone']]]['team'] == $this->info['team_win']) { - $u->addAction(time(), 'win_bot_clone', '', $this->users[$i]['clone']); - } elseif ($this->info['team_win'] == 0) { - $u->addAction(time(), 'nich_bot_clone', '', $this->users[$i]['clone']); - } else { - $u->addAction(time(), 'lose_bot_clone', '', $this->users[$i]['clone']); - } - } elseif ($this->users[$i]['bot'] > 0 && $this->users[$i]['bot_id'] > 0) { - // - $j = 0; - while ($j < count($this->users)) { - if ($this->users[$j]['bot'] == 0 && $this->users[$j]['team'] != $this->users[$i]['team']) { - if ($this->users[$j]['team'] == $this->info['team_win']) { // if($this->users[$j]['team']==$this->info['team_win']){ - $u->addAction(time(), 'win_bot_' . $this->users[$i]['bot_id'], '', - $this->users[$j]['id']); - // - mysql_query('UPDATE `dialog_act` SET `now` = `now` + 1 WHERE `uid` = "' . $this->users[$j]['id'] . '" AND - ( `btl_bot` LIKE "' . $this->users[$i]['bot_id'] . '!%" OR `btl_bot` LIKE "%!' . $this->users[$i]['bot_id'] . '!%" ) - AND `val` != 1 - LIMIT 1'); - // - } elseif ($this->info['team_win'] == 0) { - $u->addAction(time(), 'nich_bot_' . $this->users[$i]['bot_id'], '', - $this->users[$j]['id']); - } else { - $u->addAction(time(), 'lose_bot_' . $this->users[$i]['bot_id'], '', - $this->users[$j]['id']); - } - } - $j++; - } - } - $i++; - } - } - - $botss = []; - if (true == true) { - if ($nl != 10) { - // - if ($this->info['dungeon'] > 0) { - if ($this->info['team_win'] == $u->info['team'] && $this->info['dungeon'] == 102) { - $j1 = mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `type` = 2 AND `lib` = "' . $this->info['dn_id'] . '" AND `x` = "' . $this->info['x'] . '" AND `y` = "' . $this->info['y'] . '" LIMIT 1')); - if (isset($j1['id'])) { - mysql_query('DELETE FROM `laba_obj` WHERE `id` = "' . $j1['id'] . '" LIMIT 1'); - // - mysql_query('INSERT INTO `laba_obj` (`use`,`lib`,`time`,`type`,`x`,`y`,`vars`) VALUES ( - "0","' . $j1['lib'] . '","' . time() . '","6","' . $j1['x'] . '","' . $j1['y'] . '","' . (0 + $botsi) . '" - )'); - } - } elseif ($this->info['team_win'] == $u->info['team']) { - // , - $j1 = mysql_query('SELECT * FROM `dungeon_bots` WHERE `dn` = "' . $this->info['dn_id'] . '" AND `for_dn` = "0" AND `x` = "' . $this->info['x'] . '" AND `delete` = "0" AND `y`= "' . $this->info['y'] . '" LIMIT 100'); - while ($tbot = mysql_fetch_array($j1)) { - $j2 = 0; - while ($j2 < $tbot['colvo']) { - if (isset($tbot['id2'])) { - $tbot2 = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $tbot['id_bot'] . '" LIMIT 1')); - $itms = explode('|', $tbot2['p_items']); - $tii = 0; - $testdrop = 0; - while ($tii < count($itms) && $testdrop == 0) { - $itmz = explode('=', $itms[$tii]); - if ($itmz[0] > 0) { - if (isset($itmz[2]) && $itmz[2] != '') { // $itmz[2] == quest888 - $questDrop = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%' . $itmz[2] . '%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 1')); - } - if (isset($questDrop['id'])) { // , - } elseif (isset($itmz[2]) && $itmz[2] != '') { - $itmz[1] = 0; - } // , , 0 - unset($questDrop); - - // - if ($itmz[1] * 100000 >= rand(1, 10000000)) { - $tou = 0; // - /* */ - $itmnm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itmz[0] . '" LIMIT 1')); - $itmnm = $itmnm['name']; - - $rtxt = ' ' . $tbot2['login'] . ' "' . $itmnm . '" '; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $this->info['dn_id'] . "','" . $this->users[0]['city'] . "','" . $this->users[0]['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1','1')"); - - $ins = mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`) VALUES ( - "' . $this->info['dn_id'] . '", - "' . $tou . '", - "' . $itmz[0] . '", - "' . time() . '", - "' . $this->info['x'] . '", - "' . $this->info['y'] . '")'); - if (!isset($questDrop['id'])) { - $testdrop = 1; // drop-drop //quest - } - } - } - $tii++; - } - } - $j2++; - } - // - // 1-15 , - if (date('m') == 9 && date('d') < 15) { - if ($this->get_chanse(99) == true) { - // - } elseif ($this->info['dungeon'] == 12 || $this->info['dungeon'] == 101) { - $tou = 0; // - /* */ - $itmz = [ - rand(4745, 4751), - 100, - ]; - // - $itmnm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itmz[0] . '" LIMIT 1')); - $itmnm = $itmnm['name']; - - $rtxt = ' ' . $tbot2['login'] . ' "' . $itmnm . '" '; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $this->info['dn_id'] . "','" . $this->users[0]['city'] . "','" . $this->users[0]['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1','1')"); - - $ins = mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`) VALUES ( - "' . $this->info['dn_id'] . '", - "' . $tou . '", - "' . $itmz[0] . '", - "' . time() . '", - "' . $this->info['x'] . '", - "' . $this->info['y'] . '")'); - } - } - // - // , - - if (rand(1, 100) <= 99) { - // - } elseif ($this->info['dungeon'] == 12 || $this->info['dungeon'] == 3 || - $this->info['dungeon'] == 101 || $this->info['dungeon'] == 16 || - $this->info['dungeon'] == 9 || $this->info['dungeon'] == 10 || - $this->info['dungeon'] == 13 || $this->info['dungeon'] == 106) { - $tou = 0; // - // - $itmz = rand(3143, 3192); - // - $itmnm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itmz . '" LIMIT 1')); - $itmnm = $itmnm['name']; - - $rtxt = ' ' . $tbot2['login'] . ' "' . $itmnm . '" '; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $this->info['dn_id'] . "','" . $this->users[0]['city'] . "','" . $this->users[0]['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1','1')"); - - $ins = mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`) VALUES ( - "' . $this->info['dn_id'] . '", - "' . $tou . '", - "' . $itmz . '", - "' . time() . '", - "' . $this->info['x'] . '", - "' . $this->info['y'] . '")'); - } - } - # mysql_query('UPDATE `dungeon_bots` SET `delete` = "'.time().'" WHERE `dn` = "'.$this->info['dn_id'].'" AND `for_dn` = "0" AND `x` = "'.$this->info['x'].'" AND `y`= "'.$this->info['y'].'" AND `delete` = "0" '); - mysql_query('UPDATE `dungeon_bots` SET `delete` = "' . time() . '" AND `inBattle` = "' . $this->info['id'] . '" WHERE `dn` = "' . $this->info['dn_id'] . '" AND `for_dn` = "0" AND `delete` = "0" '); - } else { - // RESTART - $dnr = 1; - if ($this->info['dungeon'] != 102) { - mysql_query('UPDATE `dungeon_bots` SET `inBattle` = "0" WHERE `dn` = "' . $this->info['dn_id'] . '" AND `for_dn` = "0" AND `x` = "' . $this->info['x'] . '" AND `y`= "' . $this->info['y'] . '"'); - } - } - } - } - - $gm = []; - $gms = []; - $bm = []; - $bms = []; - - // - // - - // - $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) { - // - $this->expCoef += $this->stats[$i]['pbe']; - } - - if ($this->info['razdel'] == 5) { - if ($c['m'] >= 6 && $c['m'] <= 8) { - // - $this->expCoef += 5; - } elseif ($c['w'] == 0 || $c['w'] == 6) { - // - $this->expCoef += 5; - } - } - - $this->stats[$i]['exp'] += $this->expCoef; - - $this->stats[$i]['exp'] += $this->aBexp * $c['exp']; - - if ($this->stats[$i]['os4'] > 0) { - $this->stats[$i]['exp'] += $this->stats[$i]['os4']; - } - - /*if($this->stats[$i]['silver']>0) { - $this->stats[$i]['exp'] += 5*$this->stats[$i]['silver']; - if($this->stats[$i]['bonusexp'] > 1) { // ( ) - $this->stats[$i]['exp'] += 1000*$this->stats[$i]['bonusexp']; - } - //if($this->stats[$i]['speeden']>20) { // ( ) - //$this->stats[$i]['enNow'] += $this->stats[$i]['speeden']; - - //$upd2 = mysql_query('UPDATE `stats` SET `enNow` = "'.$this->users[$i]['enNow'].'" WHERE `id` = "'.$this->users[$i]['id'].'" LIMIT 1'); - //} - }*/ - - $act01 = 0; - $this->users[$i]['battle_exp'] = round($this->users[$i]['battle_exp'] + ($this->users[$i]['battle_exp'] / 100 * (1 + $this->info['addExp'] + $this->stats[$i]['exp']))); - - if ($this->info['type'] == 564) { - // - $this->users[$i]['battle_exp'] = 0; - } - - if ($this->info['dungeon'] == 104) { - $this->users[$i]['battle_exp'] = ($u->info['level'] * 2) * (count($this->uids) - 1); - } elseif ($this->info['dungeon'] > 0 && $this->users[$i]['dnow'] != 0 && $this->info['dungeon'] != 1 && $this->users[$i]['team'] == $this->info['team_win']) { - $dun_limitForLevel = [ - 4 => 750, - 5 => 1500, - 6 => 3500, - 7 => 8000, - 8 => 25000, - 9 => 50000, - 10 => 75000, - 11 => 100000, - 12 => 100000, - 13 => 100000, - 14 => 100000, - ]; - // . - - if ($this->users[$i]['battle_exp'] > 0) { - $dun_exp = []; // . - $rep = mysql_fetch_array(mysql_query('SELECT `dungeonexp`,`id` FROM `rep` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - $rep = explode(',', $rep['dungeonexp']); - foreach ($rep as $key => $val) { - $val = explode('=', $val); // - if (isset($val[0]) && isset($val[1]) && $val[0] != '' && $val[1] != 0) { - $dun_exp[(int)$val[0]] = (int)$val[1]; - } - } - unset($rep); - } - - if (!isset($dun_exp[$this->info['dungeon']])) { - $dun_exp[$this->info['dungeon']] = 0; - } - - if (!isset($dun_limitForLevel[(int)$this->users[$i]['level']])) { // , . - $this->users[$i]['battle_exp'] = 0; - } elseif ( - isset($dun_exp[$this->info['dungeon']]) && - $dun_exp[$this->info['dungeon']] >= $dun_limitForLevel[(int)$this->users[$i]['level']] - ) { // , . - $this->users[$i]['battle_exp'] = 0; - } elseif ( - isset($dun_exp[$this->info['dungeon']]) && - $dun_limitForLevel[(int)$this->users[$i]['level']] > $dun_exp[$this->info['dungeon']] - ) { // . - if (($dun_exp[$this->info['dungeon']] + $this->users[$i]['battle_exp']) > $dun_limitForLevel[(int)$this->users[$i]['level']]) { - // , . - $this->users[$i]['battle_exp'] = abs($this->users[$i]['battle_exp'] - abs($dun_limitForLevel[(int)$this->users[$i]['level']] - ($this->users[$i]['battle_exp'] + $dun_exp[$this->info['dungeon']]))); - $dun_exp[$this->info['dungeon']] += $this->users[$i]['battle_exp']; - } elseif ($dun_limitForLevel[(int)$this->users[$i]['level']] > ($dun_exp[$this->info['dungeon']] + $this->users[$i]['battle_exp'])) { - // , . - $this->users[$i]['battle_exp'] = $this->users[$i]['battle_exp']; - $dun_exp[$this->info['dungeon']] += $this->users[$i]['battle_exp']; - } else { - $this->users[$i]['battle_exp'] = 0; - } - } else { // . - $this->users[$i]['battle_exp'] = 0; - } - - - if ($this->users[$i]['battle_exp'] > 0 && isset($dun_exp[$this->info['dungeon']]) && $dun_exp[$this->info['dungeon']] > 0) { - $dunexp = []; - foreach ($dun_exp as $key => $val) { - $dunexp[$key] = $key . '=' . $val; // - } - $dun_exp = implode(",", $dunexp); - mysql_query('UPDATE `rep` SET `dungeonexp` = "' . $dun_exp . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - unset($dunexp, $dun_exp); - } - unset($dun_limitForLevel); - } - - $sinf = ''; - if ($c['exp_mega'] == true) { - $this->users[$i]['battle_exp'] += floor($this->users[$i]['battle_exp'] / 100 * $c['exp_mega_val'][$this->users[$i]['level']]); - } - - /*if( $this->users[$i]['level'] < 8 ) { - $this->users[$i]['battle_exp'] = $this->users[$i]['battle_exp']*10; - }elseif( $this->users[$i]['level'] < 9 ) { - //$this->users[$i]['battle_exp'] = $this->users[$i]['battle_exp']*2; - }*/ - - if ($this->info['team_win'] == 0 && $this->info['type'] != 564) { - // - if ($this->info['razdel'] == 5) { - //mysql_query('INSERT INTO `users_reting` (`uid`,`time`,`val`) VALUES ( - //"'.$this->users[$i]['id'].'","'.time().'","10")'); - } - //$sinf .= ' '; - if ($this->users[$i]['level'] <= 1) { - $this->users[$i]['battle_exp'] = floor($this->users[$i]['battle_exp'] * 0.50); - } else { - //$this->users[$i]['battle_exp'] = 0; - $this->users[$i]['battle_exp'] = ceil($this->users[$i]['battle_exp'] * 0.10); - } - $this->users[$i]['nich'] += 1; - // - mysql_query('UPDATE `users` SET `swin` = 0, `slose` = 0 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - } elseif ($this->users[$i]['team'] == $this->info['team_win'] && $this->info['type'] != 564) { - // - if ($this->info['razdel'] == 5) { - //mysql_query('INSERT INTO `users_reting` (`uid`,`time`,`val`) VALUES ( - //"'.$this->users[$i]['id'].'","'.time().'","30")'); - } - //$sinf .= ' '; - $gm[$i] = $this->info['money']; - - $gms[$i] = $this->info['money3']; - - $this->users[$i]['win'] += 1; - $act01 = 1; - // - mysql_query('UPDATE `users` SET `swin` = `swin` + 1, `slose` = 0 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - } elseif ($this->info['type'] != 564) { - // - if ($this->info['razdel'] == 5) { - //mysql_query('INSERT INTO `users_reting` (`uid`,`time`,`val`) VALUES ( - //"'.$this->users[$i]['id'].'","'.time().'","10")'); - } - //$sinf .= ' '; - if ($this->users[$i]['level'] <= 1) { - $this->users[$i]['battle_exp'] = ceil($this->users[$i]['battle_exp'] * 0.33); - } else { - //$this->users[$i]['battle_exp'] = 0; - $this->users[$i]['battle_exp'] = ceil($this->users[$i]['battle_exp'] * 0.10); - } - $bm[$i] = $this->info['money']; - - $bms[$i] = $this->info['money3']; - - $this->users[$i]['lose'] += 1; - // - /*if($this->users[$i]['level']>=4 && $this->info['dungeon'] == 0 && $this->stats[$i]['silver'] < 2){ - $noOsl = 0; - $nn = 0; - while($nnstats[$i]['effects'])){ - if($this->stats[$i]['effects'][$nn]['id_eff']==5){ - $noOsl = 1; - } - $nn++; - } - if($noOsl==0){ - if($this->users[$i]['id'] != 3874647) { - $magic->oslablenie($this->users[$i]['id']); - } - - } - }*/ - // - mysql_query('UPDATE `users` SET `swin` = 0, `slose` = `slose` + 1 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - $act01 = 2; - } - if ($this->users[$i]['level'] < 4) { - //$this->users[$i]['battle_exp'] = $this->users[$i]['battle_exp']*3; - } - //$sinf .= ' '.$this->info['id'].'-'.$this->info['team_win'].'-'.$relbf.'-'.$this->users[$i]['team'].'-'.$tl .' '; - // - // - ( .) - if ($this->info['money3'] > 0 && isset($gms[$i]) && $this->info['type'] != 564) { - $mn = [ - 'l' => 0, // - 'w' => 0, // - 'm' => 0 // () - ]; - if ($act01 == 1) { - $mn['l'] = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `battle_users` WHERE `battle` = "' . $this->info['id'] . '" AND `team` != "' . $this->users[$i]['team'] . '" LIMIT 1')); - $mn['l'] = $mn['l'][0]; - $mn['w'] = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `battle_users` WHERE `battle` = "' . $this->info['id'] . '" AND `team` = "' . $this->users[$i]['team'] . '" LIMIT 1')); - $mn['w'] = $mn['w'][0]; - $mn['m'] = round(($mn['l'] * $this->info['money3']) / 100 * 87, 2); - $gms[$i] = round(($mn['m'] / $mn['w']), 2); - } - } - // - // - // - if ($act01 == 1) { - // - if ($this->users[$i]['dnow'] == 0) { - if ($this->users[$i]['hpNow'] < 1) { - $lom = 0.05; - } - } - } elseif ($act01 == 2) { - // - $lom = 0.55; - } else { - // - $lom = 0.05; - } - //$lom = round($lom*2.75,2); - $nlom = [0 => rand(0, 18), 1 => rand(0, 18), 2 => rand(0, 18), 3 => rand(0, 18)]; - if ($this->info['type'] == 564) { - $lom = 0; - } - if ($this->stats[$i]['silver'] >= 4) { - $lom = 0; - } - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW`+' . $lom . ' WHERE `inOdet` < "18" AND `inOdet` > "0" AND `uid` = "' . $this->users[$i]['id'] . '" AND `inOdet`!="0" AND `inOdet`!=' . $nlom[0] . ' AND `inOdet`!=' . $nlom[1] . ' AND `inOdet`!=' . $nlom[2] . ' AND `inOdet`!=' . $nlom[3] . ' LIMIT 18'); - - $prc = ''; - if ($this->users[$i]['align'] == 2) { - $this->users[$i]['battle_exp'] = floor($this->users[$i]['battle_exp'] / 2); - } - if ($this->users[$i]['animal'] > 0) { - $ulan = $u->testAction('`uid` = "' . $this->users[$i]['id'] . '" AND `vars` = "animal_use' . $this->info['id'] . '" LIMIT 1', - 1); - if (isset($ulan['id']) && $this->users[$i]['team'] == $this->info['team_win'] && $this->users[$i]['level'] > $ulan['vals']) { - $a004 = mysql_fetch_array(mysql_query('SELECT `max_exp`,`name` 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')); - //33% , - $aexp = (round($this->users[$i]['battle_exp'] / 100 * 33)); - if ($aexp > $a004['max_exp']) { - $aexp = $a004['max_exp']; - } - unset($ulan); - // - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat` - ) VALUES ( - '1','" . $this->users[$i]['city'] . "','" . $this->users[$i]['room'] . "','','" . $this->users[$i]['login'] . "' - ,' "" . $a004['name'] . "" : " . $aexp . "','-1','6','0')"); - // - $upd = mysql_query('UPDATE `users_animal` SET `exp` = `exp` + ' . $aexp . ' WHERE `id` = "' . $this->users[$i]['animal'] . '" AND `level` < ' . $this->users[$i]['level'] . ' LIMIT 1'); - if ($upd) { - $this->users[$i]['battle_exp'] = round($this->users[$i]['battle_exp'] / 100 * 67); - $this->info['addExp'] -= 33.333; - } - } - } - - $prsusers = mysql_fetch_array(mysql_query('SELECT SUM(`price1`) FROM `battle_users` WHERE `battle` = "' . $this->info['id'] . '" LIMIT 1')); - unset($prsusers); - $btlstatus = $this->typeBattle($prsusers[0]); - if ($this->info['smert'] == 1) { - $btlstatus = [150, 150, ' ', ' ']; - } - // - if ($this->stats[$i]['clanpos'] > 0) { - if ($this->stats[$i]['clanpos'] == 1) { - $this->info['addExp'] += 0; - } elseif ($this->stats[$i]['clanpos'] == 2) { - $this->info['addExp'] += 0; - } elseif ($this->stats[$i]['clanpos'] == 3) { - $this->info['addExp'] += 0; - } - } - - unset($r1); - // - if ($btlstatus[0] > 0) { - if ($this->info['type'] == 99) { - $this->info['addExp'] += $btlstatus[1]; - } else { - $this->info['addExp'] += $btlstatus[0]; - } - } - - if ($this->users[$i]['align'] == 2 || $this->users[$i]['haos'] > time()) { - $this->stats[$i]['exp'] = -($this->info['addExp'] + 50); - } - if ($this->info['addExp'] + $this->stats[$i]['exp'] != 0) { - $prc = ' (' . (100 + $this->info['addExp'] + $this->stats[$i]['exp']) . '%)'; - } - if ($this->info['money'] > 0) { - if (isset($gm[$i])) { - $prc .= ' ' . $gm[$i] . ' . .'; - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $gm[$i] . ' . ( ' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0); - $this->users[$i]['money'] += $gm[$i]; - } elseif (isset($bm[$i])) { - $prc .= ' ' . $bm[$i] . ' . .'; - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $gm[$i] . ' . ( ' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0); - $this->users[$i]['money'] -= $bm[$i]; - } - } - // - if ($c['money_haot'] == true && $this->users[$i]['exp'] <= 200000000) { - if ($act01 == 1 && $this->info['razdel'] == 5 && $this->users[$i]['level'] >= 8) { - // - $trexp = [ - 8 => 1200, - 9 => 3000, - 10 => 4500, - 11 => 12000, - 12 => 20000, - 13 => 30000, - 14 => 30000, - 15 => 30000, - 16 => 30000, - 17 => 30000, - 18 => 30000, - 19 => 30000, - 20 => 30000, - 21 => 30000, - ]; - $trexp = $trexp[$this->users[$i]['level']]; - - // - $trmn = [ - 8 => 1000, - 9 => 3000, - 10 => 2500, - 11 => 3000, - 12 => 3000, - 13 => 3000, - 14 => 3000, - 15 => 3000, - 16 => 3000, - 17 => 3000, - 18 => 3000, - 19 => 3000, - 20 => 3000, - 21 => 3000, - ]; - $trmn = $trmn[$this->users[$i]['level']]; - - // - $admn = [ - 8 => 0.05, //0.05 - 9 => 0.065, //0.065 - 10 => 0.075, //0.075 - 11 => 0.085, //0.085 - 12 => 0.1, //0.1 - 13 => 0.1, - 14 => 0.1, - 15 => 0.1, - 16 => 0.1, - 17 => 0.1, - 18 => 0.1, - 19 => 0.1, - 20 => 0.1, - 21 => 0.1, - ]; - $admn = $admn[$this->users[$i]['level']]; - - if ($c['m'] >= 6 && $c['m'] <= 8) { - // - if ($c['w'] == 0 || $c['w'] == 5 || $c['w'] == 6) { - // - $admn = $admn * 2; - } - } elseif ($c['w'] == 0 || $c['w'] == 5 || $c['w'] == 6) { - // - $admn = $admn * 2; - } - if ($this->users[$i]['battle_exp'] < $trexp) { - // - $prc .= ', 0 ( ).'; - //}elseif( $this->stats[$i]['prckr'] < $trmn ) { - // - //$prc .= ', 0 ( ).'; - } elseif ($admn > 0) { - if ($this->info['type'] != 33) { - $prc .= ', ' . $admn . ' .'; - } - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $admn . ' ( ' . $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 .= ', 0 , .'; - }else{ - $prc .= ', '.$admnb.' .'; - $u->addDelo(4,$this->users[$i]['id'],'"System.battle": '.$admnb.' ( '.$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.' .'; - } - // - */ - } - } - // - if ($this->info['money3'] > 0) { - if (isset($gms[$i])) { - $prc .= ' ' . $gms[$i] . ' $. .'; - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $gms[$i] . ' $. ( ' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0); - $this->users[$i]['money3'] += $gms[$i]; - mysql_query('UPDATE `users` SET `money3` = `money3` + "' . $gms[$i] . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } elseif (isset($bms[$i])) { - $prc .= ' ' . $bms[$i] . ' $. .'; - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $gms[$i] . ' $. ( ' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0); - $this->users[$i]['money3'] -= $bms[$i]; - mysql_query('UPDATE `users` SET `money3` = `money3` - "' . $bms[$i] . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } - } - /*if($this->info['kingfight']==1 && $this->info['type'] != 564 ) { - // - if($this->info['team_win'] == 0) { - - }elseif($this->users[$i]['team'] == $this->info['team_win']){ - $bnks = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `uid` = "'.$this->users[$i]['id'].'" ORDER BY `useNow` DESC LIMIT 1')); - if(isset($bnks['id'])) { - $bnks['msn'] = round($this->user[$i]['level']/50,2); - $bnks['msn'] = 0.15; - mysql_query('UPDATE `bank` SET `money2` = `money2` + "'.mysql_real_escape_string($bnks['msn']).'" WHERE `id` = "'.$bnks['id'].'" LIMIT 1'); - $prc .= ' : '.$bnks['msn'].' ., '.$bnks['id'].''; - - } - unset($bnks); - } - }*/ - - /* - 7 - 10800 - 8 - 36000 - 9 - 56000 - 10 - 86000 - if($this->users[$i]['battle_exp'] > (1+$this->users[$i]['level']*$this->users[$i]['level'])*4755) { - $this->users[$i]['battle_exp'] = (1+$this->users[$i]['level']*$this->users[$i]['level'])*4755; - } - */ - - //$lime = array(8=>18000,9=>28000,10=>84000,11=>150000); - $lime = [ - 8 => 18000, - 9 => 28000, - 10 => 84000, - 11 => 100, - 12 => 100, - 13 => 100, - 14 => 100, - 15 => 100, - 16 => 100, - 17 => 100, - 18 => 100, - 19 => 100, - 20 => 100, - 21 => 100, - ]; - - if ($this->users[$i]['level'] < 8) { - $lime = 5400; - } else { - $lime = $lime[$this->users[$i]['level']]; - } - - if ($this->stats[$i]['silver'] >= 5) { - $lime += round($lime); - } - - /*if( $this->stats[$i]['silver'] > 0 ) { - $lime += floor($lime/100*(10*$this->stats[$i]['silver'])); - }*/ - - if ($this->users[$i]['stopexp'] == 1) { - $lime = 0; - $this->users[$i]['battle_exp'] = 0; - } - - if ($lime < $this->users[$i]['battle_exp'] && $c['limitedexp'] == true) { - $this->users[$i]['battle_exp'] = $lime; - } - // - /*if( $this->users[$i]['battle_exp'] > 100 && $this->info[$i]['level'] == 6 ) { - $this->users[$i]['battle_exp'] = 100; - }*/ - // - unset($lime); - - - //if(100+$this->info['addExp']+$this->stats[$i]['exp'] > 1000) { - //$prc .= ' ( )'; - //} - - if ($btlstatus[0] > 0) { - if ($this->info['type'] == 99) { - $prc .= ' (' . $btlstatus[3] . ')'; - } else { - $prc .= ' (' . $btlstatus[2] . ')'; - } - } - - if ($this->info['dungeon'] == 1 && $this->users[$i]['team'] == $this->info['team_win']) { - // - $rep = mysql_fetch_array(mysql_query('SELECT `dl1`,`id` FROM `rep` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if ($rep['dl' . $this->info['dungeon']] > 0) { - $this->users[$i]['battle_exp'] += 3 * count($this->users); - if ($rep['dl' . $this->info['dungeon']] > $this->users[$i]['battle_exp']) { - $rep['dl' . $this->info['dungeon']] -= $this->users[$i]['battle_exp']; - } else { - $this->users[$i]['battle_exp'] = $rep['dl' . $this->info['dungeon']]; - $rep['dl' . $this->info['dungeon']] = 0; - } - mysql_query('UPDATE `rep` SET `dl' . $this->info['dungeon'] . '` = "' . $rep['dl' . $this->info['dungeon']] . '" WHERE `id` = "' . $rep['id'] . '" LIMIT 1'); - } else { - $this->users[$i]['battle_exp'] = 0; - } - } - - if ($this->users[$i]['battle_exp'] < 1) { - $this->users[$i]['battle_exp'] = 0; - } - - if ($this->users[$i]['battle_exp'] < 1 && $this->users[$i]['twink'] == 0) { - if ($this->info['money'] == 0 && $this->info['money3'] == 0 && $this->info['kingfight'] == 0 && (!isset($admnb) || $admnb == 0)) { - $prc = ''; - } - } - - if ($this->user[$i]['host_reg'] == 'real_bot_user') { - $this->users[$i]['battle_exp'] = round($this->users[$i]['battle_exp'] / 3); - } - - if ($sinf != '') { - $sinf = ' ( ' . $sinf . ' )'; - } - - /*if( $this->users[$i]['level'] >= 8 ) { - if( $this->users[$i]['battle_exp'] > 1000 ) { - $this->users[$i]['battle_exp'] = 1000; - } - }*/ - //-------------- 8-9-------------- - - - if ($this->users[$i]['level'] == 8 && $this->users[$i]['battle_exp'] >= 23000) { - $this->users[$i]['battle_exp'] = 23000; - }; - // if ($this->users[$i]['level']==9 ) {$this->users[$i]['battle_exp']=floor($this->users[$i]['battle_exp']/3);}; - if ($this->users[$i]['level'] == 9 && $this->users[$i]['battle_exp'] >= 31000) { - $this->users[$i]['battle_exp'] = 31000; - }; - // if ($this->users[$i]['level']==10 ) {$this->users[$i]['battle_exp']=floor($this->users[$i]['battle_exp']/4);}; - if ($this->users[$i]['level'] == 10 && $this->users[$i]['battle_exp'] >= 52000) { - $this->users[$i]['battle_exp'] = 52000; - }; - // if ($this->users[$i]['level']==11 ) {$this->users[$i]['battle_exp']=floor($this->users[$i]['battle_exp']/4);}; - if ($this->users[$i]['level'] >= 11 && $this->users[$i]['battle_exp'] >= 75000) { - $this->users[$i]['battle_exp'] = 75000; - }; - //------------------------------------- - - if ($this->info['type'] != 33) { - $this->users[$i]['battle_text'] = ' . : ' . floor($this->users[$i]['battle_yron']) . ' HP. : ' . (0 + $this->users[$i]['battle_exp']) . '' . $prc . '.' . $sinf; //stats - } - - /* */ - if ($c['nolevel'] == true) { - $rex95 = substr($this->users[$i]['exp'], -1); - if ($this->users[$i]['money4'] < 1000 && $this->users[$i]['exp'] == 12499) { - $rex95 = 6; - $rex95 = 5; - } - } else { - $rex95 = 5; - } - - - //echo '['.$rex95.']'; - if ($c['zuby'] == true && $this->info['dungeon'] == 0 && ($this->info['clone'] == 0 || $this->users[$i]['level'] < 5) && $rex95 != 9 && $this->info['type'] != 564) { - if ($this->users[$i]['align'] != 2 && $this->users[$i]['level'] >= 0 && $this->users[$i]['level'] < 8 && $this->users[$i]['battle_exp'] > 0) { - $rzb = 0; - - if ($this->get_chanse(50) == true) { - $rzb += rand(1, 3); - } else { - if ($this->users[$i]['battle_exp'] > 15) { - $rzb += 1; - } - } - - $chzbs = 100; - - if ($this->stats[$i]['silver'] > 0) { - $chzbs = 150; - } - - if ($this->users[$i]['battle_exp'] > 9) { - if ($this->users[$i]['level'] > 1) { - // - if ($this->get_chanse(25 / 100 * $chzbs) == true) { - $rzb += 10; - } - } elseif ($this->users[$i]['level'] == 1) { - if ($this->get_chanse(30 / 100 * $chzbs) == true) { - $rzb += 10; - } - } - - if ($this->users[$i]['level'] > 3) { - if ($this->get_chanse(5 / 100 * $chzbs) == true) { - $rzb += 100; - } - } - } - - if ($this->users[$i]['team'] == $this->info['team_win']) { - // - if ($this->users[$i]['level'] < 8) { - $rzb += 1; - } - } elseif ($this->users[$i]['team'] == 0) { - // - if ($this->get_chanse(25 / 100 * $chzbs) == true && $this->users[$i]['battle_exp'] > 2) { - $rzb = rand(0, 1); - } else { - $rzb = 0; - } - } else { - // - if ($this->users[$i]['level'] >= 1) { - $rzb = 0; - } else { - if ($this->users[$i]['battle_exp'] < 3) { - $rzb = 0; - } elseif ($this->user[$i]['lose'] > $this->user[$i]['win']) { - if ($this->get_chanse(5 / 100 * $chzbs) == true) { - $rzb = rand(0, 1); - } else { - $rzb = 0; - } - } elseif ($this->get_chanse(10 / 100 * $chzbs) == true) { - $rzb = rand(0, 1); - } - } - $rzb = 0; - } - - if ($rex95 == 6 /*|| $this->users[$i]['exp'] == 12499 */) { - if ($this->users[$i]['battle_exp'] > 10) { - $rzb = rand(0, 1); - } else { - $rzb = 0; - } - } - - if ($rzb > 0 && rand(0, 1000) <= 500) { - $rzb = rand(1, 3); - } - if ($rzb > 0) { - if ($this->stats[$i]['silver'] >= 5) { - $rzb = $rzb * 2; - } - mysql_query('UPDATE `users` SET `money4` = `money4` + "' . $rzb . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - $this->users[$i]['battle_text'] .= ' ' . $u->zuby($rzb, - 1) . ' .'; - } - } - } - - if ($this->info['priz'] > 0) { - // - /* - [4754] - 2-3 = 1 - 4-5 = 1 - 6-7 = 2 - 8-9 = 3 - (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'] .= ' (x5). '; - 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'] .= ' . '; - } - - } - */ - } else { - $tmon = [ - 2 => 1, - 3 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 2, - 8 => 3, - 9 => 3, - 10 => 5, - 11 => 5, - ]; - $tmon = $tmon[$this->users[$i]['level']]; - // - $tmonc = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `battle` WHERE `id` IN ( SELECT `battle_id` FROM `battle_last` WHERE `uid` = "' . $this->users[$i]['id'] . '" ) AND `priz` > 0 AND `time_start` > "' . strtotime(date('d.m.Y')) . '"')); - $tmonc = $tmonc[0]; - // - if ($this->users[$i]['team'] == $this->info['team_win']) { - // - if ($tmonc < 1) { - $tmonc = 1; - } elseif ($tmonc > 96) { - $tmonc = 96; - } - $tmon = ($tmon * $tmonc); - } - // - $tmoni = 1; - while ($tmoni <= floor($tmon / 2)) { - $u->addItem(4754, $this->users[$i]['id'], ''); // - $tmoni++; - } - // - $this->users[$i]['battle_text'] .= ' (x' . floor($tmon / 2) . '). ( , ! ' . ($tmonc) . '/96 )'; - // - unset($tmon, $tmoni); - } - } - // - if ($this->info['dungeon'] == 0 && $this->info['razdel'] == 5 && $this->users[$i]['team'] == $this->info['team_win']) { - //2 - $u->repexp_add($this->users[$i]['id'], 2); // +2 - $check = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 478 AND `uid` = "' . $this->users[$i]['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;')); - if (isset($check['id'])) { - $urcheck = 10000; - if ($this->users[$i]['level'] == 8) { - $urcheck = 3000; - } elseif ($this->users[$i]['level'] == 9) { - $urcheck = 7000; - } elseif ($this->users[$i]['level'] == 10) { - $urcheck = 12000; - } elseif ($this->users[$i]['level'] >= 11) { - $urcheck = 18000; - } - - if ($this->users[$i]['battle_yron'] >= $urcheck) { - //UPDATE `eff_users` SET `timeUse` = '1555700000' WHERE `eff_users`.`id` = 31912807; - mysql_query('UPDATE `eff_users` SET `timeUse` = `timeUse` - 300 WHERE `id_eff`=478 AND `delete` = 0 AND `uid` =' . $this->users[$i]['id'] . ' LIMIT 1'); - $this->users[$i]['battle_text'] .= ' ' . $urcheck . ' -5 . !'; - } - } - mysql_query('UPDATE `users_achiv` SET `vx`= `vx`+1 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); // - - } - // - if ($this->info['dungeon'] == 0 && $this->info['type'] == 250 && $this->users[$i]['team'] == $this->info['team_win']) { - mysql_query('UPDATE `users_achiv` SET `kw`= `kw`+1 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - if (date('w') == 0 || date('w') == 6 || date('w') == 4) { - $u->repexp_add($this->users[$i]['id'], 25); // () 25 - } - } - // - if ($this->info['dungeon'] == 0 && $this->info['type'] == 99 && $this->users[$i]['team'] == $this->info['team_win']) { - if (date('w') == 0 || date('w') == 6 || date('w') == 5) { - $u->repexp_add($this->users[$i]['id'], 10); // () 10 - } - } - - // - if ($this->info['dungeon'] == 0 && $this->info['type'] == 500 && $this->users[$i]['team'] == $this->info['team_win'] && $this->users[$i]['no_ip'] != 'trupojor' && $this->users[$i]['bot'] == 0) { - if ($this->users[$i]['level'] > 9) { - $mid = 903093; - } else { - $mid = 89489; - } - $mon = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_monsters` WHERE `uid` = "' . $mid . '" LIMIT 1')); - - if ($this->users[$i]['battle_yron'] >= 2000) { - $ritem = rand(1, 100); - if ($ritem <= 20) { - $mon['win_itm'] = '4459@1'; - } elseif ($ritem <= 40) { - $mon['win_itm'] = '4460@1'; - } elseif ($ritem <= 60) { - $mon['win_itm'] = '4461@1'; - } elseif ($ritem <= 80) { - $mon['win_itm'] = '4462@1'; - } else { - $mon['win_itm'] = '4463@1'; - } - } elseif ($this->users[$i]['battle_yron'] >= 1500) { - $ritem = rand(1, 100); - if ($ritem <= 20) { - $mon['win_itm'] = '4459@1'; - } elseif ($ritem <= 40) { - $mon['win_itm'] = '4460@1'; - } elseif ($ritem <= 60) { - $mon['win_itm'] = '4461@1'; - } elseif ($ritem <= 80) { - $mon['win_itm'] = '4462@1'; - } else { - $mon['win_itm'] = '4463@1'; - } - } elseif ($this->users[$i]['battle_yron'] >= 1000) { - $ritem = rand(1, 100); - if ($ritem <= 25) { - $mon['win_itm'] = '4460@1'; - } elseif ($ritem <= 50) { - $mon['win_itm'] = '4461@1'; - } elseif ($ritem <= 75) { - $mon['win_itm'] = '4462@1'; - } else { - $mon['win_itm'] = '4463@1'; - } - } else { - $mon['win_itm'] = '4392@1'; - $timewait = 0; - } - if ($this->users[$i]['battle_yron'] > 0) { - mysql_query('INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","478","111","' . $this->users[$i]['id'] . '"," ","pravonapodvig=1","' . time() . '")'); - } - mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $this->users[$i]['id'] . '","' . (time() - $timewait) . '","capitalcity","' . $this->users[$i]['room'] . '","end_trup"," ","","")'); - 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() . '")'); - $ritem = rand(1, 1000); - if ($ritem == 555) { - $mon['win_itm'] = $mon['win_itm'] . ',5022@1'; - } - // - $this->addGlobalItems($mid, $this->users[$i]['id'], $mon['win_itm'], $mon['win_eff'], - $mon['win_ico'], 1, $mon['win_money1'], $mon['win_money2']); //$mon['win_exp'] - - } - - if ($this->info['dungeon'] == 0 && $this->info['razdel'] == 5 && $u->info['battle_yron'] >= 2000) //$u->info['battle_yron'] - { - // ang_g - if ($this->users[$i]['team'] == $this->info['team_win']) { - // - $tmoni = 2; - } else { - $tmoni = 1; - } - - // - $tmon = $tmoni; - $effblago = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = ' . $this->users[$i]['id'] . ' AND `delete` = 0 AND `id_eff`= 414 LIMIT 1')); - if (isset ($effblago['id'])) { - $limitg = 50; - } else { - $limitg = 25; - } - while ($tmoni >= 1) { - if ($u->info['ang_g'] < $limitg) { - $u->addItem(4754, $this->users[$i]['id'], ''); - mysql_query('UPDATE `users` SET `ang_g`=`ang_g`+1 WHERE `id` =' . $this->users[$i]['id'] . ''); - } else { - $tmon--; - } - $tmoni--; - } - - if ($this->info['type'] != 33) { - $this->users[$i]['battle_text'] .= ' (' . $tmon . '). [' . ($u->info['ang_g'] + $tmon) . '/' . $limitg . '] . '; - } - unset($tmon, $tmoni, $effblago, $limitg); - } - - - if ($this->info['razdel'] == 5 || $this->info['razdel'] == 4) { - if (date('d.m') == '31.10' || (date('m') == 11 && date('d') < 7)) { - // 4504 - $this->users[$i]['battle_text'] .= ' (x1).'; - $u->addItem(4504, $this->users[$i]['id'], '|sudba=1'); - } - } - - - // - if ($this->info['dungeon'] == 0 && $this->info['razdel'] == 5 && $this->users[$i]['exp'] >= 1500 /*($this->users[$i]['exp'] < 12499 || $this->users[$i]['exp'] > 12500)*/ - ) { - if ($this->users[$i]['battle_exp'] > 100 * $this->users[$i]['level']) { - $rzbvo = $this->users[$i]['battle_exp'] * 6 / 1000; - - if ($this->users[$i]['level'] == 8) { - if ($rzbvo >= 100) { - $rzbvo = 100; - } - } - if ($this->users[$i]['level'] == 9) { - if ($rzbvo >= 150) { - $rzbvo = 150; - } - } - if ($this->users[$i]['level'] == 10) { - if ($rzbvo >= 200) { - $rzbvo = 200; - } - } - if ($this->users[$i]['level'] == 11) { - if ($rzbvo >= 250) { - $rzbvo = 250; - } - } - if ($this->users[$i]['level'] == 12) { - if ($rzbvo >= 250) { - $rzbvo = 250; - } - } - - - /*if( $this->info['players_c'] > 4 ) { - $rzbvo = 2*$this->info['players_c']; - }*/ - if ($this->info['type'] != 33) { - $this->users[$i]['battle_text'] .= ' ' . $rzbvo . ' .'; - } - mysql_query('UPDATE `rep` SET `rep3` = `rep3` + "' . $rzbvo . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $this->users[$i]['id'] . '","' . time() . '","capitalcity","' . $this->users[$i]['room'] . '","end_xaot"," ","' . $zadID . '","")'); - } - } - - if ($this->stats[$i]['hpNow'] >= 1) { - $this->stats[$i]['test_heal'] = mysql_fetch_array(mysql_query('SELECT SUM(`yrn`) FROM `battle_stat` WHERE `uid2` = "' . $this->users[$i]['id'] . '" AND `battle` = "' . $this->info['id'] . '" LIMIT 1')); - $this->stats[$i]['test_heal'] = $this->stats[$i]['test_heal'][0]; - $this->stats[$i]['test_start'] = mysql_fetch_array(mysql_query('SELECT `hpStart` FROM `battle_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `battle` = "' . $this->info['id'] . '" LIMIT 1')); - $this->stats[$i]['test_start'] = $this->stats[$i]['test_start']['hpStart']; - // - $this->stats[$i]['hpNow'] = ($this->stats[$i]['test_start'] - $this->stats[$i]['test_heal']); - if ($this->stats[$i]['hpNow'] < 1) { - $this->stats[$i]['hpNow'] = 1; - } - } 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) { - $cpr = 25; - } elseif ($this->info['typeBattle'] == 50) { - $cpr = 65; - } - if ($this->stats[$i]['silver'] >= 5) { - $cpr = floor($cpr / 100 * 150); - } - mysql_query('UPDATE `clan` SET `exp` = `exp` + "' . round($this->users[$i]['battle_exp'] / 100 * $cpr) . '" WHERE `id` = "' . $this->users[$i]['clan'] . '" LIMIT 1'); - } - - $this->users[$i]['battle_exp'] = 0; //stats - - if ($this->users[$i]['team'] == $this->info['team_win']) { - mysql_query('UPDATE `rep` SET `n_capitalcity` = `n_capitalcity` + ' . $this->users[$i]['bn_capitalcity'] . ' ,`n_demonscity` = `n_demonscity` + ' . $this->users[$i]['bn_demonscity'] . ' ,`n_demonscity` = `n_demonscity` + ' . $this->users[$i]['bn_suncity'] . ' WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } - - // - $this->users[$i]['bn_demonscity'] = 0; - $this->users[$i]['bn_capitalcity'] = 0; - $this->users[$i]['bn_suncity'] = 0; - // - $spe = mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `file_finish` != "" AND `v1` = "priem" LIMIT 30'); - while ($ple = mysql_fetch_array($spe)) { - if (file_exists('../../_incl_data/class/priems/' . $ple['file_finish'] . '.php')) { - require('../../_incl_data/class/priems/' . $ple['file_finish'] . '.php'); - } - } - // - mysql_query('DELETE FROM `eff_users` WHERE `v1` = "priem" AND `uid` = "' . $this->users[$i]['id'] . '" LIMIT 50'); - if ($dnr == 1) { - if ($this->users[$i]['room'] == 370) { - $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `dn` = "' . $this->users[$i]['dnow'] . '" AND `vars` = "dielaba" LIMIT 1')); - $dies = $dies[0]; - mysql_query('INSERT INTO `dungeon_actions` (`dn`,`uid`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( - "' . $this->users[$i]['dnow'] . '","' . $this->users[$i]['id'] . '","' . $this->users[$i]['x'] . '","' . $this->users[$i]['y'] . '","' . time() . '","dielaba","" - )'); - } else { - $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `dn` = "' . $this->users[$i]['dnow'] . '" AND `vars` = "die" LIMIT 1')); - $dies = $dies[0]; - mysql_query('INSERT INTO `dungeon_actions` (`dn`,`uid`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( - "' . $this->users[$i]['dnow'] . '","' . $this->users[$i]['id'] . '","' . $this->users[$i]['x'] . '","' . $this->users[$i]['y'] . '","' . time() . '","die","" - )'); - } - if ($dies < 2 || $this->info['dungeon'] == 15) { - // - $tshbn = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `delete` = 0 AND `item_id` = "4910" LIMIT 1')); - if (isset($tshbn['id'])) { - // - mysql_query('DELETE FROM `items_users` WHERE `id` = "' . $tshbn['id'] . '" LIMIT 1'); - // - mysql_query('INSERT INTO `dungeon_obj` ( - `name`,`dn`,`x`,`y`,`img`,`delete`,`action`,`for_dn`, - `type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date` - ) VALUES ( - "","' . $this->info['dn_id'] . '","' . $this->users[$i]['x'] . '","' . $this->users[$i]['y'] . '","shaiba.png","0","fileact:15/shaiba","0", - "0","120","220","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt1:69,rl1:-47,rt2:74,rl2:126,rt3:76,rl3:140,rt4:80,rl4:150}" - )'); - // - } - // ( 00) - $this->users[$i]['x'] = $this->users[$i]['res_x']; - $this->users[$i]['y'] = $this->users[$i]['res_y']; - $this->users[$i]['s'] = $this->users[$i]['res_s']; - $r_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `room` WHERE `id` = "' . (int)$this->users[$i]['room'] . '" LIMIT 1')); - if ($this->users[$i]['room'] == 370) { - if ($this->users[$i]['sex'] == 0) { - $rtxt = '' . $this->users[$i]['login'] . ' '; - } else { - $rtxt = '' . $this->users[$i]['login'] . ' '; - } - } else { - if ($this->users[$i]['sex'] == 0) { - $rtxt = '' . $this->users[$i]['login'] . ' "' . $r_n['name'] . '"'; - } else { - $rtxt = '' . $this->users[$i]['login'] . ' "' . $r_n['name'] . '"'; - } - } - } elseif ($this->info['dungeon'] == 102) { - $nld = ''; - $lab = mysql_fetch_array(mysql_query('SELECT `id`,`users` FROM `laba_now` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if ($lab['users'] < 2) { - // - mysql_query('DELETE FROM `laba_now` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `laba_map` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '"'); - mysql_query('DELETE FROM `laba_act` WHERE `lib` = "' . $lab['id'] . '"'); - mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "' . $lab['id'] . '"'); - } else { - $lab['users']--; - mysql_query('UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); - } - mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('UPDATE `users` SET `room` = "369" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND (`dn_delete` = "1" OR `data` LIKE "%fromlaba=1%")'); - if ($this->users[$i]['login'] != '') { - if ($this->users[$i]['sex'] == 0) { - $rtxt = '' . $this->users[$i]['login'] . ' ' . $nld; - } else { - $rtxt = '' . $this->users[$i]['login'] . ' ' . $nld; - } - } - } else { - $tinf = mysql_fetch_array(mysql_query('SELECT `uid` FROM `dungeon_now` WHERE `id` = "' . $this->info['dn_id'] . '" LIMIT 1')); - $nld = ''; - if ($tinf['uid'] == $this->users[$i]['id']) { - $tinf = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dnow` = "' . $this->info['dn_id'] . '" AND `hpNow` >= 1 LIMIT 1')); - if (isset($tinf['id'])) { - $tinf = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `id` = "' . $tinf['id'] . '" LIMIT 1')); - $nld .= ', "' . $tinf['login'] . '"'; - mysql_query('UPDATE `dungeon_now` SET `uid` = "' . $tinf['id'] . '" WHERE `id` = "' . $this->info['dn_id'] . '" LIMIT 1'); - } - } - $rooms = [ - 374 => 372, // ( ) - 189 => 188, // ( ) - 392 => 393, // ( ) - - 398 => 397, // ( ) - 243 => 395, // ( ) - 360 => 242, // ( ) - - 19 => 293 // - ]; - // $n_rm = $rooms[$this->users[$i]['room']]; - mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('UPDATE `users` SET `room` = "321" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `dn_delete` = "1" LIMIT 1000'); - mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `item_id` = "1189" OR `item_id` = "4447" OR `item_id` = "1174") LIMIT 1000'); - if ($this->users[$i]['sex'] == 0) { - $rtxt = '' . $this->users[$i]['login'] . ' ' . $nld; - } else { - $rtxt = '' . $this->users[$i]['login'] . ' ' . $nld; - } - } - if ($rtxt != '') { - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $this->info['dn_id'] . "','" . $this->users[$i]['city'] . "','" . $this->users[$i]['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1','1')"); - } - } - - mysql_query('UPDATE `users` SET `login2` = "" WHERE `battle` = "' . $this->info['id'] . '"'); - $upd = mysql_query('UPDATE `users` SET `login2` = "", `money` = "' . $this->users[$i]['money'] . '", `money2` = "' . $this->users[$i]['money2'] . '",`win` = "' . $this->users[$i]['win'] . '",`lose` = "' . $this->users[$i]['lose'] . '",`nich` = "' . $this->users[$i]['nich'] . '",`battle` = "-1" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - - if ($u->info['id'] == $this->users[$i]['id']) { - $u->info['battle_text'] = $this->users[$i]['battle_text']; - } - - $upd2 = mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$i]['hpNow'] . '",`mpNow` = "' . $this->stats[$i]['mpNow'] . '",`bn_capitalcity` = 0,`bn_demonscity` = 0,`smena` = 3,`tactic7` = "-100",`x`="' . $this->users[$i]['x'] . '",`y`="' . $this->users[$i]['y'] . '",`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",`last_pr`="0",`tactic1`="0",`tactic2`="0",`tactic3`="0",`tactic4`="0",`tactic5`="0",`tactic6`="0.00000000",`tactic7`="10",`exp` = "' . $this->users[$i]['exp'] . '",`battle_exp` = "' . $this->users[$i]['battle_exp'] . '",`battle_text` = "' . $this->users[$i]['battle_text'] . '",`battle_yron` = "0",`enemy` = "0",`last_b`="' . $this->info['id'] . '",`regHP` = "' . time() . '",`regMP` = "' . time() . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - if ($this->info['turnir'] == 0) { - // - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$i]['city'] . "','" . $this->users[$i]['room'] . "','','" . $this->users[$i]['login'] . "','" . $this->users[$i]['battle_text'] . "','-1','6','0')"); - } else { - mysql_query('UPDATE `turnirs` SET `winner` = "' . $this->info['team_win'] . '" WHERE `id` = "' . $this->info['turnir'] . '" LIMIT 1'); - } - // - $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')); - if (isset($a['id'])) { - if ($a['eda'] < 1) { - $u->send('', $this->users[$i]['room'], $this->users[$i]['city'], '', - $this->users[$i]['login'], '' . $a['name'] . ' ...', - time(), 6, 0, 0, 0, 1); - } - } - } - mysql_query('UPDATE `stats` SET `battle_text` = "",`last_b`="0" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('UPDATE `battle_users` SET `finish` = 1 WHERE `uid` = "' . $this->users[$i]['id'] . '"'); - //mysql_query('DELETE FROM `battle_logs` WHERE `battle` = "'.$this->info['id'].'"'); - $this->saveLogs($this->info['id'], 'all'); - if ($u->info['battle'] != 0 && !isset($u->info['battle_lsto'])) { - echo ''; - } - } else { - //echo ' , 0- , !'; - } - } - //unlink($lock_file); - mysql_query('UPDATE `battle` SET `testfinish` = "0" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - } else { - sleep(2); - mysql_query('UPDATE `battle` SET `testfinish` = "0" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - } - mysql_query('UNLOCK TABLES'); - } - - // - //$this->addGlobalItems($this->user[$i]['id'],$this->user[$j]['id'],$mon['win_itm'],$mon['win_eff'],$mon['win_ico'],$mon['win_exp'],$mon['win_money'],$mon['win_money2']); - public $ainm = []; - - public function addGlobalItems($bid, $uid, $itm, $eff, $ico, $exp, $cr, $ecr) - { - global $u; - // - // - if ($bid == 1008) { - // - $jit = 0; - $iit = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `online` > ' . (time() - 120) . '')); - $iit = floor($iit[0] / 20); - $iit = rand(1, $iit); - while ($jit < $iit) { - if (rand(0, 100) < 50) { - $svtk = [ - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1461, - 1462, - 1463, - 4037, - 4038, - 4039, - 4040, - 911, - 1172, - 1173, - 2142, - 2141, - 2143, - 2870, - 2144, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - 1000, - ]; - $svtk = $svtk[rand(0, count($svtk) - 1)]; - if ($svtk == 1000) { - mysql_query('INSERT INTO `items_local` - ( `room` , `time`,`item_id`,`data`,`tr_login`,`colvo` ) VALUES - ( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "' . $svtk . '", - "|nosale=1|srok=259200", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - ),( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "' . $svtk . '", - "|nosale=1|srok=259200", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - ),( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "' . $svtk . '", - "|nosale=1|srok=259200", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - ),( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "' . $svtk . '", - "|nosale=1|srok=259200", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - ),( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "' . $svtk . '", - "|nosale=1|srok=259200", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - ),( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "' . $svtk . '", - "|nosale=1|srok=259200", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - )'); - } - mysql_query('INSERT INTO `items_local` - ( `room` , `time`,`item_id`,`data`,`tr_login`,`colvo` ) VALUES - ( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "' . $svtk . '", - "|nosale=1|srok=259200", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - )'); - } - $jit++; - } - unset($svtk); - } elseif ($bid == 1007) { - //, CAPITAL CITY - $jit = 0; - $iit = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `online` > ' . (time() - 120) . '')); - $iit = floor($iit[0] / 20); - $iit = rand(1, $iit); - while ($jit < $iit) { - if (rand(0, 100) < 50) { - mysql_query('INSERT INTO `items_local` - ( `room` , `time`,`item_id`,`data`,`tr_login`,`colvo` ) VALUES - ( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "4504", - "", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - )'); - } - $jit++; - } - } elseif ($bid == 1006) { - // CAPITAL CITY - if (rand(0, 100) < 10) { - mysql_query('INSERT INTO `items_local` - ( `room` , `time`,`item_id`,`data`,`tr_login`,`colvo` ) VALUES - ( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "4451", - "srok=86400", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - )'); - } - } elseif ($bid == 1000) { - // CAPITAL CITY - //if( rand(0,100) < 10 ) { - mysql_query('INSERT INTO `items_local` - ( `room` , `time`,`item_id`,`data`,`tr_login`,`colvo` ) VALUES - ( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "4460", - "srok=2592000", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - )'); - //} - } elseif ($bid == 1001) { - // CAPITAL CITY - //if( rand(0,100) < 10 ) { - mysql_query('INSERT INTO `items_local` - ( `room` , `time`,`item_id`,`data`,`tr_login`,`colvo` ) VALUES - ( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "4461", - "srok=2592000", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - )'); - //} - } elseif ($bid == 1002) { - // CAPITAL CITY - //if( rand(0,100) < 10 ) { - mysql_query('INSERT INTO `items_local` - ( `room` , `time`,`item_id`,`data`,`tr_login`,`colvo` ) VALUES - ( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "4462", - "srok=2592000", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - )'); - //} - } elseif ($bid == 1003) { - // CAPITAL CITY - //if( rand(0,100) < 10 ) { - mysql_query('INSERT INTO `items_local` - ( `room` , `time`,`item_id`,`data`,`tr_login`,`colvo` ) VALUES - ( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "4463", - "srok=2592000", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - )'); - //} - } elseif ($bid == 1004) { - // CAPITAL CITY - //if( rand(0,100) < 10 ) { - mysql_query('INSERT INTO `items_local` - ( `room` , `time`,`item_id`,`data`,`tr_login`,`colvo` ) VALUES - ( - "' . $this->users[$this->uids[$uid]]['room'] . '", - "' . time() . '", - "4459", - "srok=2592000", - "' . $this->users[$this->uids[$uid]]['login'] . '", - "1" - )'); - //} - } - // - if ($exp >= 0) { - $this->users[$this->uids[$uid]]['battle_exp'] += round($exp * $this->users[$this->uids[$uid]]['battle_yron'] / $this->stats[$this->uids[$bid]]['hpAll']); - mysql_query('UPDATE `stats` SET `battle_exp` = "' . mysql_real_escape_string($this->users[$this->uids[$uid]]['battle_exp']) . '" WHERE `id` = "' . mysql_real_escape_string($uid) . '" LIMIT 1'); - } - // - if ($cr != '' && $cr > 0) { - if ($this->stats[$this->uids[$uid]]['hpNow'] > 0) { - mysql_query('UPDATE `users` SET `money` = (`money` + ' . mysql_real_escape_string($cr) . ') WHERE `id` = "' . mysql_real_escape_string($uid) . '" LIMIT 1'); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' : " . mysql_real_escape_string($cr) . " .','-1','6','0')"); - } - } - // - if ($ecr != '' && $ecr > 0) { - if ($this->stats[$this->uids[$uid]]['hpNow'] > 0) { - $this->users[$this->uids[$uid]]['money2'] += $ecr; - //$sleptime=rand(1,20); - //usleep($sleptime*100000); - $resulttp = mysql_query('UPDATE `users` SET `money2` = (`money2` + ' . mysql_real_escape_string($ecr) . ') WHERE `id` = "' . $this->users[$this->uids[$uid]]['id'] . '" LIMIT 1'); - if (!$resulttp) { - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' !!!','-1','6','0')"); - $u->addDelo(4, $this->users[$this->uids[$uid]]['id'], - '"System.battle": ( ), !!! ', time(), - $this->users[$this->uids[$uid]]['city'], 'System.battle', 0, 0); - } else { - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' -: " . mysql_real_escape_string($ecr) . " .','-1','6','0')"); - $u->addDelo(4, $this->users[$this->uids[$uid]]['id'], - '"System.battle": ' . $ecr . ' ( ), : ' . $this->users[$this->uids[$uid]]['money2'] . ' ', - time(), $this->users[$this->uids[$uid]]['city'], 'System.battle', 0, 0); - } - } - } - // - if ($ico != '') { - /* - 0(, 1 - , 2 - )@ - 1( )@ - 2( )@ - 3()@ - 4( 0 1, -1)@ - 5( % 0.001)@ - 6( : add_s1=5|add_hpAll=50)@ - 7( , )@ - 8( 0 1)@ - 9( 0 or 1) - */ - $i = 0; - $txt = ''; - $ico = explode('#', $ico); - while ($i < count($ico)) { - $ico_e = explode('@', $ico[$i]); - if (isset($ico_e[3])) { - // - $add = 1; - if ($ico_e[4] == 1 && floor($this->stats[$this->uids[$uid]]['hpNow']) < 1) { - $add = 0; - } - if ($add == 1) { - $ins = false; - if ($ico_e[8] == 0) { - $ins = true; - if ($ico_e[9] == 1) { - mysql_query('DELETE FROM `users_ico` WHERE `uid` = "' . mysql_real_escape_string($uid) . '" AND `img` = "' . mysql_real_escape_string($ico_e[2]) . '"'); - } - } else { - $old_ico = mysql_fetch_array(mysql_query('SELECT `id` FROM `users_ico` WHERE `uid` = "' . mysql_real_escape_string($uid) . '" AND (`endTime` > "' . time() . '" OR `endTime` = 0) AND `img` = "' . mysql_real_escape_string($ico_e[2]) . '" LIMIT 1')); - if (!isset($old_ico['id'])) { - $ins = true; - } else { - if ($old_ico['id'] > 0) { - $txt .= ', "' . $ico_e[3] . ' ()"'; - mysql_query('UPDATE `users_ico` SET `x` = `x` + 1,`endTime` = "' . mysql_real_escape_string(time() + $ico_e[1] * 60) . '" WHERE `id` = "' . $old_ico['id'] . '" LIMIT 1'); - } else { - $ins = true; - } - } - unset($old_ico); - } - if ($ins == true) { - if ($ico_e[9] == 1) { - mysql_query('DELETE FROM `users_ico` WHERE `uid` = "' . mysql_real_escape_string($uid) . '" AND `img` = "' . mysql_real_escape_string($ico_e[2]) . '"'); - } - mysql_query('INSERT INTO `users_ico` (`uid`,`time`,`text`,`img`,`endTime`,`type`,`bonus`) VALUES ( - "' . mysql_real_escape_string($uid) . '", - "' . time() . '", - "' . mysql_real_escape_string($ico_e[3]) . '", - "' . mysql_real_escape_string($ico_e[2]) . '", - "' . mysql_real_escape_string(time() + $ico_e[1] * 60) . '", - "' . mysql_real_escape_string($ico_e[0]) . '", - "' . mysql_real_escape_string($ico_e[6]) . '" - )'); - $txt .= ', "' . $ico_e[3] . '"'; - } - } - // - } - $i++; - } - if ($txt != '') { - $txt = ltrim($txt, ', '); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' : " . mysql_real_escape_string($txt) . "','-1','6','0')"); - } - } - // - if ($itm != '') { - $i = 0; - $txt = ''; - $itm = explode(',', $itm); - while ($i < count($itm)) { - $itm_e = explode('@', $itm[$i]); - if ($itm_e[0] > 0) { - $j = 0; - while ($j < $itm_e[1]) { - $u->addItem($itm_e[0], $uid, '|' . $itm_e[2]); - $j++; - } - if (!isset($this->ainm[$itm_e[0]])) { - $this->ainm[$itm_e[0]] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($itm_e[0]) . '" LIMIT 1')); - } - if (isset($this->ainm[$itm_e[0]]['id'])) { - // - $txt .= ', ' . $this->ainm[$itm_e[0]]['name'] . ''; - if ($itm_e[1] > 1) { - $txt .= ' (x' . $itm_e[1] . ')'; - } - } - } - $i++; - } - if ($txt != '') { - $txt = ltrim($txt, ', '); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' : " . mysql_real_escape_string($txt) . "','-1','6','0')"); - } - } - // - } - - // - public function addNewAtack() - { - 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; - - while ($i <= $us['zona']) { - if ($this->uAtc['a'][$i] == 0) { - $no = 1; - } - $i++; - } - - - if ($this->uAtc['b'] == 0) { - $no = 1; - } - - - if ($no == 0) { - // - if ($u->info['enemy'] > 0) { - if (!isset($this->ga[$u->info['enemy']][$u->info['id']])) { - if ($this->stats[$this->uids[$u->info['id']]]['hpNow'] >= 1 && $this->stats[$this->uids[$u->info['enemy']]]['hpNow'] >= 1) { - // - $a = $this->uAtc['a'][1] . '' . $this->uAtc['a'][2] . '' . $this->uAtc['a'][3] . '' . $this->uAtc['a'][4] . '' . $this->uAtc['a'][5]; - $b = $this->uAtc['b']; - mysql_query('DELETE FROM `battle_act` WHERE `battle` = "' . $this->info['id'] . '" AND ((`uid2` = "' . $u->info['id'] . '" AND `uid1` = "' . $u->info['enemy'] . '") OR (`uid1` = "' . $u->info['id'] . '" AND `uid2` = "' . $u->info['enemy'] . '")) LIMIT 2'); - $d = mysql_query('INSERT INTO `battle_act` (`battle`,`time`,`uid1`,`uid2`,`a1`,`b1`) VALUES ("' . $this->info['id'] . '","' . time() . '","' . $u->info['id'] . '","' . $u->info['enemy'] . '","' . $a . '","' . $b . '")'); - if (!$d) { - $this->e = ' ...'; - } else { - $this->ga[$u->info['id']][$u->info['enemy']] = mysql_insert_id(); - } - } - } else { - // - if ($this->stats[$this->uids[$u->info['id']]]['hpNow'] >= 1 && $this->stats[$this->uids[$u->info['enemy']]]['hpNow'] >= 1) { - if (isset($this->atacks[$this->ga[$u->info['enemy']][$u->info['id']]]['id'])) { - $this->atacks[$this->ga[$u->info['enemy']][$u->info['id']]]['a2'] = $this->uAtc['a'][1] . '' . $this->uAtc['a'][2] . '' . $this->uAtc['a'][3] . '' . $this->uAtc['a'][4] . '' . $this->uAtc['a'][5]; - $this->atacks[$this->ga[$u->info['enemy']][$u->info['id']]]['b2'] = $this->uAtc['b']; - $this->startAtack($this->atacks[$this->ga[$u->info['enemy']][$u->info['id']]]['id']); - } - } - } - } else { - // ( ) - - } - } else { - $this->e = ' '; - } - } else { - $this->e = ' , ...'; - } - } else { - // , - - } - } - - // , - - public function magicItems($uid1, $uid2, $end) - { - global $u, $priem, $c, $code; - if (isset($this->stats[$this->uids[$uid1]])) { - $i = 0; - while ($i < count($this->stats[$this->uids[$uid1]]['items'])) { - $itm = $this->stats[$this->uids[$uid1]]['items'][$i]; - if (isset($itm['id'])) { - $e = $u->lookStats($itm['data']); - if (isset($e['bm_a1'])) { - if ($end > 0) { - if (file_exists('../../_incl_data/class/priems/' . $e['bm_a1'] . '.end.php')) { - require('../../_incl_data/class/priems/' . $e['bm_a1'] . '.end.php'); - } - } else { - if (file_exists('../../_incl_data/class/priems/' . $e['bm_a1'] . '.php')) { - require('../../_incl_data/class/priems/' . $e['bm_a1'] . '.php'); - } - } - } - } - $i++; - } - unset($itm); - } - } - - // - public function testPog($uid, $yr) - { - //$yr = round($yr*1.25); - $yr2 = $yr; - if ($yr > 0) { - $testmana = false; - global $u, $priem; - $i = 0; - $ypg22 = 0; - while ($i < count($this->stats[$this->uids[$uid]]['set_pog2'])) { - $j = $this->stats[$this->uids[$uid]]['set_pog2'][$i]; - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'] = str_replace('add_pog2=' . $j['y'], - 'add_pog2=$', $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - $dt3 = $u->lookStats($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - if (isset($dt3['add_pog2mp'])) { - $priem->minMana($uid, round(round($yr2 / 100 * (100 - $dt3['add_pog2p'])) * $dt3['add_pog2mp'])); - } - $j['y'] -= $yr2; // - if (isset($dt3['add_pog2p'])) { - $yr2 = round($yr2 / 100 * (100 - $dt3['add_pog2p'])); - //echo '[: '.($dt3['add_pog2p']).'% '.(round(round($yr2/100*(100-$dt3['add_pog2p']))*$dt3['add_pog2mp'])).'MP]'; - } - unset($dt3); - if ($j['y'] < 0 || ($this->stats[$this->uids[$uid]]['mpNow'] <= 0 && $dt3['add_pog2mp'] > 0)) { - $dt2 = $u->lookStats($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - if (isset($dt2['endPog']) && $dt2['endPog'] == 1) { - // - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['v2'] . '" LIMIT 1')); - $this->delPriem($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1], - $this->users[$this->uids[$uid]], 4, $uid); - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1] = 'delete'; - } - unset($dt2); - $yr2 = -($j['y']); - $j['y'] = 0; - } - - $this->stats[$this->uids[$uid]]['set_pog'][$i]['y'] = $j['y']; - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'] = str_replace('add_pog2=$', - 'add_pog2=' . $j['y'], $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - $upd = mysql_query('UPDATE `eff_users` SET `data` = "' . $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'] . '" WHERE `id` = "' . $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['id'] . '" LIMIT 1'); - if ($upd) { - } - $i++; - } - } - return $yr2; - } - - public $rehodeff = []; - - // - public $poglast = []; - - public function testPogB($uid, $yr, $pliid, $test = 0) - { - //$yr = round($yr*1.25); - $yr2 = $yr; - $checktuman = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $uid . '" - AND (`v2` = 273 OR `v2` = 286 OR `v2` = 287 OR `v2` = 288) - AND `delete` =0 LIMIT 1')); // - //if ( !isset($checktuman['id'])) - if ($yr > 0 && !isset($checktuman['id'])) { - $testmana = false; - global $u, $priem; - $i = 0; - $ypg22 = 0; - while ($i < count($this->stats[$this->uids[$uid]]['set_pog2'])) { - $j = $this->stats[$this->uids[$uid]]['set_pog2'][$i]; - if ($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['id'] == $pliid || $test == 1) { - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'] = str_replace('add_pog2=' . $j['y'], - 'add_pog2=$', $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - $dt3 = $u->lookStats($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - // - $dt30 = 0; - $dt30 = floor($j['y'] / $yr2 * 100); - // - //echo '['.$j['y'].'|'.$dt3['add_pog2'].'|'.$yr2.' -> '.$dt30.'/'.$dt3['add_pog2p'].'] '; - // - if ($dt30 < $dt3['add_pog2p']) { - $dt3['add_pog2p'] = $dt30; - } - // - unset($dt30); - // - if (isset($dt3['add_pog2mp'])) { - if ((round(round($yr2 / 100 * (100 - $dt3['add_pog2p'])) * $dt3['add_pog2mp'])) > $this->stats[$this->uids[$uid]]['mpNow']) { - // , % - $j['yhj'] = $this->stats[$this->uids[$uid]]['mpNow'] / (round(round($yr2 / 100 * (100 - $dt3['add_pog2p'])) * $dt3['add_pog2mp'])) * 100; - $j['yhj'] = floor($j['yhj']); // % - $dt3['add_pog2p'] = floor($dt3['add_pog2p'] / 100 * $j['yhj']); - //echo '[!]'; - } - if ($test == 1) { - $priem->minMana($uid, round(round($yr2 / 100 * $dt3['add_pog2p']) * $dt3['add_pog2mp'])); - } - } - if (!isset($this->poglast[$uid])) { - $this->poglast[$uid] = 0; - } - $this->poglast[$uid] += $yr2; - if ($test == 1) { - //$j['y'] -= $this->poglast[$uid]; // - $j['y'] -= round($this->poglast[$uid] / 100 * $dt3['add_pog2p']); - $priem->minMana($uid, - round(round($this->poglast[$uid] / 100 * $dt3['add_pog2p']) * $dt3['add_pog2mp'])); - } - if (isset($dt3['add_pog2p'])) { - $yr2 = round($yr2 / 100 * (100 - $dt3['add_pog2p'])); - //echo '[: '.($dt3['add_pog2p']).'% ( '.$yr2/100*$dt3['add_pog2p'].' '.$yr2.' . ) '.(round(round($yr2/100*(100-$dt3['add_pog2p']))*$dt3['add_pog2mp'])).'MP , : '.$this->stats[$this->uids[$uid]]['mpNow'].']'; - } - //unset($dt3); - if ($j['y'] < 0 || ($this->stats[$this->uids[$uid]]['mpNow'] <= 0 && $dt3['add_pog2mp'] > 0)) { - $dt2 = $u->lookStats($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - if (isset($dt2['endPog']) && $dt2['endPog'] == 1) { - // - // - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['v2'] . '" LIMIT 1')); - $this->delPriem($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1], - $this->users[$this->uids[$uid]], 4, $uid); - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1] = 'delete'; - } - unset($dt2); - //$yr2 += -($j['y']); - $j['y'] = 0; - } - $this->stats[$this->uids[$uid]]['set_pog'][$i]['y'] = $j['y']; - if (isset($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'])) { - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'] = str_replace('add_pog2=$', - 'add_pog2=' . $j['y'], $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - //echo '['.$j['id'].'!'.$this->stats[$this->uids[$uid]]['effects'][$j['id']-1]['id'].']'; - $upd = mysql_query('UPDATE `eff_users` SET `data` = "' . $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'] . '" WHERE `id` = "' . $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['id'] . '" LIMIT 1'); - } - if ($upd) { - //echo '['.$j['y'].'->'.$yr2.']'; - //echo $this->stats[$this->uids[$uid]]['effects'][$j['id']-1]['data']; - } - if ($j['y'] - $this->poglast[$uid] + $yr2 < 0) { - //echo '['.$yr.']'; - $yr -= $yr + ($j['y'] - $this->poglast[$uid] + $yr2); - //echo '['.$this->poglast[$uid].','.$yr2.','.$j['y'].']'; - $yr2 = $yr; - $i = count($this->stats[$this->uids[$uid]]['set_pog2']) + 1; - } - } - $i++; - } - } - unset($checktuman); - return $yr2; - } - - - // - public function testHowRazmen($id) - { - $r = [ - 1 => 0, - 2 => 0, - ]; - if (isset($this->atacks[$id])) { - if ($this->atacks[$id]['out1'] > 0 && $this->atacks[$id]['out2'] > 0) { - // 1 - if ($this->atacks[$id]['out1'] == 100) { - // - $r[1] = -2; - } else { - // - $r[1] = -1; - } - // 2 - if ($this->atacks[$id]['out2'] == 100) { - // - $r[2] = -2; - } else { - // - $r[2] = -1; - } - } elseif ($this->atacks[$id]['out1'] > 0) { - // 1 - if ($this->atacks[$id]['out1'] == 100) { - // - $r[1] = -2; - } else { - // - $r[1] = -1; - } - // 2 - $r[2] = 1; - } elseif ($this->atacks[$id]['out2'] > 0) { - // 2 - if ($this->atacks[$id]['out2'] == 100) { - // - $r[2] = -2; - } else { - // - $r[2] = -1; - } - // 1 - $r[1] = 1; - } else { - // 1 2 , 2 1 - $r[1] = 1; - $r[2] = 1; - } - } - return $r; - } - - // . - public function newRazmen($id, $at = null) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - 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]; - } - - return $at; - } - - //1 2 - public function usersTestAtack($id, $uid1, $uid2) - { - $r = []; - $block = [ - 0, - 0, - 0, - 0, - 0, - 0, - ]; - - // - $i = 1; - if ($uid1 == $this->atacks[$id]['uid1']) { - $a = 2; - $j = $this->atacks[$id]['b2']; - $atack = [ - 0, - $this->atacks[$id]['a1'][0], - $this->atacks[$id]['a1'][1], - $this->atacks[$id]['a1'][2], - $this->atacks[$id]['a1'][3], - $this->atacks[$id]['a1'][4], - ]; - } elseif ($uid2 == $this->atacks[$id]['uid1']) { - $a = 1; - $j = $this->atacks[$id]['b1']; - $atack = [ - 0, - $this->atacks[$id]['a2'][0], - $this->atacks[$id]['a2'][1], - $this->atacks[$id]['a2'][2], - $this->atacks[$id]['a2'][3], - $this->atacks[$id]['a2'][4], - ]; - } - if ($this->atacks[$id]['out' . $a] == 0) { - while ($i <= $this->stats[$this->uids[$uid2]]['zonb']) { - //echo '{'.$j.'}'; - $block[$j] = 1; - $j++; - if ($j > 5 || $j < 1) { - $j = 1; - } - $i++; - } - } - // - $i = 1; - while ($i <= $this->stats[$this->uids[$uid1]]['zona']) { - if (!isset($atack[$i]) || $atack[$i] == 0) { - $atack[$i] = rand(1, 5); - } - if ($atack[$i] > 0) { - if ($block[$atack[$i]] == 1) { - // - // , - $r['atack'][] = [$atack[$i], 3, 0]; - } else { - // - // , - $r['atack'][] = [$atack[$i], 1, 0]; - } - } - $i++; - } - return $r; - } - - // - public function testRazmenblock1($id, $uid1, $uid2, $atack) - { - $r = false; - // - $i = 1; - if ($uid1 == $this->atacks[$id]['uid1']) { - $j = $this->atacks[$id]['b2']; - } elseif ($uid2 == $this->atacks[$id]['uid1']) { - $j = $this->atacks[$id]['b1']; - } - if ($this->atacks[$id]['out2'] == 0) { - while ($i <= $this->stats[$this->uids[$uid2]]['zonb']) { - //echo '{'.$j.'}'; - $block[$j] = 1; - $j++; - if ($j > 5 || $j < 1) { - $j = 1; - } - $i++; - } - } - // - if ($atack > 0) { - if ($block[$atack] == 1) { - // - // , - $r = true; - } else { - // - // , - $r = false; - } - } - return $r; - } - - // . () - public function firstRazmen($id, $at) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - // - - - $i++; - } - - return $at; - } - - // - public function yhod_user($uid1, $uid2, $type) - { - // 1 - . 2 - . - // - if ($this->import_user == 0) { - $r = $uid1; - $rand_user = false; - if ($type == 2) { - // ( ) - $i = 0; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] == $this->users[$this->uids[$uid2]]['team']) { - $rand_user[] = $this->users[$i]['id']; - } - $i++; - } - } elseif ($type == 4) { - // , - $i = 0; - while ($i < count($this->users)) { - //if( $this->users[$i]['team'] == $this->users[$this->uids[$uid1]]['team'] ) { - $rand_user[] = $this->users[$i]['id']; - //} - $i++; - } - } elseif ($type == 5) { - // , ( ) - $i = 0; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] == $this->users[$this->uids[$uid2]]['team'] && $uid2 != $this->users[$i]['id']) { - $rand_user[] = $this->users[$i]['id']; - } - $i++; - } - } elseif ($type == 6) { - // - $i = 0; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] != $this->users[$this->uids[$uid2]]['team']) { - $rand_user[] = $this->users[$i]['id']; - } - $i++; - } - } elseif ($type > 100) { - // - if (!isset($this->users[$this->uids[$type]]) || $this->users[$this->uids[$type]]['id'] != $type) { - $r = $uid2; - } else { - $r = $type; - } - } - if ($rand_user != false && count($rand_user) > 0) { - $r = $rand_user[rand(0, (count($rand_user) - 1))]; - } - $this->import_user = $r; - } else { - $r = $this->import_user; - } - return $r; - } - - // - public function mf1Razmen($id, $at, $v, $pat = false, $rjd = 0) - { - global $u; - - if ($pat == true) { - $pat = $at; - $at = $pat['p']; - } else { - unset($pat); - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - // (u2) (u1) - //print_r( $at[$i] ); - $j = 0; - $wp01 = 3; - $k01 = 0; - if ($rjd > 0) { - $j = $rjd - 1; - } - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ($k01 == 0 && isset($this->stats[$this->uids[$u1]]['wp3id'])) { - // - $wp01 = 3; - $k01 = 1; - } else { - // - if (isset($this->stats[$this->uids[$u1]]['wp14id']) && $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp14id']]['type'] != 13) { - $wp01 = 14; - } else { - if (isset($this->stats[$this->uids[$u1]]['wp3id'])) { - $wp01 = 3; - } else { - // - - $wp01 = 3; - } - } - $k01 = 0; - } - $witm01 = 0; - $witm_type01 = 0; - if ($wp01 > 0) { - $witm01 = $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp' . $wp01 . 'id']]; - $witm_data01 = $u->lookStats($witm01['data']); - //$r['wt'] = $witm['type']; - } - // - if ($at[$a]['atack'][$j][2] == $v) { - //if( $wp01 > 0 && $witm01['type'] == 20 ) { - // $tyv = $this->mfs( 2 , array( 'mf' => $this->stats[$this->uids[$u2]]['m4']*1.25 , 'amf' => $this->stats[$this->uids[$u1]]['m5'] + $witm_data01['sv_m5'] ) ); - //}else{ - $tyv = $this->mfs(2, [ - 'u1' => $u1, - 'u2' => $u2, - 'mf' => $this->stats[$this->uids[$u2]]['m4'], - 'amf' => (int)$this->stats[$this->uids[$u2]]['m15'], - 'smf' => ($this->stats[$this->uids[$u1]]['m5'] + $witm_data01['sv_m5']), - 'asmf' => $this->stats[$this->uids[$u1]]['m21'], - ], $this->users[$this->uids[$u1]]['level'], $this->users[$this->uids[$u2]]['level']); - //} - if ($tyv == 1 && $this->atacks[$id]['out' . $b] == 0) { - //, :) - $this->stats[$this->uids[$u1]]['nopryh'] = floor(0 + (int)$this->stats[$this->uids[$u1]]['nopryh']); - if (!isset($this->stats[$this->uids[$u1]]['nopryh']) || $this->stats[$this->uids[$u1]]['nopryh'] <= 0) { - $at[$a]['atack'][$j][1] = 2; - } else { - $this->stats[$this->uids[$u1]]['nopryh']--; - $this->stats[$this->uids[$u1]]['nopryh_act']++; - } - } - } - $j++; - } - - $i++; - } - unset($witm01, $witm_type01, $wp01, $k01); - - if (isset($pat) && $pat != false) { - $pat['p'] = $at; - $at = $pat; - } - - return $at; - } - - // - public function mf2Razmen($id, $at, $v, $pat = false, $rjd = 0) - { - global $u; - - if ($pat == true) { - $pat = $at; - $at = $pat['p']; - } else { - unset($pat); - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - // (u1) (u2) - //print_r( $at[$i] ); - $j = 0; - $wp01 = 0; - $k01 = 0; - if ($rjd > 0) { - $j = $rjd - 1; - } - while ($j < count($at[$a]['atack']) && $j <= 8) { - // , - if ($k01 == 0 && isset($this->stats[$this->uids[$u1]]['wp3id'])) { - // - $wp01 = 3; - $k01 = 1; - } else { - // - if (isset($this->stats[$this->uids[$u1]]['wp14id']) && $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp14id']]['type'] != 13) { - $wp01 = 14; - } else { - if (isset($this->stats[$this->uids[$u1]]['wp3id'])) { - $wp01 = 3; - } else { - // - $wp01 = 3; - } - } - $k01 = 0; - } - $witm01 = 0; - $witm_type01 = 0; - if ($wp01 > 0) { - $witm01 = $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp' . $wp01 . 'id']]; - $witm_data01 = $u->lookStats($witm01['data']); - //$r['wt'] = $witm['type']; - } - // - //if( $at[$a]['atack'][$j][2] == $v ) { - if ($this->mfs(1, [ - 'u1' => $u1, - 'u2' => $u2, - 'mf' => $this->stats[$this->uids[$u1]]['m1'] + $witm_data01['sv_m1'], - 'amf' => $this->stats[$this->uids[$u1]]['m14'], - 'smf' => $this->stats[$this->uids[$u2]]['m2'], - 'aamf1' => (int)$this->stats[$this->uids[$u2]]['enemy_am1'], - ], $this->users[$this->uids[$u1]]['level'], $this->users[$this->uids[$u2]]['level']) == 1) { - //, :) - if ($at[$a]['atack'][$j][1] == 3) { - // - $at[$a]['atack'][$j][1] = 4; // - } elseif ($at[$a]['atack'][$j][1] != 2 && $at[$a]['atack'][$j][1] != 6 && $at[$a]['atack'][$j][1] != 7 && $at[$a]['atack'][$j][1] != 8) { - // - $at[$a]['atack'][$j][1] = 5; - } else { - $at[$a]['atack'][$j][1] = 1; - } - } - //} - $j++; - } - - $i++; - } - unset($witm01, $witm_type01, $k01, $wp01); - - if (isset($pat) && $pat != false) { - $pat['p'] = $at; - $at = $pat; - } - - return $at; - } - - // - public function mf3Razmen($id, $at, $v, $pat = false, $rjd = 0) - { - if ($pat == true) { - $pat = $at; - $at = $pat['p']; - } else { - unset($pat); - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - // (u2) (u1) - //print_r( $at[$i] ); - $j = 0; - if ($rjd > 0) { - $j = $rjd - 1; - } - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ((!isset($this->stats[$this->uids[$u2]]['no_pr1']) || $this->stats[$this->uids[$u2]]['no_pr1'] == 0) && $at[$a]['atack'][$j][2] == $v) { - if ($this->mfs(3, [ - 'u1' => $u1, - 'u2' => $u2, - '1' => $this->stats[$this->uids[$u2]]['m7'], - '2' => $this->stats[$this->uids[$u1]]['m7'], - ], $this->users[$this->uids[$u1]]['level'], - $this->users[$this->uids[$u2]]['level']) == 1 && $this->atacks[$id]['out' . $b] == 0) { - //, :) - $this->stats[$this->uids[$u1]]['nopryh'] = floor(0 + (int)$this->stats[$this->uids[$u1]]['nopryh']); - if ((!isset($this->stats[$this->uids[$u1]]['nopryh']) || $this->stats[$this->uids[$u1]]['nopryh'] == 0) && $this->stats[$this->uids[$u1]]['nopryh_act'] < 1) { - $at[$a]['atack'][$j][1] = 6; - $this->stats[$this->uids[$u1]]['nopryh']--; - $this->stats[$this->uids[$u1]]['nopryh_act']++; - } - } - } - $j++; - } - - $i++; - } - - if (isset($pat) && $pat != false) { - $pat['p'] = $at; - $at = $pat; - } - - return $at; - } - - // - public function mf4Razmen($id, $at, $v, $pat = false, $rjd = 0) - { - if ($pat == true) { - $pat = $at; - $at = $pat['p']; - } else { - unset($pat); - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - if ($this->stats[$this->uids[$u2]]['sheld1'] > 0) { - // (u2) (u1) - //print_r( $at[$i] ); - $j = 0; - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ($at[$a]['atack'][$j][2] == $v) { - if ($this->mfs(5, - ($this->stats[$this->uids[$u2]]['m8'] / 2 + $this->stats[$this->uids[$u2]]['m18']), - $this->users[$this->uids[$u1]]['level'], - $this->users[$this->uids[$u2]]['level']) == 1 && $this->atacks[$id]['out' . $b] == 0) { - // , :) - /*if( !isset($this->stats[$this->uids[$u1]]['nopryh']) || $this->stats[$this->uids[$u1]]['nopryh'] == 0 ) {*/ - $at[$a]['atack'][$j][1] = 7; - // $this->stats[$this->uids[$u1]]['nopryh']--; - // $this->stats[$this->uids[$u1]]['nopryh_act']++; - // } - } - } - $j++; - } - } - $i++; - } - - if (isset($pat) && $pat != false) { - $pat['p'] = $at; - $at = $pat; - } - - return $at; - } - - // - public function mf5Razmen($id, $at, $v, $rjd = 0) - { - global $u; - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - // (u2) (u1) - //print_r( $at[$i] ); - $j = 0; - if ($rjd > 0) { - $j = $rjd - 1; - } - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ($at[$a]['atack'][$j][2] == $v) { - if ($at[$a]['atack'][$j][1] == 2) { - if ($this->mfs(6, [ - 'u1' => $u1, - 'u2' => $u2, - 'a' => $this->stats[$this->uids[$u2]]['m6'], - 'b' => $this->stats[$this->uids[$u1]]['m6'], - ], $this->users[$this->uids[$u1]]['level'], $this->users[$this->uids[$u2]]['level']) == 1) { - //, :) - $at[$a]['atack'][$j][1] = 8; - $rnd_a = rand(1, 5); - $rjd = count($at[$b]['atack']); - if ($this->testRazmenblock1($id, $u2, $u1, $rnd_a) == false) { - $at[$b]['atack'][] = [$rnd_a, 1, 0, 1]; // 3 , 0 , 1 - //$at[$b]['atack'][] = $at[$b]['atack'][(count($at[$b]['atack'])-1)]; // 3 , 0 , 1 - } else { - $at[$b]['atack'][] = [$rnd_a, 3, 0, 1]; // 3 , 0 , 1 - //$at[$b]['atack'][] = $at[$b]['atack'][(count($at[$b]['atack'])-1)]; // 3 , 0 , 1 - } - $at = $this->contrRestart($id, $at, 1, $rjd); - } - } - } - $j++; - } - - $i++; - } - - return $at; - } - - // ( ) - public function seeRazmen($id, $at) - { - $r = ''; - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - if (!isset($at[$a]['atack'])) { - $r .= 'u1 '; - } else { - $j = 0; - while ($j < count($at[$a]['atack']) && $j < 8) { - if ($at[$a]['atack'][$j][1] == 1) { - //u1 u2 - $r .= 'u1 u2'; - } elseif ($at[$a]['atack'][$j][1] == 2) { - //u2 u1 - $r .= 'u2 u1'; - } elseif ($at[$a]['atack'][$j][1] == 3) { - //u2 u1 - $r .= 'u2 u1'; - } elseif ($at[$a]['atack'][$j][1] == 4) { - //u1 u2 - $r .= 'u1 u2 '; - } elseif ($at[$a]['atack'][$j][1] == 5) { - //u1 u2 - $r .= 'u1 u2'; - } elseif ($at[$a]['atack'][$j][1] == 6) { - //u2 u1 - $r .= 'u2 u1'; - } elseif ($at[$a]['atack'][$j][1] == 7) { - //u2 u1 - $r .= 'u2 u1'; - } elseif ($at[$a]['atack'][$j][1] == 8) { - //u2 u1 - $r .= 'u2 u1 '; - } - if ($at[$a]['atack'][$j][3] == 1) { - $r .= ' ()'; - } - if (isset($at[$a]['atack'][$j]['yron'])) { - $r .= ' ' . $at[$a]['atack'][$j]['yron']['r'] . ''; - if ($at[$a]['atack'][$j]['yron']['w'] == 3) { - $r .= ' ( )'; - } elseif ($at[$a]['atack'][$j]['yron']['w'] == 14) { - $r .= ' ( )'; - } - } - if (isset($at[$a]['atack'][$j]['yron']['hp'])) { - $r .= ' [' . floor($at[$a]['atack'][$j]['yron']['hp']) . '/' . floor($at[$a]['atack'][$j]['yron']['hpAll']) . ']'; - } - $r .= ',
'; - $j++; - } - } - - $r = str_replace('u1', '' . $this->users[$this->uids[$u1]]['login'] . '', $r); - $r = str_replace('u2', '' . $this->users[$this->uids[$u2]]['login'] . '', $r); - - $r .= '|
'; - $i++; - } - - return $r; - } - - // - public function addlt($a, $id, $s, $rnd) - { - global $log_text; - if ($rnd == null) { - $rnd = rand(0, (count($log_text[$s][$id]) - 1)); - } - return '{' . $a . 'x' . $id . 'x' . $rnd . '}'; - } - - // - public function addNewStat($stat) - { - if (isset($stat[1])) { - mysql_query('INSERT INTO `battle_stat` - ( `battle`,`uid1`,`uid2`,`time`,`type`,`a`,`b`,`ma`,`mb`,`type_a`,`type_b`,`yrn`,`yrn_krit`,`tm1`,`tm2` ) VALUES ( - "' . $this->info['id'] . '", - "' . $stat[1]['uid1'] . '", - "' . $stat[1]['uid2'] . '", - "' . $stat[1]['time'] . '", - "' . $stat[1]['type'] . '", - "' . $stat[1]['a'] . '", - "' . $stat[1]['b'] . '", - "' . $stat[1]['ma'] . '", - "' . $stat[1]['mb'] . '", - "' . $stat[1]['type_a'] . '", - "' . $stat[1]['type_b'] . '", - "' . $stat[1]['yrn'] . '", - "' . $stat[1]['yrn_krit'] . '", - "' . $stat[1]['tm1'] . '", - "' . $stat[1]['tm2'] . '" - )'); - } - if (isset($stat[2])) { - mysql_query('INSERT INTO `battle_stat` - ( `battle`,`uid1`,`uid2`,`time`,`type`,`a`,`b`,`ma`,`mb`,`type_a`,`type_b`,`yrn`,`yrn_krit`,`tm1`,`tm2` ) VALUES ( - "' . $this->info['id'] . '", - "' . $stat[2]['uid1'] . '", - "' . $stat[2]['uid2'] . '", - "' . $stat[2]['time'] . '", - "' . $stat[2]['type'] . '", - "' . $stat[2]['a'] . '", - "' . $stat[2]['b'] . '", - "' . $stat[1]['ma'] . '", - "' . $stat[2]['mb'] . '", - "' . $stat[2]['type_a'] . '", - "' . $stat[2]['type_b'] . '", - "' . $stat[2]['yrn'] . '", - "' . $stat[2]['yrn_krit'] . '", - "' . $stat[2]['tm1'] . '", - "' . $stat[2]['tm2'] . '" - )'); - } - } - - public $prlog = []; - - // - public function asr($u1, $u2, $type) - { - mysql_query('INSERT INTO `battle_static` ( - `uid1`,`uid2`,`hod`,`type`,`time`,`bid` - ) VALUES ( - "' . $u1 . '","' . $u2 . '","' . $this->hodID . '","' . $type . '","' . time() . '","' . $this->info['id'] . '" - )'); - } - - // - public function addlogRazmen($id, $at) - { - global $u; - - $r = ''; - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $this->hodID++; - - $dies = [ - 1 => 0, - 2 => 0, - ]; - - // - $stat = [ - 1 => [ - 'uid1' => 0, - 'uid2' => 0, - 'time' => time(), - 'type' => 0, - 'a' => '00000', - 'b' => '0', - 'type_a' => '', - 'type_b' => '0', - 'yrn' => 0, - 'yrn_krit' => 0, - 'ma' => 0, - 'mb' => 0, - 'tm1' => 0, - 'tm2' => 0, - ], - 2 => [ - 'uid1' => 0, - 'uid2' => 0, - 'time' => time(), - 'type' => 0, - 'a' => '00000', - 'b' => '0', - 'type_a' => '', - 'type_b' => '0', - 'yrn' => 0, - 'yrn_krit' => 0, - 'ma' => 0, - 'mb' => 0, - 'tm1' => 0, - 'tm2' => 0, - ], - ]; - - //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) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - if ($this->stats[$this->uids[$u1]]['yhod'] > 0) { - //$u1 = $u2; - } elseif ($this->stats[$this->uids[$u2]]['yhod'] > 0) { - $u2 = $this->yhod_user($u1, $u2, $this->stats[$this->uids[$u2]]['yhod']); - } - - $s1 = $this->users[$this->uids[$u1]]['sex']; - $s2 = $this->users[$this->uids[$u2]]['sex']; - - $stat[$a]['uid1'] = $u1; - $stat[$a]['uid2'] = $u2; - $stat[$a]['ma'] = $this->stats[$this->uids[$u1]]['zona']; - $stat[$a]['mb'] = $this->stats[$this->uids[$u1]]['zonb']; - $stat[$a]['tm1'] = $this->users[$this->uids[$u1]]['team']; - $stat[$a]['tm2'] = $this->users[$this->uids[$u2]]['team']; - $stat[$a]['a'] = $this->atacks[$id]['a' . $a]; - $stat[$a]['b'] = $this->atacks[$id]['b' . $a]; - - $vLog = 'at1=00000||at2=00000||zb1=' . $this->stats[$this->uids[$u1]]['zonb'] . '||zb2=' . $this->stats[$this->uids[$u2]]['zonb'] . '||bl1=' . $this->atacks[$id]['b' . $a] . '||bl2=' . $this->atacks[$id]['b' . $b] . '||time1=' . $this->atacks[$id]['time'] . '||time2=' . $this->atacks[$id]['time2'] . '||s' . $a . '=' . $s1 . '||s' . $b . '=' . $s2 . '||t2=' . $this->users[$this->uids[$u2]]['team'] . '||t1=' . $this->users[$this->uids[$u1]]['team'] . '||login1=' . $this->users[$this->uids[$u1]]['login2'] . '||login2=' . $this->users[$this->uids[$u2]]['login2'] . ''; - - $mas = [ - 'text' => '', - 'time' => time(), - 'vars' => '', - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'vars' => $vLog, - 'type' => 1, - ]; - - if (!isset($at[$a]['atack'])) { // - if ($this->atacks[$id]['tpo' . $a] == 2) { - $mas['text'] .= '{u1} .'; - } else { - // - if ($this->info['razdel'] == 0 && $this->info['dn_id'] == 0 && $this->info['izlom'] == 0) { - mysql_query('INSERT INTO `battle_out` (`battle`,`uid1`,`uid2`,`time`,`out`) VALUES ( - "' . $this->info['id'] . '","' . $u1 . '","' . $u2 . '","' . time() . '","1" - )'); - } - // - if (isset($u1)) { - $mas['text'] .= '{u1} .'; - // - mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u1 . '" AND `delete` = 0 AND `v1` = "priem" AND (`v2`=288 OR `v2`=287 OR `v2`=286 OR `v2`=273) LIMIT 1'); - } - } - $mas['text'] = '{tm1} ' . $mas['text']; - $this->add_log($mas); - } else { - $j = 0; - while ($j < count($at[$a]['atack']) && $j < 8) { - // - $mas['text'] = ''; - // - $wt = [ - 21 => 4, - 22 => 5, - 20 => 2, - 28 => 2, - 19 => 3, - 18 => 1, - 26 => 22, - ]; - $par = [ - 'zona' => '{zn2_' . $at[$a]['atack'][$j][0] . '} ', - 'kyda' => $this->lg_zon[$at[$a]['atack'][$j][0]][rand(0, - (count($this->lg_zon[$at[$a]['atack'][$j][0]]) - 1))], - 'chem' => $this->lg_itm[$wt[$at[$a]['atack'][$j]['wt']]][rand(0, - (count($this->lg_itm[$wt[$at[$a]['atack'][$j]['wt']]]) - 1))], - ]; - // - $this->atacks[$id]['uid_' . $u1 . '_t' . $at[$a]['atack'][$j][1]]++; - // - // - $this->asr($u1, $u2, $at[$a]['atack'][$j][1]); - // - if ($at[$a]['atack'][$j][1] == 1) { - //u1 u2 - $mas['text'] .= $par['zona'] . '{u2} ' . $this->addlt($b, 1, $s2, null) . '' . $this->addlt($b, - 2, $s2, null) . '' . $this->addlt($a, 3, $s1, null) . ' {u1} ' . $this->addlt($a, 4, - $s1, null) . '' . $this->addlt($a, 5, $s1, null) . '' . $this->addlt($a, 6, $s1, - null) . ' ' . $this->addlt(1, 7, $s1, - $at[$a]['atack'][$j]['yron']['t']) . ' ' . $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 2) { - //u2 u1 - $mas['text'] .= $par['zona'] . '{u1} ' . $this->addlt($a, 8, $s1, null) . '' . $this->addlt($a, - 9, $s1, null) . ' {u2} ' . $this->addlt($b, 11, $s2, - null) . ' ' . $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 3) { - //u2 u1 - $mas['text'] .= $par['zona'] . '{u1} ' . $this->addlt($a, 8, $s1, null) . '' . $this->addlt($a, - 9, $s1, null) . ' {u2} ' . $this->addlt($b, 10, $s2, - null) . ' ' . $this->addlt(1, 7, 0, $s1, - $at[$a]['atack'][$j]['yron']['t']) . ' ' . $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 4) { - //u1 u2 - if (isset($at[$a]['atack'][$j]['yron']['t'])) { - $mas['text'] .= $par['zona'] . '{u2} ' . $this->addlt($b, 1, $s2, - null) . '' . $this->addlt($b, 2, $s2, null) . '' . $this->addlt($a, 3, $s1, - null) . ' {u1} ' . $this->addlt($a, 4, $s1, null) . '' . $this->addlt($a, 5, $s1, - null) . ', , ' . $this->addlt($a, 6, $s1, - null) . ' ' . $this->addlt(1, 7, $s1, - $at[$a]['atack'][$j]['yron']['t']) . ' ' . $par['chem'] . ' ' . $par['kyda'] . '. '; - } - } elseif ($at[$a]['atack'][$j][1] == 5) { - //u1 u2 - $mas['text'] .= $par['zona'] . '{u2} ' . $this->addlt($b, 1, $s2, null) . '' . $this->addlt($b, - 2, $s2, null) . '' . $this->addlt($a, 3, $s1, null) . ' {u1} ' . $this->addlt($a, 4, - $s1, null) . '' . $this->addlt($a, 5, $s1, null) . '' . $this->addlt($a, 6, $s1, - null) . ' ' . $this->addlt(1, 7, $s1, - $at[$a]['atack'][$j]['yron']['t']) . ' ' . $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 6) { - //u2 u1 - $mas['text'] .= $par['zona'] . '{u1} ' . $this->addlt($a, 8, $s1, null) . '' . $this->addlt($a, - 9, $s1, - null) . ' {u2} ' . $this->addlt(1, - 7, 0, $s1, - $at[$a]['atack'][$j]['yron']['t']) . ' ' . $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 7) { - //u2 u1 - $mas['text'] .= $par['zona'] . '{u1} ' . $this->addlt($a, 8, $s1, null) . '' . $this->addlt($a, - 9, $s1, - null) . ' {u2}, , ' . $this->addlt($b, - 10, $s2, null) . ' ' . $this->addlt(1, 7, 0, $s1, - $at[$a]['atack'][$j]['yron']['t']) . ' ' . $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 8) { - //u2 u1 - $mas['text'] .= $par['zona'] . '{u1} ' . $this->addlt($a, 8, $s1, null) . '' . $this->addlt($a, - 9, $s1, null) . ' {u2} ' . $this->addlt($b, 11, $s2, - null) . ' ' . $par['chem'] . ' ' . $par['kyda'] . ' . '; - } - - $stat[$a]['type_a'] .= '' . $at[$a]['atack'][$j][1] . ''; - if ((!isset($this->stats[$this->uids[$u2]]['notravma']) || $this->stats[$this->uids[$u2]]['notravma'] == 0) && isset($at[$a]['atack'][$j]['yron']['travma']) && $at[$a]['atack'][$j]['yron']['travma'][0] > 0 && floor($at[$a]['atack'][$j]['yron']['hp']) <= 0) { - $tr_pl = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = "' . $u2 . '" AND `delete` = "0" ORDER BY `v1` DESC LIMIT 1')); - if (!isset($tr_pl['id']) || $tr_pl['v1'] < 3) { - //263 - if (isset($tr_pl['id'])) { - $at[$a]['atack'][$j]['yron']['travma'][0] = rand(($tr_pl['v1'] + 1), 3); - } - $tr_pl2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `uid` = "' . $u2 . '" AND `delete` = "0" AND `name` LIKE "% %" LIMIT 1')); - if (!isset($tr_pl2['id']) && $at[$a]['atack'][$j]['yron']['travma'][0] <= 3) { - $mas['text'] = rtrim($mas['text'], '. '); - $mas['text'] .= ', '; - if ($at[$a]['atack'][$j]['yron']['travma'][0] == 1) { - $mas['text'] .= ''; - $this->addTravm($u2, 1, rand(3, 5)); - } elseif ($at[$a]['atack'][$j]['yron']['travma'][0] == 2) { - $mas['text'] .= ''; - $this->addTravm($u2, 2, rand(3, 5)); - } elseif ($at[$a]['atack'][$j]['yron']['travma'][0] == 3) { - $mas['text'] .= ''; - $this->addTravm($u2, 3, rand(3, 5)); - } - $mas['text'] .= ' . '; - } - } - unset($tr_pl); - } - if ($at[$a]['atack'][$j]['yron']['pb'] == 1 && isset($at[$a]['atack'][$j]['yron']['hp'])) { - $mas['text'] = rtrim($mas['text'], '. '); - $mas['text'] .= ' . '; - } - if ($at[$a]['atack'][$j][3] == 1) { - $mas['text'] .= '() '; - } - if (isset($at[$a]['atack'][$j]['yron'])) { - if ($at[$a]['atack'][$j]['yron']['w'] == 3) { - $mas['textWP'] = '( )'; - } elseif ($at[$a]['atack'][$j]['yron']['w'] == 14) { - $mas['textWP'] = '( )'; - } else { - $mas['textWP'] = '( )'; - } - if ($at[$a]['atack'][$j][1] == 4 || $at[$a]['atack'][$j][1] == 5 || $at[$a]['atack'][$j][1] == 1) { - if ($at[$a]['atack'][$j]['yron']['y'] < 1) { - $at[$a]['atack'][$j]['yron']['r'] = '--'; - } - } - if ($at[$a]['atack'][$j][1] == 4 || $at[$a]['atack'][$j][1] == 5) { - $stat[$a]['yrn_krit'] += -$at[$a]['atack'][$j]['yron']['r']; - //$stat[$a]['yrn_krit'] += $at[$a]['atack'][$j]['yron']['k']; - $mas['text'] .= ' ' . $at[$a]['atack'][$j]['yron']['r'] . ''; - } else { - $mas['text'] .= ' ' . $at[$a]['atack'][$j]['yron']['r'] . ''; - } - $stat[$a]['yrn'] += -$at[$a]['atack'][$j]['yron']['r']; - } - if (isset($at[$a]['atack'][$j]['yron']['hp'])) { - if ($this->users[$this->uids[$u2]]['align'] == 9) { - $at[$a]['atack'][$j]['yron']['hp'] = $at[$a]['atack'][$j]['yron']['hp'] / ($at[$a]['atack'][$j]['yron']['hpAll'] / 100); - $at[$a]['atack'][$j]['yron']['hpAll'] = '100%'; - } - $mas['text'] .= ' [' . floor($at[$a]['atack'][$j]['yron']['hp']) . '/' . floor($at[$a]['atack'][$j]['yron']['hpAll']) . ']'; - } - // - 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'])) { - if (isset($at[$a]['atack'][$j]['yron']['plog'][$il])) { - eval($at[$a]['atack'][$j]['yron']['plog'][$il]); - } - $il++; - } - } - $this->add_log($mas); - $j++; - } - } - $i++; - } - - // + _ - $this->addNewStat($stat); - - // - if (floor($this->stats[$this->uids[$u1]]['hpNow']) < 1) { - $dies[1] = 1; - } - if (floor($this->stats[$this->uids[$u2]]['hpNow']) < 1) { - $dies[2] = 1; - } - if ($dies[1] > 0 || $dies[2] > 0) { - $s1 = $this->users[$this->uids[$u1]]['sex']; - $s2 = $this->users[$this->uids[$u2]]['sex']; - - $vLog = 'at1=00000||at2=00000||zb1=' . $this->stats[$this->uids[$u1]]['zonb'] . '||zb2=' . $this->stats[$this->uids[$u2]]['zonb'] . '||bl1=' . $this->atacks[$id]['b' . $a] . '||bl2=' . $this->atacks[$id]['b' . $b] . '||time1=' . $this->atacks[$id]['time'] . '||time2=' . $this->atacks[$id]['time2'] . '||s2=' . $this->users[$this->uids[$u2]]['sex'] . '||s1=' . $this->users[$this->uids[$u1]]['sex'] . '||t2=' . $this->users[$this->uids[$u2]]['team'] . '||t1=' . $this->users[$this->uids[$u1]]['team'] . '||login1=' . $this->users[$this->uids[$u1]]['login2'] . '||login2=' . $this->users[$this->uids[$u2]]['login2'] . ''; - - $mas = [ - 'text' => '', - 'time' => time(), - 'vars' => '', - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'vars' => $vLog, - 'type' => 1, - ]; - - $rtngwin = [1, 2, 3, 5, 10, 20, 40, 80, 160]; - $rtnglos = [0, 0, 0, -1, -2, -5, -10, -20, -40]; - - if ($this->info['typeBattle'] == 99) { - if ($btlstatus[0] == 0) { - // - $rtngwin = [2, 4, 6, 10, 20, 40, 80, 160, 320]; - if ($this->info['razdel'] == 5) { - // - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } else { - // - $rtnglos = [0, 0, 0, 0, 0, 0, 0, 0, 0]; - } - } elseif ($btlstatus[0] == 25) { - // - $rtngwin = [3, 6, 9, 15, 30, 60, 120, 240, 480]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 50) { - // - $rtngwin = [4, 8, 16, 32, 64, 128, 256, 512, 1024]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 75) { - // - $rtngwin = [5, 10, 20, 40, 80, 160, 320, 640, 1280]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 100) { - // - $rtngwin = [6, 12, 24, 48, 98, 196, 392, 784, 1568]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 150) { - // - $rtngwin = [7, 14, 28, 56, 112, 224, 448, 896, 1792]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } - } else { - if ($btlstatus[0] == 0) { - // - $rtngwin = [1, 2, 3, 5, 10, 20, 40, 80, 160]; - if ($this->info['razdel'] == 5) { - // - $rtnglos = [0, 0, 0, -1, -2, -5, -10, -20, -40]; - } else { - // - $rtnglos = [0, 0, 0, 0, 0, 0, 0, 0, 0]; - } - } elseif ($btlstatus[0] == 25) { - // - $rtngwin = [2, 4, 6, 10, 20, 40, 80, 160, 320]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 50) { - // - $rtngwin = [3, 6, 9, 15, 30, 60, 120, 240, 480]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 75) { - // - $rtngwin = [4, 8, 16, 32, 64, 128, 256, 512, 1024]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 100) { - // - $rtngwin = [5, 10, 20, 40, 80, 160, 320, 640, 1280]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 150) { - // - $rtngwin = [7, 14, 28, 56, 112, 224, 448, 896, 1792]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } - } - - if ($this->info['dn_id'] > 0 || $this->info['izlom'] != 0 || $this->info['turnir'] != 0) { - // , - $rtngwin = [0, 0, 0, 0, 0, 0, 0, 0, 0]; - $rtnglos = [0, 0, 0, 0, 0, 0, 0, 0, 0]; - } elseif ($this->info['clan1'] > 0 && $this->info['clan2'] > 0) { - // - $rtngwin = [3, 6, 9, 15, 30, 60, 120, 240, 480]; - $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) { - // - } else { - if ($this->users[$this->uids[$u1]]['level'] >= 4) { - $rtng1 += $rtnglos[$this->users[$this->uids[$u1]]['level'] - 4]; - $rtng2 += $rtngwin[$this->users[$this->uids[$u1]]['level'] - 4]; - } - } - // 1 2 - $this->spaCheck($this->users[$this->uids[$u1]]['id']); - } - if ($dies[2] == 1) { - if ($this->info['dn_id'] > 0) { - // - } else { - if ($this->users[$this->uids[$u1]]['level'] >= 4) { - $rtng1 += $rtnglos[$this->users[$this->uids[$u1]]['level'] - 4]; - $rtng2 += $rtngwin[$this->users[$this->uids[$u1]]['level'] - 4]; - } - } - // 2 1 - $this->spaCheck($this->stats[$this->uids[$u2]]['id']); - } - // - // - if ($this->info['type'] != 564 && $this->stats[$this->uids[$u1]]['inTurnir'] == 0 && $this->stats[$this->uids[$u2]]['inTurnir'] == 0 && $this->info['dn_id'] == 0 && $this->info['izlom'] == 0) { - // - if ($this->users[$this->uids[$u2]]['bot'] == 0) { - mysql_query('INSERT INTO `users_reting` (`uid`,`time`,`val`,`align`,`clan`) VALUES ( - "' . $u1 . '","' . time() . '","' . $rtng1 . '","' . $this->users[$this->uids[$u1]]['align'] . '","' . $this->users[$this->uids[$u1]]['clan'] . '")'); - } - unset($rtng); - if ($this->users[$this->uids[$u1]]['bot'] == 0) { - mysql_query('INSERT INTO `users_reting` (`uid`,`time`,`val`,`align`,`clan`) VALUES ( - "' . $u2 . '","' . time() . '","' . $rtng2 . '","' . $this->users[$this->uids[$u2]]['align'] . '","' . $this->users[$this->uids[$u2]]['clan'] . '")'); - } - } - unset($rtng1, $rtng2); - } - - return true; - } - - // - public function priemAddLog($id, $a, $b, $u1, $u2, $prm, $text, $hodID, $tm1 = 0, $tm2 = 0) - { - $time = time(); - if ($tm1 == 0) { - $tm1 = isset($this->atacks[$id]) ? $this->atacks[$id]['time'] : $time; - } - if ($tm2 == 0) { - $tm2 = isset($this->atacks[$id]) ? $this->atacks[$id]['time2'] : $time; - } - $prm = str_replace('=', '^^^^', $prm); - $vLog = - 'prm=' . $prm . - '||at1=00000||at2=00000||zb1=' . $this->stats[$this->uids[$u1]]['zonb'] . - '||zb2=' . $this->stats[$this->uids[$u2]]['zonb'] . - '||bl1=' . $this->atacks[$id]['b' . $a] . - '||bl2=' . $this->atacks[$id]['b' . $b] . - '||time1=' . $tm1 . - '||time2=' . $tm2 . - '||s' . $a . '=' . $this->users[$this->uids[$u1]]['sex'] . - '||s' . $b . '=' . $this->users[$this->uids[$u2]]['sex'] . - '||t2=' . $this->users[$this->uids[$u2]]['team'] . - '||t1=' . $this->users[$this->uids[$u1]]['team'] . - '||login1=' . $this->users[$this->uids[$u1]]['login2'] . - '||login2=' . $this->users[$this->uids[$u2]]['login2']; - - $mas = [ - 'text' => $text, - 'time' => $time, - 'battle' => $this->info['id'], - 'id_hod' => $hodID, - 'vars' => $vLog, - 'type' => 1, - ]; - $this->add_log($mas); - } - - // ( ) - public function priemAddLogFast($u1, $u2, $prm, $text, $hodID, $tm) - { - $vLog = 'prm=' . $prm . '||time1=' . $tm . '||time2=' . $tm . '||s1=' . $this->users[$this->uids[$u1]]['sex'] . '||s2=' . $this->users[$this->uids[$u2]]['sex'] . '||t2=' . $this->users[$this->uids[$u2]]['team'] . '||t1=' . $this->users[$this->uids[$u1]]['team'] . '||login1=' . $this->users[$this->uids[$u1]]['login2'] . '||login2=' . $this->users[$this->uids[$u2]]['login2'] . ''; - $mas = [ - 'text' => $text, - 'time' => time(), - 'vars' => '', - 'battle' => $this->info['id'], - 'id_hod' => ($this->hodID + $hodID), - 'vars' => $vLog, - 'type' => 1, - ]; - $this->add_log($mas); - } - - // - 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); - // - $at = $this->mf3Razmen($id, $at, $v, true, $rjd); - // - //$at = $this->mf5Razmen($id,$at,$v,true,$rjd); - // ( , ) - $at = $this->mf4Razmen($id, $at, $v, true, $rjd); - // - //$at = $this->yronRazmen($id,$at); - // - $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) - { - global $u; - /* - 1 - - 2 - - 3 - ( ) - 4 - - 5 - - 6 - - 7 - - 8 - - 9 - - 10-12 - - 13 - - 14 - / ( ) - 16 - - 17 - - */ - $zi = [ // - 1 => [1, 8, 9, 52], // - 2 => [4, 5, 6], // - 3 => [2, 4, 5, 6, 13], // - 4 => [7, 16, 10, 11, 12], // - 5 => [17] // - ]; - // - $zi = $zi[$z]; - $i = 0; - // - while ($i < count($zi)) { - // - $t = $u->items['add']; - $ii = 0; - // - while ($ii < count($s['items'])) { - if (isset($s['items'][$ii]) && $s['items'][$ii]['inOdet'] == $zi[$i]) { - $po = $u->lookStats($s['items'][$ii]['data']); - // - $x = 0; - while ($x < count($t)) { - $n = $t[$x]; - if (isset($po['sv_' . $n])) { - $s[$n] += $po['sv_' . $n]; - if ($n == 'za') { - $iii = 1; - while ($iii <= 4) { - $s['za' . $iii] += $po['sv_' . $n]; - $iii++; - } - } elseif ($n == 'zm') { - $iii = 1; - while ($iii <= 4) { - $s['zm' . $iii] += $po['sv_' . $n]; - $iii++; - } - } elseif ($n == 'zma') { - $iii = 1; - while ($iii <= 7) { - $s['zma' . $iii] += $po['sv_' . $n]; - $iii++; - } - } - } - $x++; - } - // - } - $ii++; - } - // - $i++; - } - // - return $s; - } - - // . - 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' => '--', - ]; - // - /* - - - - - */ - $witm = 0; - $witm_type = 0; - - if ($wp > 0) { - $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 { - $witm_type2 = $witm_type; - } - $r['t'] = $witm_type2; - // - /* - - - - - - */ - $bron = [ - 1 => [$this->stats[$this->uids[$uid2]]['mib1'], $this->stats[$this->uids[$uid2]]['mab1']], - 2 => [$this->stats[$this->uids[$uid2]]['mib2'], $this->stats[$this->uids[$uid2]]['mab2']], - 3 => [$this->stats[$this->uids[$uid2]]['mib2'], $this->stats[$this->uids[$uid2]]['mab2']], - 4 => [$this->stats[$this->uids[$uid2]]['mib3'], $this->stats[$this->uids[$uid2]]['mab3']], - 5 => [$this->stats[$this->uids[$uid2]]['mib4'], $this->stats[$this->uids[$uid2]]['mab4']], - ]; - // - // - //$witm_data - $iii = 1; - while ($iii <= 7) { - if (isset($witm_data['sv_a' . $iii]) && $witm_data['sv_a' . $iii] != 0) { - $this->stats[$this->uids[$uid1]]['a' . $iii] += $witm_data['sv_a' . $iii]; - } - if (isset($witm_data['sv_mg' . $iii]) && $witm_data['sv_mg' . $iii] != 0) { - $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_mg' . $iii]; - } - $iii++; - } - $iii = 1; - while ($iii <= 4) { - if (isset($witm_data['sv_aall']) && $witm_data['sv_aall'] != 0) { - $this->stats[$this->uids[$uid1]]['a' . $iii] += $witm_data['sv_aall']; - } - $iii++; - } - $iii = 1; - while ($iii <= 4) { - if (isset($witm_data['sv_mall']) && $witm_data['sv_mall'] != 0) { - $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_mall']; - } - $iii++; - } - $iii = 1; - while ($iii <= 7) { - if (isset($witm_data['sv_m2all']) && $witm_data['sv_m2all'] != 0) { - $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_m2all']; - } - $iii++; - } - - if (isset($witm_data['sv_m3']) && $witm_data['sv_m3'] != 0) { - $this->stats[$this->uids[$uid1]]['m3'] += $witm_data['sv_m3']; - } - - $iii = 1; - while ($iii <= 7) { - if (isset($witm_data['sv_pa' . $iii]) && $witm_data['sv_pa' . $iii] != 0) { - $this->stats[$this->uids[$uid1]]['pa' . $iii] += $witm_data['sv_pa' . $iii] + $witm_data['sv_m10']; - } - if (isset($witm_data['sv_pm' . $iii]) && $witm_data['sv_pm' . $iii] != 0) { - $this->stats[$this->uids[$uid1]]['pm' . $iii] += $witm_data['sv_pm' . $iii] + $witm_data['sv_m11a']; - if ($iii < 5) { - $this->stats[$this->uids[$uid1]]['pm' . $iii] += $witm_data['sv_m11']; - } - } - $iii++; - } - // - // + - $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']; - 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]]['m10'] + $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) . '']; - } - // - - // - // - $vladenie = 0; - - // - $proboi = 0; - $witm_data['m9'] = $this->stats[$this->uids[$uid1]]['m9']; - if (rand(1, 100) < floor($witm_data['m9'] / 2)) { - $proboi = floor($witm_data['m9'] / 2); - $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]], - $this->users[$this->uids[$uid2]], - $this->users[$this->uids[$uid1]]['level'], - $this->users[$this->uids[$uid2]]['level'], - // - $witm_type, - $this->stats[$this->uids[$uid1]]['minAtack'], //. () - $this->stats[$this->uids[$uid1]]['maxAtack'], //. - $bron[$zona][0], // . - $bron[$zona][1], // - // - $vladenie, // - (($wAp /*+ $w3p + $w14p*/)), // - (round($this->stats[$this->uids[$uid1]]['m3'])), // - (($this->stats[$this->uids[$uid2]]['za' . $witm_type2]) - $this->stats[$this->uids[$uid1]]['pza']), - // - $this->stats[$this->uids[$uid1]]['ozash'], // - $proboi, // - 0, // - ($witm_data['sv_yron_min'] + $this->stats[$this->uids[$uid1]]['yron_min']), - ($witm_data['sv_yron_max'] + $this->stats[$this->uids[$uid1]]['yron_max']), - $this->stats[$this->uids[$uid2]]['zaproc'], - $this->stats[$this->uids[$uid2]]['zmproc'], - (($this->stats[$this->uids[$uid2]]['zm' . ($witm_type2 - 4)]) - round($this->stats[$this->uids[$uid1]]['pzm'] * 0.8)), - // - $this->stats[$this->uids[$uid1]]['omzash'], // - $witm['type'], - $witm - ); - - $r['y'] = round(rand($y['min'] + $proboi, $y['max'] + round($proboi / 2))); - $r['k'] = round(rand($y['Kmin'] + round($proboi / 4), $y['Kmax'] + round($proboi / 8))); - - $r['m_y'] = $y['max']; - $r['m_k'] = $y['Kmax']; - - $r['bRND'] = $y['bRND']; - - $r['w_type'] = $witm_type; - - // - 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) { - $tp = 1; - } elseif ($witm['type'] == 19) { - $tp = 2; - } elseif ($witm['type'] == 20) { - $tp = 3; - } elseif ($witm['type'] == 21) { - $tp = 4; - } else { - //$tp = 0; - } - - if ($tp != $witm_type && $wp > 0) // - { - $r['y'] = round($r['y'] / 3); - $r['r'] = round($r['r'] / 3); - $r['k'] = round($r['k'] / 3); - $r['m_k'] = round($r['m_k'] / 3); - $r['m_y'] = round($r['m_y'] / 3); - } - - if (isset($this->stats[$this->uids[$uid2]]['zaproc'])) { - $r['y'] = round($r['y'] - $r['y'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - $r['r'] = round($r['r'] - $r['r'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - $r['k'] = round($r['k'] - $r['k'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - $r['m_k'] = round($r['m_k'] - $r['m_k'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - $r['m_y'] = round($r['m_y'] - $r['m_y'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - if ($r['k'] < 1) { - $r['k'] = 2; - } - } - - if ($r['y'] < 1) { - $r['y'] = 1; - } - if ($r['r'] >= 0) { - $r['r'] = -1; - } - if ($r['k'] < 1) { - $r['k'] = 1; - } - if ($r['m_k'] < 1) { - $r['m_k'] = 1; - } - if ($r['m_y'] < 1) { - $r['m_y'] = 1; - } - //$this->a_restart_stats($uid1,1); - //$this->a_testing_stats($uid2,1); - return $r; - } - - // - public function yronRazmen($id, $at, $pat = false, $rjd = 0) - { - if ($pat == true) { - $pat = $at; - $at = $pat['p']; - } else { - unset($pat); - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $yhod = [1 => 1, 2 => 0]; - //$uid1 = $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) { - $yhod = [1 => 0, 2 => 1]; - //$uid2 = $this->yhod_user($this->atacks[$id]['uid1'],$this->atacks[$id]['uid2'],$this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - // - - - // (u2) (u1) - //print_r( $at[$i] ); - $j = 0; - $k = 0; - $wp = 3; - if ($rjd > 0) { - $j = $rjd - 1; - } - // - - //$checkhp1=$this->stats[$this->uids[$u2]]['hpNow']; - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ($k == 0 && isset($this->stats[$this->uids[$u1]]['wp3id'])) { - // - $wp = 3; - $k = 1; - } else { - // - if (isset($this->stats[$this->uids[$u1]]['wp14id']) && $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp14id']]['type'] != 13) { - $wp = 14; - } else { - if (isset($this->stats[$this->uids[$u1]]['wp3id'])) { - $wp = 3; - } else { - // - $wp = 3; - } - } - $k = 0; - } - if ($wp > 0) { - $witm = $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp' . $wp . 'id']]; - $witm_type = $this->weaponTx($witm); - $at[$a]['atack'][$j]['wt'] = $witm['type']; - } - // - $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']; - $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']; - } - - /*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); - } 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']; - } - /* - 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++; - } - - if (isset($pat) && $pat != false) { - $pat['p'] = $at; - $at = $pat; - } - - return $at; - } - - // - public function updateHealth($id, $at) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - // - if ($this->atacks[$id]['out' . $b] > 0) { - // ${'u'.$a} , - if (rand(0, 100) < min(floor($this->stats[$this->uids[$u1]]['m6'] / 5), 20)) { - // - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic3']++; - } - } - if (rand(0, 100) < min(floor($this->stats[$this->uids[$u1]]['m8'] / 4), 20)) { - // - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic4']++; - } - } - } - - // (u2) (u1) - //print_r( $at[$i] ); - $j = 0; - $k = 0; - $wp = 3; - while ($j < count($at[$a]['atack']) && $j < 8) { - // - //$this->stats[$this->uids[$this->atacks[$id]['uid1']]]['tactic1'] - if ($at[$a]['atack'][$j][1] == 1) { - //u1 u2 - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic1']++; - } - // - if ($at[$a]['atack'][$j]['yron']['2h'] == 1) { - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic1'] += 2; - } - } - } elseif ($at[$a]['atack'][$j][1] == 2) { - //u2 u1 - } elseif ($at[$a]['atack'][$j][1] == 3) { - //u2 u1 - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u2]]['tactic4']++; - } - } elseif ($at[$a]['atack'][$j][1] == 4) { - //u1 u2 - if (!isset($at[$a]['atack'][$j]['notactic2'])) { - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic2']++; - } - } - $this->users[$this->uids[$u2]]['tactic4']++; // - } elseif ($at[$a]['atack'][$j][1] == 5) { - //u1 u2 - if (!isset($at[$a]['atack'][$j]['notactic2'])) { - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic2'] += 2; - } - // - if ($at[$a]['atack'][$j]['yron']['2h'] == 1) { - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic2'] += 1; - } - } - } - } elseif ($at[$a]['atack'][$j][1] == 6) { - //u2 u1 - if (!isset($at[$a]['atack'][$j]['notactic5'])) { - if ($this->stats[$this->uids[$u1]]['this_animal'] == 0) { - $this->users[$this->uids[$u2]]['tactic5']++; - } - } - } elseif ($at[$a]['atack'][$j][1] == 7) { - //u2 u1 // - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u2]]['tactic4']++; - } - } elseif ($at[$a]['atack'][$j][1] == 8) { - //u2 u1 - if ($this->stats[$this->uids[$u1]]['this_animal'] == 0) { - $this->users[$this->uids[$u2]]['tactic3']++; - } - } - // , - 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)) { - // - - if ($this->stats[$this->uids[$u2]]['hpNow'] <= $at[$a]['atack'][$j]['yron']['y']) { - $at[$a]['atack'][$j]['yron']['y'] = $this->stats[$this->uids[$u2]]['hpNow']; - } - if ($this->stats[$this->uids[$u2]]['hpNow'] <= $at[$a]['atack'][$j]['yron']['k']) { - $at[$a]['atack'][$j]['yron']['k'] = $this->stats[$this->uids[$u2]]['hpNow']; - } - - if ($at[$a]['atack'][$j]['yron']['y'] < 0) { - $at[$a]['atack'][$j]['yron']['y'] = 1; - $at[$a]['atack'][$j]['yron']['r'] = -1; - $at[$a]['atack'][$j]['yron']['k'] = 1; - } - if ($this->stats[$this->uids[$u2]]['hpNow'] < 1) { - $at[$a]['atack'][$j]['yron']['y'] = 0; - $at[$a]['atack'][$j]['yron']['r'] = -1; - $at[$a]['atack'][$j]['yron']['k'] = 0; - } - - // - //$this->users[$this->uids[$u1]]['battle_yron'] += $at[$a]['atack'][$j]['yron']['y']; - $this->takeExp($u1, $at[$a]['atack'][$j]['yron']['y'], $u1, $u2); - // - $this->stats[$this->uids[$u2]]['hpNow'] -= $at[$a]['atack'][$j]['yron']['y']; - $this->users[$this->uids[$u2]]['last_hp'] = -$at[$a]['atack'][$j]['yron']['y']; - - //echo '['.$u1.' -> '.$u2.']'; - $at[$a]['atack'][$j]['yron']['hp'] = $this->stats[$this->uids[$u2]]['hpNow']; - if ($at[$a]['atack'][$j]['yron']['hp'] < 1) { - $at[$a]['atack'][$j]['yron']['hp'] = 0; - } - $at[$a]['atack'][$j]['yron']['hpAll'] = $this->stats[$this->uids[$u2]]['hpAll']; - if ($at[$a]['atack'][$j]['yron']['hp'] > $at[$a]['atack'][$j]['yron']['hpAll']) { - $at[$a]['atack'][$j]['yron']['hp'] = $at[$a]['atack'][$j]['yron']['hpAll']; - } - // - // - if (rand(0, 100) <= 50) { - if ($at[$a]['atack'][$j][1] == 4 || $at[$a]['atack'][$j][1] == 5) { - if (!isset($at[$a]['atack'][$j]['yron']['travma']) && rand(0, - 1000) < 500 && $this->users[$this->uids[$u2]]['level'] > 1 && $this->stats[$this->uids[$u1]] > 1) { - $trvm_chns = floor(rand(0, 200) / 10); - if ($trvm_chns > 3 || $trvm_chns < 1) { - $trvm_chns = 0; - } - $at[$a]['atack'][$j]['yron']['travma'] = [$trvm_chns, ' ']; - unset($trvm_chns); - } - } - } - } - $j++; - } - - $i++; - } - - return $at; - } - - // - public function addstatuser($id) - { - if ($id > 0) { - $uid = $id; - $id = $this->uids[$uid]; - mysql_query('INSERT INTO `battle_users` - ( `battle`,`uid`,`time_enter`,`login`,`level`,`align`,`clan`,`hpAll`,`hp`,`hpStart`,`team` ) - VALUES - ( - "' . $this->info['id'] . '", - "' . $uid . '", - "' . time() . '","' . $this->users[$id]['login'] . '", - "' . $this->users[$id]['level'] . '", - "' . $this->users[$id]['align'] . '", - "' . $this->users[$id]['clan'] . '", - "' . $this->stats[$id]['hpAll'] . '", - "' . $this->stats[$id]['hp'] . '", - "' . $this->stats[$id]['hpNow'] . '", - "' . $this->users[$id]['team'] . '" - )'); - } - } - - // - public function priemsRazmen($id, $at) - { - if ($at == 'fast') { - $uid1 = $id[0]; - $uid2 = $id[1]; - } else { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - } - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - // - $eff = $this->stats[$this->uids[$u1]]['effects']; - $this->stats[$this->uids[$u1]]['u_priem'] = []; - $j = 0; - while ($j <= count($eff)) { - if (isset($eff[$j]) && $eff[$j]['id_eff'] == 22 && $eff[$j]['v1'] == 'priem' && $eff[$j]['v2'] > 0) { - $this->stats[$this->uids[$u1]]['u_priem'][] = [ - $j, - $eff[$j]['v2'], - $this->prm[$eff[$j]['v2']]['act'], - $eff[$j]['id'], - $this->prm[$eff[$j]['v2']]['type_of'], - $this->prm[$eff[$j]['v2']]['moment'], - $this->prm[$eff[$j]['v2']]['moment_end'], - $this->prm[$eff[$j]['v2']]['type_sec'], - ]; - } - $j++; - } - - $i++; - } - // - } - - // - public function priemsRazmenMoment($id, $at) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - // - - // - if (!isset($this->stats[$this->uids[$u2]]['nopryh']) || $this->stats[$this->uids[$u2]]['nopryh'] == 0) { - $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][5] == 1) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - $this->stats[$this->uids[$u2]]['nopryh']--; - } - } - $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][5] == 2) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $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][5] == 3) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - } - unset(${'fx_priem'}); - } - } - $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][5] == 4) { - if ($this->testPriemVarTrueZash($i, 1, $this->stats[$this->uids[$u1]]['u_priem'][$j][1], $a, $b, - $u1, $u2) == false) { - } elseif (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $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][5] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $j++; - } - // - $i++; - } - // - return $at; - } - - // ( ) - public function priemsRazmenMomentEnd($id, $at) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - // - - // - if (!isset($this->stats[$this->uids[$u2]]['nopryh']) || $this->stats[$this->uids[$u2]]['nopryh'] == 0) { - $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][6] == 1) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - $this->stats[$this->uids[$u2]]['nopryh']--; - } - } - $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][6] == 2) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $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][6] == 3) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - } - $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][6] == 4) { - if ($this->testPriemVarTrueZash($i, 2, $this->stats[$this->uids[$u1]]['u_priem'][$j][1], $a, $b, - $u1, $u2) == false) { - } elseif (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $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][6] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $j++; - } - // - $i++; - } - // - return $at; - } - - - // - public function priemsTestRazmen($id, $at) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - - // - - $j = 0; - while ($j <= count($this->stats[$this->uids[$u1]]['u_priem'])) { - if ($this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 220 || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 237 - || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 286 || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 287 || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 288 - || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 213) { - 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++; - } - - // - if (!isset($this->stats[$this->uids[$u2]]['nopryh']) || $this->stats[$this->uids[$u2]]['nopryh'] == 0) { - $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] == 1) { - 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'}); - $this->stats[$this->uids[$u2]]['nopryh']--; - } - } - $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] == 2) { - 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++; - } - - // - $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] == 3) { - 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'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - } - unset(${'fx_priem'}); - } - } - $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] == 4) { - if ($this->testPriemVarTrueZash($i, 3, $this->stats[$this->uids[$u1]]['u_priem'][$j][1], $a, $b, - $u1, $u2) == false) { - } elseif (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'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - } - unset(${'fx_priem'}); - } - } - $j++; - } - - /* - $j = 0; - while( $j <= count( $this->stats[$this->uids[$u2]]['u_priem'] ) ) { - if( $this->stats[$this->uids[$u2]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 4 ) { - if(file_exists('../../_incl_data/class/priem/'.$this->stats[$this->uids[$u2]]['u_priem'][$j][1].'.php')) { - $pr_used_this = $u2; - require('priem/'.$this->stats[$this->uids[$u2]]['u_priem'][$j][1].'.php'); - if( isset($fx_priem) ) { - $at = $fx_priem($id,$at,$u2,$j); - } - unset(${'fx_priem'}); - } - } - $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] == 5) { - 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'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - } - unset(${'fx_priem'}); - } - } - $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++; - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - - // - $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++; - } - - // - $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] == 9) { - 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++; - } - - return $at; - } - - // - public function priemsRestartRazmen($id, $at) - { - if (isset($at['p'])) { - // - // - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - /* - , , : - 1. - 2 1. - : - 1. - 2 1. - 3. - 4 3. - .. - */ - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - } else { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - - // - if (!isset($this->stats[$this->uids[$u2]]['nopryh']) || $this->stats[$this->uids[$u2]]['nopryh'] == 0) { - $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] == 1) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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'}); - $this->stats[$this->uids[$u2]]['nopryh']--; - } - } - $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] == 2) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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++; - } - // - $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] == 4) { - if ($this->testPriemVarTrueZash($i, 4, $this->stats[$this->uids[$u1]]['u_priem'][$j][1], $a, $b, - $u1, $u2) == false) { - } elseif (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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++; - } - // - $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] == 3) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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++; - } - // - $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] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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++; - } - // - $j = 0; - while ($j <= count($this->stats[$this->uids[$u2]]['u_priem'])) { - if ($this->stats[$this->uids[$u1]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 8) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_tested_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u2, $j); - unset(${'fx_priem'}); - } - } - $j++; - } - // - $j = 0; - while ($j <= count($this->stats[$this->uids[$u2]]['u_priem'])) { - if ($this->stats[$this->uids[$u1]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 9) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_tested_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u2, $j); - unset(${'fx_priem'}); - } - } - $j++; - } - - $i++; - } - // - $at = $at['p']; - unset($at['p']); - } - return $at; - } - - // - public function testPriemVarTrueZash($i, $id, $pid, $a, $b, $u1, $u2) - { - $r = true; - //echo '['.$pid.','.$i.','.$a.','.$b.']'; - $g = [ - 45 => ['221' => true], - ]; - if (isset($g[$pid])) { - //echo 1; - if ($g[$pid][$i . $a . $b] == true) { - $r = true; - } else { - // $r = false; - } - } - return $r; - } - - // - public $um_priem = []; - - /** - * . - - * . - * @param $uid1 - * @param $uid2 - * @param $priem - * @param $yron - * @param $profil - * @param $stabil - * @param $test - * @param $inlog - * @return float|int|mixed - */ - public function testYronPriem($uid1, $uid2, $priem, $yron, $profil, $stabil, $test = false, $inlog = 0) - { - /* - profil = { - -1 - - -2 - - 0 - - 1-4 - - 5-12 - - } - stabil - . - */ - // - $a = 1; - $b = 2; - $u1 = $uid1; - $u2 = $uid2; - - // $u1 $u2 - // - if (!isset($this->stats[$this->uids[$u2]]['u_priem'])) { - $eff = $this->stats[$this->uids[$u2]]['effects']; - $j = 0; - while ($j <= count($eff)) { - if (isset($eff[$j]) && $eff[$j]['id_eff'] == 22 && $eff[$j]['v1'] == 'priem' && $eff[$j]['v2'] > 0) { - $this->stats[$this->uids[$u2]]['u_priem'][] = [ - $j, - $eff[$j]['v2'], - $this->prm[$eff[$j]['v2']]['act'], - $eff[$j]['id'], - $this->prm[$eff[$j]['v2']]['type_of'], - $this->prm[$eff[$j]['v2']]['moment'], - ]; - } - $j++; - } - unset($eff); - } - // - $j = 0; - while ($j <= count($this->stats[$this->uids[$u2]]['u_priem'])) { - if ($this->stats[$this->uids[$u2]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 4) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - $yron = $fx_moment($u2, $u1, $j, $yron, $profil); - unset(${'fx_moment'}); - } - } - $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] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this = $u1; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - if (isset($fx_moment)) { - $yron = $fx_moment($u1, $u2, $j, $yron, $profil, $inlog); - } - unset(${'fx_moment'}); - } - } - $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][7] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this_seven = $u1; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - if (isset($fx_moment_seven)) { - $yron = $fx_moment_seven($u1, $u2, $j, $yron, $profil, $inlog); - } - unset(${'fx_moment_seven'}); - } - } - if ($this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 180) { - // ( 10%). . - $x = mysql_fetch_row(mysql_query('select x from eff_users where v2 = 180 and uid = ' . $u1)); - $yron = 0.1 * $x[0]; - } - $j++; - } - - // - $j = 0; - while ($j <= count($this->stats[$this->uids[$u2]]['u_priem'])) { - if ($this->stats[$this->uids[$u2]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 8) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - if (isset($fx_moment)) { - $yron = $fx_moment($u2, $u1, $j, $yron, $profil, $inlog); - } - unset(${'fx_moment'}); - } - } - if ($this->stats[$this->uids[$u2]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 9) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - if (isset($fx_moment)) { - $yron = $fx_moment($u2, $u1, $j, $yron, $profil, $inlog); - } - unset(${'fx_moment'}); - } - } - - $j++; - } - - if ($this->stats[$this->uids[$u2]]['zaproc'] > 0) { - $yron = round($yron - $yron * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - if ($yron < 1) { - $yron = 1; - } - } - //var_dump($this->stats[$this->uids[$u2]]['u_priem']); - return $yron; - } - - // + \ - public function priemYronSave($u1, $u2, $yron, $type) - { - //$type 0 - , 1 - - - $this->testUserInfoBattle($u1); - $this->testUserInfoBattle($u2); - - if (isset($this->uids[$u1])) { - if ($this->stats[$this->uids[$u2]]['hpAll'] <= 1000) { - $adt6 = round(0.1 * (floor($yron) / $this->stats[$this->uids[$u2]]['hpAll'] * 100), 10); - } else { - $adt6 = round(0.1 * (floor($yron) / 1000 * 100), 10); - } - - if ($yron > $this->stats[$this->uids[$u2]]['hpNow']) { - $yron = $this->stats[$this->uids[$u2]]['hpNow']; - } - - if ($yron > 0) { - $this->users[$this->uids[$u1]]['battle_yron'] += $yron; - $this->users[$this->uids[$u1]]['battle_exp'] += round(1 * $this->testExp($yron, - $this->stats[$this->uids[$u1]], $this->stats[$this->uids[$u2]], $u1, $u2)); - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic6'] += $adt6; - $this->stats[$this->uids[$u1]]['tactic6'] += $adt6; - } else { - $this->users[$this->uids[$u1]]['tactic6'] += $adt6 / 3; - $this->stats[$this->uids[$u1]]['tactic6'] += $adt6 / 3; - } - } else { - $adt6 = 0; - } - // - $this->users[$this->uids[$u2]]['last_hp'] = -$yron; - // - mysql_query('UPDATE `stats` SET - `tactic6` = `tactic6` + "' . $adt6 . '", - `battle_yron` = `battle_yron` + "' . $yron . '", - `battle_exp` = `battle_exp` + "' . round($this->testExp($yron, $this->stats[$this->uids[$u1]], - $this->stats[$this->uids[$u2]], $u1, $u2)) . '" - WHERE `id` = "' . $u1 . '" LIMIT 1'); - // - mysql_query('UPDATE `stats` SET - `last_hp` = "' . $this->users[$this->uids[$u2]]['last_hp'] . '" - WHERE `id` = "' . $u2 . '" LIMIT 1'); - } - $this->addNewStat( - [ - 1 => [ - 'battle' => $this->info['id'], - 'uid1' => $this->users[$this->uids[$u1]]['id'], - 'uid2' => $this->users[$this->uids[$u2]]['id'], - 'time' => time(), - 'type' => 0, - 'a' => '10000', - 'b' => 0, - 'type_a' => 1, - 'type_b' => 0, - 'ma' => 1, - 'mb' => 1, - 'yrn' => $yron, - 'yrn_krit' => 0, - 'tm1' => $this->users[$this->uids[$u1]]['team'], - 'tm2' => $this->users[$this->uids[$u2]]['team'], - ], - ] - ); - } - - // - public $restart_stats_data = []; - - public function a_restart_stats($uid1, $glob) - { - if ($uid1 > 0 && isset($this->restart_stats_data[$uid1])) { - $this->stats[$this->uids[$uid1]] = $this->restart_stats_data[$uid1]; - if ($glob == 1) { - unset($this->restart_stats_data[$uid1]); - } - } - } - - public function a_save_stats($uid1) - { - if ($uid1 > 0) { - $this->restart_stats_data[$uid1] = $this->stats[$this->uids[$uid1]]; - } - } - - public function a_testing_stats($uid1, $zona) - { - //$this->stats[$this->uids[$uid1]] = $this->yronGetrazmenStats( $this->stats[$this->uids[$uid1]] , $zona ); - if ($uid1 > 0) { - $this->stats[$this->uids[$uid1]] = $this->yronGetrazmenStats($this->stats[$this->uids[$uid1]], $zona); - } - } - - public $import_atack = []; - public $contr = []; - public $import_user = 0; - - public function startAtack($id) - { - global $c, $u, $log_text, $priem; - // - $this->prlog = []; - // - $this->inport_user = 0; - // - $vrm = [ - 'uid1' => $this->atacks[$id]['uid1'], - '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) { - // - $i = 1; - $j = 2; - $k = 0; - $unpr = ''; - while ($i <= 2) { - $untac = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `v1` = "priem" AND `v2` = "217" AND `uid` = "' . $this->atacks[$id]['uid' . $i] . '" AND `delete` = 0 LIMIT 1')); - - $agrs = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `v1` = "priem" AND `v2` = "211" AND `uid` = "' . $this->atacks[$id]['uid' . $j] . '" AND `delete` = 0 LIMIT 1')); - - if (isset($untac['id']) && !isset($agrs['id'])) { - // AND `a`.`v2` != 235 // AND `a`.`v2` != 273 AND `a`.`v2` != 286 AND `a`.`v2` != 287 AND `a`.`v2` != 288 - - $pvr['sp'] = mysql_query('SELECT `a`.* FROM `eff_users` AS `a` WHERE `a`.`uid` = "' . $this->atacks[$id]['uid' . $j] . '" AND `a`.`delete` = 0 AND `a`.`v1` = "priem" - - AND `a`.`v2` != 222 - - AND `a`.`v2` != 238 - - AND `a`.`v2` != 228 - AND `a`.`v2` != 229 - - AND `a`.`v2` != 139 - AND `a`.`v2` != 188 - AND `a`.`v2` != 226 - AND `a`.`v2` != 211 - AND `a`.`v2` != 49 - AND `a`.`v2` != 233 - AND `a`.`v2` != 227 - AND `a`.`v2` != 220 - AND `a`.`v2` != 191 - AND `a`.`v2` != 332 - AND `a`.`v2` != 333 - AND `a`.`v2` != 334 - AND `a`.`v2` != 335 - AND `a`.`v2` != 236 - - AND `a`.`v2` != 201 - - AND `a`.`v2` != 261 AND `a`.`v2` != 262 AND `a`.`v2` != 206 AND `a`.`v2` != 207 AND `a`.`v2` != 208 AND `a`.`v2` != 209 - AND `a`.`v2` != 210 AND `a`.`v2` != 284 - AND `a`.`v2` != 263 AND `a`.`v2` != 258 AND `a`.`v2` != 29 AND `a`.`v2` != 30 - AND `a`.`v2` != 31 AND `a`.`v2` != 32 AND `a`.`v2` != 256 AND `a`.`v2` != 249 - AND `a`.`v2` != 248 AND `a`.`v2` != 187 AND `a`.`v2` != 245 AND `a`.`v2` != 175 - AND `a`.`v2` != 176 AND `a`.`v2` != 177 AND `a`.`v2` != 178 AND `a`.`v2` != 179 - AND `a`.`v2` != 285 AND `a`.`v2` != 36 AND `a`.`v2` != 85 AND `a`.`v2` != 86 - AND `a`.`v2` != 87 AND `a`.`v2` != 88 AND `a`.`v2` != 89 AND `a`.`v2` != 90 - AND `a`.`v2` != 269 AND `a`.`v2` != 276 AND `a`.`v2` != 277 AND `a`.`v2` != 270 - AND `a`.`v2` != 174 - AND `a`.`v2` != 324 - - AND `a`.`v2` != 217 - - AND `name` NOT LIKE "%%" - - LIMIT 30'); - while ($pvr['pl'] = mysql_fetch_array($pvr['sp'])) { - $pvr['pl']['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $pvr['pl']['v2'] . '" LIMIT 1')); - if (isset($pvr['pl']['priem']['id']) && $pvr['pl']['priem']['neg'] == 0) { - $this->delPriem($pvr['pl'], $this->users[$this->uids[$this->atacks[$id]['uid' . $j]]], 100); - } - } - // - $k++; - } - $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) { - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['s6'] / 4 < $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['level']) { - $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'] += floor($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['level'] + $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['hod_minmana']); - } else { - $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->users[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'] = $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['mpNow']; - } - // - if ($this->atacks[$id]['out2'] == 0) { - if ($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['s6'] / 4 < $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['level']) { - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'] += floor($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['level'] + $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['hod_minmana']); - } else { - $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]['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) { - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['m3'] -= round($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['antm3']); - } - 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 = [ - 1 => $this->users[$this->uids[$this->atacks[$id]['uid1']]]['battle_yron'], - 2 => $this->users[$this->uids[$this->atacks[$id]['uid2']]]['battle_yron'], - ]; - - // - $this->testZonb($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2']); - - // - $this->magicItems($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], $id); - $this->magicItems($this->atacks[$id]['uid2'], $this->atacks[$id]['uid1'], $id); - - // - $this->priemsRazmen($id, $at); - $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); // - - $at = $this->mf1Razmen($id, $at, $v); // - $at = $this->mf5Razmen($id, $at, $v); // - - $at = $this->yronRazmen($id, $at); // - - // - //['effects'][ - // - $at = $this->priemsTestRazmen($id, $at); - // ( .) - $at = $this->priemsRestartRazmen($id, $at); // ( ) - // - - // - if (count($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['set_pog']) > 0) { - $this->testPogB($this->atacks[$id]['uid1'], 1, $id, 1); - } - if (count($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['set_pog']) > 0) { - $this->testPogB($this->atacks[$id]['uid2'], 1, $id, 1); - } - - // - $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']); - // - $zd1 = explode('|', $this->users[$this->uids[$this->atacks[$id]['uid1']]]['priems_z']); - $zd2 = explode('|', $this->users[$this->uids[$this->atacks[$id]['uid2']]]['priems_z']); - $zd1id = explode('|', $this->users[$this->uids[$this->atacks[$id]['uid1']]]['priems']); - $zd2id = explode('|', $this->users[$this->uids[$this->atacks[$id]['uid2']]]['priems']); - // - $prmos = []; - // - $i5 = 0; - - 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; - } - $i5++; - } - unset($prmos); - - if ($this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy'] == $this->users[$this->uids[$this->atacks[$id]['uid2']]]['id']) { - $this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy'] = -$this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy']; - } - - if ($this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy'] == $this->users[$this->uids[$this->atacks[$id]['uid1']]]['id']) { - $this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy'] = -$this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy']; - } - - $this->users[$this->uids[$this->atacks[$id]['uid1']]]['priems_z'] = implode('|', $zd1); - $this->users[$this->uids[$this->atacks[$id]['uid2']]]['priems_z'] = implode('|', $zd2); - if ($this->atacks[$id]['uid1'] == $u->info['id']) { - $u->info['priems_z'] = implode('|', $zd1); - } elseif ($this->atacks[$id]['uid2'] == $u->info['id']) { - $u->info['priems_z'] = implode('|', $zd2); - } - // - // - $i = 1; - while ($i <= 6) { - if ($this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic' . $i] > 25) { - $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic' . $i] = 25; - } elseif ($this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic' . $i] <= 0) { - $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic' . $i] = 0; - } - if ($this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic' . $i] > 25) { - $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic' . $i] = 25; - } elseif ($this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic' . $i] <= 0) { - $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic' . $i] = 0; - } - $i++; - } - // - // - mysql_query('UPDATE `items_users` SET `btl_zd` = `btl_zd` - 1 WHERE (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '") AND `btl_zd` > 0 AND `inOdet` > 0 LIMIT 100'); - - mysql_query('UPDATE `users` SET `notrhod` = "-1" WHERE `id` = "' . $this->atacks[$id]['uid1'] . '" OR `id` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 2'); - - // - mysql_query('UPDATE `pirogi` SET `hod` = `hod` - 1 WHERE `btl` = "' . $this->info['id'] . '" AND (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '")'); - mysql_query('UPDATE `tactic` SET `hod` = `hod` - 1 WHERE `btl` = "' . $this->info['id'] . '" AND (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '")'); - - // - mysql_query('DELETE FROM `pirogi` WHERE `btl` = "' . $this->info['id'] . '" AND `hod` < 1'); - mysql_query('DELETE FROM `tactic` WHERE `btl` = "' . $this->info['id'] . '" AND `hod` < 1'); - - // - mysql_query('UPDATE `spells` SET `hod` = `hod` - 1 WHERE `btl` = "' . $this->info['id'] . '" AND (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '")'); - mysql_query('DELETE FROM `spells` WHERE `btl` = "' . $this->info['id'] . '" AND `hod` < 1'); - - - // battle_users - mysql_query('UPDATE `battle_users` SET `hp` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['hpNow'] . '" - WHERE `battle` = "' . $this->info['id'] . '" AND `uid` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1'); - mysql_query('UPDATE `battle_users` SET `hp` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['hpNow'] . '" - WHERE `battle` = "' . $this->info['id'] . '" AND `uid` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1'); - // 25% - - $last_yrn = [ - 1 => $last_yrn[1], - 2 => $last_yrn[2], - 10 => $this->users[$this->uids[$this->atacks[$id]['uid1']]]['battle_yron'], - 20 => $this->users[$this->uids[$this->atacks[$id]['uid2']]]['battle_yron'], - ]; - - $last_yrn[100] = floor($last_yrn[10] - $last_yrn[1]); - $last_yrn[200] = floor($last_yrn[20] - $last_yrn[2]); - - 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) { - $this->save_stats($this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod'])); - } - mysql_query('UPDATE `stats` SET - - `hpNow` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['hpNow'] . '", - `mpNow` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'] . '", - `tactic1` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic1'] . '", - `tactic2` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic2'] . '", - `tactic3` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic3'] . '", - `tactic4` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic4'] . '", - `tactic5` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic5'] . '", - `tactic6` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic6'] . '", - `tactic7` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic7'] . '", - - `enemy` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy'] . '", - `battle_yron` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['battle_yron'] . '", - `last_hp` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['last_hp'] . '", - `battle_exp` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['battle_exp'] . '", - `priems_z` = "' . $this->users[$this->uids[$this->atacks[$id]['uid1']]]['priems_z'] . '" - - WHERE `id` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1'); - // - mysql_query('UPDATE `stats` SET - - `hpNow` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['hpNow'] . '", - `mpNow` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'] . '", - `tactic1` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic1'] . '", - `tactic2` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic2'] . '", - `tactic3` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic3'] . '", - `tactic4` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic4'] . '", - `tactic5` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic5'] . '", - `tactic6` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic6'] . '", - `tactic7` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic7'] . '", - - `enemy` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy'] . '", - `battle_yron` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['battle_yron'] . '", - `last_hp` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['last_hp'] . '", - `battle_exp` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['battle_exp'] . '", - `priems_z` = "' . $this->users[$this->uids[$this->atacks[$id]['uid2']]]['priems_z'] . '" - - WHERE `id` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1'); - // - $this->priemsRazmenMomentEnd($id, $at); - // - - // - // \ - $j = 1; - $jn = 1; - while ($j <= 2) { - $eff = $this->stats[$this->uids[$this->atacks[$id]['uid' . $j]]]['effects']; - $i = 0; - while ($i < count($eff)) { - if (isset($eff[$i])) { - if ($eff[$i]['timeUse'] == 77 && $eff[$i]['hod'] > -1) { - $eff[$i]['hod']--; - $eff[$i]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $eff[$i]['v2'] . '" LIMIT 1')); - if (round($eff[$i]['priem']['minmana'] * $eff[$i]['x']) != 0) { - // - $priem->minMana($eff[$i]['user_use'], - round($eff[$i]['priem']['minmana'] * $eff[$i]['x'])); - if ($this->stats[$this->uids[$eff[$i]['user_use']]]['mpNow'] <= 0) { - $eff[$i]['hod'] = 0; - } - } - if (strripos($eff[$i]['data'], 'minprocmanahod')) { - $pvr = [ - 'x1' => 0, - 'x2' => 0, - 'd' => '', - 'i' => 0, - 'uid' => $eff[$i]['uid'], - 'color' => '', - 'color2' => '', - 'effx' => '', - 'x' => $eff[$i]['name'], - ]; - $pvr['d'] = explode('|', $eff[$i]['data']); - while ($pvr['i'] < count($pvr['d'])) { - if (isset($pvr['d'][$pvr['i']])) { - $pvr['d1'] = explode('=', $pvr['d'][$pvr['i']]); - if ($pvr['d1'][0] == 'minprocmanahod') { - $pvr['d1'] = explode('x', $pvr['d1'][1]); - $pvr['x1'] = $pvr['d1'][0]; - $pvr['x2'] = $pvr['d1'][1]; - } - } - $pvr['i']++; - } - - $pvr['mp'] = round($this->stats[$this->uids[$pvr['uid']]]['mpAll'] / 100 * rand($pvr['x1'], - $pvr['x2'])); - $pvr['mpSee'] = 0; - $pvr['mpNow'] = floor($this->stats[$this->uids[$pvr['uid']]]['mpNow']); - $pvr['mpAll'] = $this->stats[$this->uids[$pvr['uid']]]['mpAll']; - $pvr['mpTr'] = $pvr['mpAll'] - $pvr['mpNow']; - - //$pvr['mp'] = $btl->hphe( $u->info['id'] , $pvr['hp'] ); - - if ($pvr['mpTr'] > 0) { - // - if ($pvr['mpTr'] < $pvr['mp']) { - $pvr['mp'] = $pvr['mpTr']; - } - $pvr['mpSee'] = '+' . $pvr['mp']; - $pvr['mpNow'] += $pvr['mp']; - } - if ($pvr['mpNow'] > $pvr['mpAll']) { - $pvr['mpNow'] = $pvr['mpAll']; - } elseif ($pvr['mpNow'] < 0) { - $pvr['mpNow'] = 0; - } - if ($pvr['mpSee'] == 0) { - $pvr['mpSee'] = '--'; - } - - $btl->stats[$btl->uids[$pvr['uid']]]['mpNow'] = $pvr['mpNow']; - $btl->users[$btl->uids[$pvr['uid']]]['mpNow'] = $pvr['mpNow']; - mysql_query('UPDATE `stats` SET `mpNow` = "' . $btl->stats[$btl->uids[$pvr['uid']]]['mpNow'] . '" WHERE `id` = "' . $pvr['uid'] . '" LIMIT 1'); - - $pvr['text'] = $this->addlt(1, 21, $this->users[$this->uids[$pvr['uid']]]['sex'], null); - $pvr['text2'] = '{tm1} ' . $pvr['text'] . ' ' . $pvr['mpSee'] . ' [' . $pvr['mpNow'] . '/' . $pvr['mpAll'] . '] ()'; - $this->priemAddLog($id, 1, 2, $pvr['uid'], 0, - '' . $pvr['x'] . '', - $pvr['text2'], - ($this->hodID + 0) - ); - //echo '[ '.round(rand($pvr['x1'],$pvr['x2'])).'% .]'; - unset($pvr); - } - - if (isset($this->rehodeff[$eff[$i]['id']])) { - $eff[$i]['hod'] = $this->rehodeff[$eff[$i]['id']]; - } - if ($eff[$i]['hod'] > 0) { - $this->stats[$this->uids[$this->atacks[$id]['uid' . $j]]]['effects']['hod'] = $eff[$i]['hod']; - mysql_query('UPDATE `eff_users` SET `hod` = "' . $eff[$i]['hod'] . '" WHERE `id` = "' . $eff[$i]['id'] . '" LIMIT 1'); - } else { - // - if ($eff[$i]['v2'] > 0) { - if ($j == 1) { - $jn = 2; - } else { - $jn = 1; - } - $this->delPriem($eff[$i], $this->users[$this->uids[$this->atacks[$id]['uid' . $j]]], - 3, $this->atacks[$id]['uid' . $jn]); - } - } - } elseif ($eff[$i]['timeUse'] == 77 && $eff[$i]['hod'] == -2) { - $eff[$i]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $eff[$i]['v2'] . '" LIMIT 1')); - $priem->hodUsePriem($eff[$i], $eff[$i]['priem']); - } else { - $eff[$i]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $eff[$i]['v2'] . '" LIMIT 1')); - if (isset($eff[$i]['priem']['minmana']) && round($eff[$i]['priem']['minmana'] * $eff[$i]['x']) != 0) { - // - $priem->minMana($eff[$i]['user_use'], - round($eff[$i]['priem']['minmana'] * $eff[$i]['x'])); - if ($this->stats[$this->uids[$eff[$i]['user_use']]]['mpNow'] <= 0) { - $eff[$i]['hod'] = 0; - if (isset($this->rehodeff[$eff[$i]['id']])) { - $eff[$i]['hod'] = $this->rehodeff[$eff[$i]['id']]; - } - if ($eff[$i]['v2'] > 0) { - if ($j == 1) { - $jn = 2; - } else { - $jn = 1; - } - $this->delPriem($eff[$i], - $this->users[$this->uids[$this->atacks[$id]['uid' . $j]]], 3, - $this->atacks[$id]['uid' . $jn]); - } - } - } elseif ($eff[$i]['timeUse'] > 100 && $eff[$i]['hod'] > -1 && $c['effz'] > 0) { - $eff[$i]['hod']--; - if (isset($this->rehodeff[$eff[$i]['id']])) { - $eff[$i]['hod'] = $this->rehodeff[$eff[$i]['id']]; - } - if ($eff[$i]['hod'] > 0) { - $this->stats[$this->uids[$this->atacks[$id]['uid' . $j]]]['effects']['hod'] = $eff[$i]['hod']; - mysql_query('UPDATE `eff_users` SET `hod` = "' . $eff[$i]['hod'] . '" WHERE `id` = "' . $eff[$i]['id'] . '" LIMIT 1'); - } else { - // - if ($eff[$i]['v2'] > 0) { - if ($j == 1) { - $jn = 2; - } else { - $jn = 1; - } - $this->delPriem($eff[$i], - $this->users[$this->uids[$this->atacks[$id]['uid' . $j]]], 3, - $this->atacks[$id]['uid' . $jn]); - } - } - } - // - } - } - $i++; - } - $j++; - } - // - // - // - if ($c['propsk_die'] > 0 && $this->info['razdel'] == 0 && $this->info['dn_id'] == 0 && $this->info['izlom'] == 0) { - $cn1 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `battle_out` WHERE `battle` = "' . $this->info['id'] . '" AND `uid1` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1')); - $cn2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `battle_out` WHERE `battle` = "' . $this->info['id'] . '" AND `uid1` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1')); - if ($cn1[0] > 3) { - // - $pvr['text2'] = '{tm1} {u1} - .'; - $this->priemAddLog($id, 1, 2, $this->atacks[$id]['uid1'], 0, '', - $pvr['text2'], - ($this->hodID + 0) - ); - unset($pvr); - mysql_query('UPDATE `stats` SET `hpNow` = 0 WHERE `id` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1'); - } - if ($cn2[0] > $c['propsk_die']) { - $pvr['text2'] = '{tm1} {u1} - .'; - $this->priemAddLog($id, 1, 2, $this->atacks[$id]['uid2'], 0, '', - $pvr['text2'], - ($this->hodID + 0) - ); - unset($pvr); - mysql_query('UPDATE `stats` SET `hpNow` = 0 WHERE `id` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1'); - } - } - // - // - if ($u->info['id'] == $this->atacks[$id]['uid1']) { - $u->info['enemy'] = $this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy']; - } - if ($u->info['id'] == $this->atacks[$id]['uid2']) { - $u->info['enemy'] = $this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy']; - } - // // - 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); - // - } - } - - // - public function save_stats($uid) - { - mysql_query('UPDATE `stats` SET - - `hpNow` = "' . $this->stats[$this->uids[$uid]]['hpNow'] . '", - `mpNow` = "' . $this->stats[$this->uids[$uid]]['mpNow'] . '", - `tactic1` = "' . $this->users[$this->uids[$uid]]['tactic1'] . '", - `tactic2` = "' . $this->users[$this->uids[$uid]]['tactic2'] . '", - `tactic3` = "' . $this->users[$this->uids[$uid]]['tactic3'] . '", - `tactic4` = "' . $this->users[$this->uids[$uid]]['tactic4'] . '", - `tactic5` = "' . $this->users[$this->uids[$uid]]['tactic5'] . '", - `tactic6` = "' . $this->users[$this->uids[$uid]]['tactic6'] . '", - `tactic7` = "' . $this->users[$this->uids[$uid]]['tactic7'] . '", - - `enemy` = "' . $this->users[$this->uids[$uid]]['enemy'] . '", - `battle_yron` = "' . $this->users[$this->uids[$uid]]['battle_yron'] . '", - `last_hp` = "' . $this->users[$this->uids[$uid]]['last_hp'] . '", - `battle_exp` = "' . $this->users[$this->uids[$uid]]['battle_exp'] . '", - `priems_z` = "' . $this->users[$this->uids[$uid]]['priems_z'] . '" - - WHERE `id` = "' . $uid . '" LIMIT 1'); - } - - // - public function hpSee($now, $all, $type = 1) - { - $r = '[' . $now . '/' . $all . ']'; - if ($all > 10000) { - $type = 2; - } - if ($type == 1) { - } elseif ($type == 2) { - $p1 = floor($now / $all * 100); - $r = '[' . $p1 . '/100%]'; - } - return $r; - } - - // - public function addFlog($t, $u1, $u2) - { - $vLog = ''; - if (isset($this->info[$this->uids[$u1]]['id'])) { - $vLog .= 'time1=' . time() . '||s1=' . $this->users[$this->uids[$u1]]['id']['sex'] . '||t1=' . $this->users[$this->uids[$u1]]['team'] . '||login1=' . $this->users[$this->uids[$u1]]['login'] . '||'; - } - if (isset($this->info[$this->uids[$u2]]['id'])) { - $vLog .= 'time2=' . time() . '||s2=' . $this->users[$this->uids[$u2]]['sex'] . '||t2=' . $this->users[$this->uids[$u2]]['team'] . '||login2=' . $this->users[$this->uids[$u2]]['login'] . ''; - } - $vLog = rtrim($vLog, '||'); - $mas1 = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => '', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $mas1['text'] = $t; - $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}',''.date('H:i',$pl['time']).'',$rt); - $rt = str_replace('{tm2}',''.date('H:i',$pl['time']).'',$rt); - $rt = str_replace('{tm3}',''.date('d.m.Y H:i',$pl['time']).'',$rt); - $rt = str_replace('{tm4}',''.date('d.m.Y H:i',$pl['time']).'',$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('"','"',$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}',''.date('H:i',$pl['time']).'',$rt); - $rt = str_replace('{tm2}',''.date('H:i',$pl['time']).'',$rt); - $rt = str_replace('{tm3}',''.date('d.m.Y H:i',$pl['time']).'',$rt); - $rt = str_replace('{tm4}',''.date('d.m.Y H:i',$pl['time']).'',$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('"','"',$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() - { - global $c, $u, $log_text; - $hodID = mysql_fetch_array(mysql_query('SELECT `id`,`id_hod` FROM `battle_logs` WHERE `battle` = "' . $this->info['id'] . '" ORDER BY `time` ASC LIMIT 1')); - if ($hodID['id_hod'] <= 1) { - $u->info['alog'] = 0; - } - if (isset($hodID['id']) && $this->info['team_win'] != -1) { - $hodID = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_logs_save` WHERE `battle` = "' . $this->info['id'] . '" ORDER BY `time` ASC LIMIT 1')); - } - if (isset($hodID['id'])) { - $hodID = $hodID['id']; - } else { - $hodID = 0; - } - - $updt = 0; - if ($u->info['design'] == 1) { - $js = ''; - $pll = 0; - if ($_POST['idlog'] < 1) { - $_POST['idlog'] = 0; - } - $talog = mysql_fetch_array(mysql_query('SELECT `alog` FROM `stats` WHERE `id` = "' . $u->info['id'] . '" LIMIT 1')); - $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_hod` >= ' . $talog['alog'] . ' ORDER BY `id` DESC'); - if (isset($sp) && $this->info['team_win'] != -1) { - $sp = mysql_query('SELECT - `id`,`type`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zona2`,`zonb1`,`zonb2` - FROM `battle_logs_save` - WHERE `battle` = "' . $this->info['id'] . '" AND `id_hod` >= ' . $talog['alog'] . ' ORDER BY `id` DESC'); - } - $jin = 0; - $forYou2 = 0; - while ($pl = mysql_fetch_array($sp)) { - if ($jin == 0) { - $u->info['alog'] = $pl['id_hod']; - } - $jin++; - if ((true == false) && ($pl['type'] == 1 || $pl['type'] == 6)) { - } else { - $rt = $pl['text']; - //$rt = str_replace('^^^^','=',$rt); - $pl['vars'] = str_replace('^^^^', 'rvnO', $pl['vars']); - $rt = str_replace('{tm1}', '' . date('H:i', $pl['time']) . '', - $rt); - $rt = str_replace('{tm2}', '' . date('H:i', $pl['time']) . '', - $rt); - $rt = str_replace('{tm3}', - '' . date('d.m.Y H:i', $pl['time']) . '', $rt); - $rt = str_replace('{tm4}', - '' . date('d.m.Y H:i', $pl['time']) . '', $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('"', - '"', $pl['vars']) . '");' . $js; - } - mysql_query('UPDATE `stats` SET `alog`="' . $u->info['alog'] . '" WHERE `id` ="' . $u->info['id'] . '" LIMIT 1'); - $js .= 'id_log=' . $pll . ';'; - } else { - $js = ''; - $pll = 0; - if ($_POST['idlog'] < 1) { - $_POST['idlog'] = 0; - } - $talog = mysql_fetch_array(mysql_query('SELECT `alog` FROM `stats` WHERE `id` = "' . $u->info['id'] . '" LIMIT 1')); - $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_hod` >= ' . $talog['alog'] . ' ORDER BY `id` DESC'); - if (isset($sp) && $this->info['team_win'] != -1) { - $sp = mysql_query('SELECT - `id`,`type`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zona2`,`zonb1`,`zonb2` - FROM `battle_logs_save` - WHERE `battle` = "' . $this->info['id'] . '" AND `id_hod` >= ' . $talog['alog'] . ' ORDER BY `id` DESC'); - } - $jin = 0; - $forYou2 = 0; - while ($pl = mysql_fetch_array($sp)) { - if ($jin == 0) { - $u->info['alog'] = $pl['id_hod']; - } - $jin++; - $rt = $pl['text']; - //$rt = str_replace('^^^^','=',$rt); - $pl['vars'] = str_replace('^^^^', 'rvnO', $pl['vars']); - $rt = str_replace('{tm1}', '' . date('H:i', $pl['time']) . '', $rt); - $rt = str_replace('{tm2}', '' . date('H:i', $pl['time']) . '', $rt); - $rt = str_replace('{tm3}', '' . date('d.m.Y H:i', $pl['time']) . '', - $rt); - $rt = str_replace('{tm4}', '' . date('d.m.Y H:i', $pl['time']) . '', - $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('"', - '"', $pl['vars']) . '");' . $js; - } - mysql_query('UPDATE `stats` SET `alog`="' . $u->info['alog'] . '" WHERE `id` ="' . $u->info['id'] . '" LIMIT 1'); - $js .= 'id_log=' . $pll . ';'; - } - - - return $js; - } - -// - public function lookmLog() - { - global $c, $u, $log_text; - $js = ''; - $pll = 0; - - if ($this->info['type'] != 9) { - $hodID = mysql_fetch_array(mysql_query('SELECT `id`,`id_hod` FROM `battle_logs` WHERE `battle` = "' . $this->info['id'] . '" ORDER BY `time` ASC LIMIT 1')); - if ($hodID['id_hod'] <= 1) { - $u->info['mlog'] = 0; - } - if (isset($hodID['id']) && $this->info['team_win'] != -1) { - $hodID = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_logs_save` WHERE `battle` = "' . $this->info['id'] . '" ORDER BY `time` ASC LIMIT 1')); - } - if (isset($hodID['id'])) { - $hodID = $hodID['id']; - } else { - $hodID = 0; - } - $tmlog = mysql_fetch_array(mysql_query('SELECT `mlog` FROM `stats` WHERE `id` = "' . $u->info['id'] . '" LIMIT 1')); - $spm = 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_hod` >= ' . $tmlog['mlog'] . ' AND `vars` LIKE "%' . $u->info['login'] . '%" ORDER BY `id` DESC'); - - if (isset($spm) && $this->info['team_win'] != -1) { - $spm = mysql_query('SELECT - `id`,`type`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zona2`,`zonb1`,`zonb2` - FROM `battle_logs_save` - WHERE `battle` = "' . $this->info['id'] . '" AND `id_hod` >= ' . $tmlog['mlog'] . ' AND `vars` LIKE "%' . $u->info['login'] . '%" ORDER BY `id` DESC'); - } - - $jin = 0; - $forYou2 = 0; - - while ($plm = mysql_fetch_array($spm)) { - if ($jin == 0) { - $u->info['mlog'] = $plm['id_hod']; - } - $jin++; - $rt = $plm['text']; - $plm['vars'] = str_replace('^^^^', 'rvnO', $plm['vars']); - $rt = str_replace('{tm1}', '' . date('H:i', $plm['time']) . '', $rt); - $rt = str_replace('{tm2}', '' . date('H:i', $plm['time']) . '', $rt); - $rt = str_replace('{tm3}', '' . date('d.m.Y H:i', $plm['time']) . '', - $rt); - $rt = str_replace('{tm4}', '' . date('d.m.Y H:i', $plm['time']) . '', - $rt); - $plm['text'] = $rt; - unset($rt); - if ($pll < $plm['id']) { - $pll = $plm['id']; - } - $js = 'add_mlog(' . $plm['id'] . ',' . $forYou2 . ',"' . $plm['text'] . '",' . $plm['id_hod'] . ',0,0,"' . str_replace('"', - '"', $plm['vars']) . '");' . $js; - } - $js .= 'id_mlog=' . $pll . ';'; - mysql_query('UPDATE `stats` SET `mlog`="' . $u->info['mlog'] . '" WHERE `id` ="' . $u->info['id'] . '" LIMIT 1'); - } - return $js; - } -//====================== - - // - public function add_log($mass) - { - if (empty($mass['text'])) { - return; - } - mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`type`) VALUES (unix_timestamp(), "' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $mass['text'] . '","' . $mass['vars'] . '","' . $mass['type'] . '")'); - if (rand(2, 10) == 10) { - $this->get_comment(); - } - } - - /// - public function get_comment() - { - $boycom = [ - ' .', - ' , ?', - ' ?', - ', -, ? ! !', - ' .', - ' . ', - ' ...', - ' ...', - ' ?', - ' , !?', - ' ?', - ' -, :', - ' - ?', - ' , ', - ' ?!', - ' . ?', - ' ...', - ' !', - ' !', - ' , !', - ' .', - ' 5 , , 20- ...', - '. .', - ' , - ?', - ' , ?', - ' ... : ...', - ' , ?', - ' , ', - ' . ... , , ', - ' !', - ' ? , .', - ' ! !', - ' !', - ', , ` ` ', - ' ?!', - ' ! .', - ' . ? .', - ' !', - ', ... !.. , .', - ' , !', - ' -, ...', - ' - , :)', - ' .', - ' - !!!', - '! ! ! !', - ' !', - ' ? . , .', - ' . .', - ' ...', - ' ...', - ' !!!', - '!? ?!', - ' ?', - ', ...', - ' .', - ' !', - ' , - .', - ', , , .', - ' !', - ', - ???', - ' , .', - ' ? !', - ', !', - ' , ...', - ' . !', - '! ! ... , .', - ', , ?', - ', !', - ' !', - ' , ... , ... ?!', - ' ?', - ' . .', - ', ..? . , .', - '... .', - '!!!.... ...', - '! .', - '! , !', - ' ???', - ' ... - .', - ', ...', - ' !', - '-, - .', - ' , .', - ' , ?', - ' - .', - ', .', - ' !', - ' , .', - ' ... , !', - ' ...', - ' !', - ' !', - ' ', - ' , .', - ' , .', - ' - .', - ' !', - ' ', - ' ...', - ' , !', - '!! , ...', - ' ! .', - ', !', - ', , ?', - ', , .', - ' !', - ' !', - '-!', - ' ?! !', - ' , ', - ' - ...', - ' , ! !', - ' , .', - ' ', - ' `` ?', - ' - ...', - ' , - .', - ' . :)', - ' , , , . ? - ?!', - ' , ...', - '( ) ... !', - '< > < > < > < >', - '< > ', - ]; - //$act_com = array(); - if (rand(1, 6) == rand(1, 6)) { - $txt = '{tm1} : ' . $boycom[rand(0, count($boycom) - 1)] . ''; - - $vLog = 'time1=' . time() . ''; - $mas1 = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => '', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $mas1['text'] = $txt; - $this->add_log($mas1); - } else { - return false; - } - } - - // - public function weaponTx($item) - { - global $u; - $tp = 0; - if (!isset($item['id'])) { - $i = 1; - while ($i <= 4) { - $itm['tya' . $i] = 1; - $i++; - } - } - $itm = $u->lookStats($item['data']); - $t[0]['z'] = 0; - $t[0]['t'] = 0; - // - $t[1]['z'] = round(0 + $itm['tya1']); - $t[1]['t'] = 1; - // - $t[2]['z'] = round(0 + $itm['tya2']); - $t[2]['t'] = 2; - // - $t[3]['z'] = round(0 + $itm['tya3']); - $t[3]['t'] = 3; - // - $t[4]['z'] = round(0 + $itm['tya4']); - $t[4]['t'] = 4; - // - $t[5]['z'] = round(0 + $itm['tym1']); - $t[5]['t'] = 5; - // - $t[6]['z'] = round(0 + $itm['tym2']); - $t[6]['t'] = 6; - // - $t[7]['z'] = round(0 + $itm['tym3']); - $t[7]['t'] = 7; - // - $t[8]['z'] = round(0 + $itm['tym4']); - $t[8]['t'] = 8; - // - $t[9]['z'] = round(0 + $itm['tym5']); - $t[9]['t'] = 9; - // - $t[10]['z'] = round(0 + $itm['tym6']); - $t[10]['t'] = 10; - // - $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'.$this->info['id'].'.( : 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]; - $i = 1; - - while ($i <= 11) { - if ($t[$i]['z'] > $tpt) { - $tpt = $t[$i]['z']; - $tpmax = $t[$i]; - $ii = $i; - } - $i++; - } - $t[$ii]['z'] = 0; - - $tpt = $t[0]['z']; - $i = 1; - while ($i <= 11) { - if ($t[$i]['z'] > $tpt) { - $tpt = $t[$i]['z']; - $tpmin = $t[$i]; - } - $i++; - } - - $setclass = rand(1, 100); - - if ($setclass > $tpmax['z']) { - $tp = $tpmin['t']; - } else { - $tp = $tpmax['t']; - } - - - return $tp; - } - - // - /*public function error($login,$t) { - mysql_query('INSERT INTO `chat_system` (`text`,`city`,`login`,`to`,`type`,`new`,`time`) VALUES ("'.mysql_real_escape_string($t).'","capitalcity","","'.$login.'","3","1","'.time().'")'); - }*/ - - - // - public function weaponAt($item, $st, $x) - { - $tp = 0; - $tp20 = 0; - if (isset($item['id'])) { - $itm = $this->lookStats($item['data']); - // - $min = $itm['sv_yron_min'] + $itm['yron_min'] + $st['minAtack']; - $max = $itm['sv_yron_max'] + $itm['yron_max'] + $st['maxAtack']; - if ($x != 0) { - /* - - 60% 40% . - - 70% 20% 20% . - - 100% . - - 60% 40% . - */ - // : 0 - , 1 - , 2 - , 3 - , 4 - , 5 - , 6 - , 7 - , 8 - , 9 - , 10 - , 11 - - if ($x == 1) { - // - $wst = $st['s2'] * 1; - $min += 5 + (ceil($wst * 1.4) / 1.25) + $st['minAtack']; - $max += 7 + (ceil(0.4 + $min / 0.9) / 1.25) + $st['maxAtack']; - $tp20 = 1; - } elseif ($x == 2) { - // - $wst = $st['s1'] * 0.75; - $min += 5 + (ceil($wst * 1.4) / 1) + $st['minAtack']; - $max += 7 + (ceil(0.4 + $min / 0.9) / 1.25) + $st['maxAtack']; - $tp20 = 2; - } elseif ($x == 3) { - // - $wst = $st['s4'] * 1.5; - $min += 5 + (ceil($wst * 1.4) / 1.25) + $st['minAtack']; - $max += 7 + (ceil(0.4 + $min / 0.9) / 1.25) + $st['maxAtack']; - $tp20 = 3; - } elseif ($x == 4) { - // - $wst = $st['s3'] * 1; - $min += 5 + (ceil($wst * 1.4) / 1.25) + $st['minAtack']; - $max += 7 + (ceil(0.4 + $min / 0.9) / 1.25) + $st['maxAtack']; - $tp20 = 4; - } elseif ($x >= 5 && $x <= 22) { - // - $wst = $st['s1'] * 0.01 + $st['s2'] * 0.01 + $st['s3'] * 0.01 + $st['s5'] * 0.06; - $min += 3 + (ceil($wst * 1.4) / 2.25) + $st['minAtack']; - $max += 5 + (ceil(0.4 + $min / 0.9) / 2.25) + $st['maxAtack']; - $tp20 = 5; - } else { - // - - } - - $wst = ($st['s1'] * 0.02 + $st['s2'] * 0.02 + $st['s3'] * 0.05); - $min1 = -2 + ceil($wst * 1.4) / 1.25; - $max1 = 4 + ceil(0.4 + $min1 / 0.9) / 1.25; - - $min = round(($min + $min1)); - //$max = round(($max+$max1)); - } - $tp = rand(($min + $max) / 3.5, (($min + $max) / 3.5 + (($min + $max) / 3.5) / 100 * 7)); - } - return $tp; - } - - // - public function weaponAt22($item, $st) - { - $tp = 0; - $tp20 = 0; - if (isset($item['id'])) { - $itm = $this->lookStats($item['data']); - // - $min = $itm['sv_yron_min'] + $itm['yron_min'] + $st['minAtack']; - $max = $itm['sv_yron_max'] + $itm['yron_max'] + $st['maxAtack']; - } - return [$min, $max]; - } - - public function domino($itm) - { - $r = 0; - //0 - inOdet , 1 - class , 2 - class-point , 3 - anti_class , 4 - antic_lass-point , 5 - level , 6 level_u - //15 - $clss = [ - 1 => 100, // - 2 => 80, // - 3 => 150, // - 14 => 100, // - 5 => 200, // - 7 => 50, // - 17 => 50, // - 10 => 80, // - 11 => 80, // - 12 => 80, // - 9 => 100, // - 8 => 100, // - 4 => 50, // - 16 => 80, // - 6 => 50 // - ]; - $r += $clss[$itm[0]]; - if ($itm[10] > 0) { - //. - if ($itm[10] < 500) { - // - $r += $clss[$itm[0]] * 4; - } else { - // - $r += $clss[$itm[0]] * 4; - } - } - return $r; - } - - public function adomino($itm) - { - $r = 0; - //0 - inOdet , 1 - class , 2 - class-point , 3 - anti_class , 4 - antic_lass-point , 5 - level , 6 level_u - //15 - $clss = [ - 1 => 80, // - 2 => 60, // - 3 => 130, // - 14 => 80, // - 5 => 180, // - 7 => 30, // - 17 => 30, // - 10 => 50, // - 11 => 50, // - 12 => 50, // - 9 => 80, // - 8 => 80, // - 4 => 30, // - 16 => 50, // - 6 => 30 // - ]; - $r += $clss[$itm[0]]; - return $r; - } - - public function domino_lvl($r, $lvl, $lvl_itm) - { - if ($lvl < $lvl_itm) { - $r = $r * ((50 - $lvl + $lvl_itm) / 100); - // , . \ , - $r = ceil($r); - } - return $r; - } - /* - public $bal = array( - // X - Y - // , , , , , - '' => array(0,50,90,00,90,50,50), // - '' => array(0,00,50,90,00,50,70), // - '' => array(0,90,00,50,90,30,50), // - '' => array(0,00,90,00,50,50,50), // - '' => array(0,50,30,90,00,50,70), // - '' => array(0,90,30,00,90,50,50) // - ); - */ - - /* - 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 = [ - 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 > 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 yrn( - $st1, - $st2, - $u1, - $u2, - $level, - $level2 = null, - $type, - $min_yron, - $max_yron, - $min_bron = null, - $max_bron = null, - $vladenie, - $power_yron, - $power_krit, - $zashita, - $ozashita = null, - $proboi, - $weapom_damage, - $weapom_min, - $weapom_max, - $za_proc = null, - $zm_proc = null, - $zashitam = null, // pzm ! - $ozashitam = null, - $wp_type, - $witm - ) { - global $u; - - // - if ($zashita < 1) { - $zashita = 1; - } - - if ($min_yron < 1) { - $min_yron = 1; - } - - if ($max_yron < 1) { - $max_yron = 1; - } - - if (!isset($type) || $type == '') { - $type = 12; - } - - // - $r = ['min' => 0, 'max' => 0, 'type' => $type]; - $p = [ - 'Y' => 0, - 'B' => [0 => 0, 1 => 0, 'rnd' => false], - 'L' => $level, - 'W' => [$weapom_min, $weapom_max, 'rnd' => false], // // - 'U' => $vladenie, // - 'M' => $power_yron, // - 'K' => $power_krit, // - 'S' => 0, // . - 'T' => 1, //. - 'iT' => 1, // . . - /* - (S) - - : S = * 0,3 + * 0,7 - : S = * 0,5 + * 0,25 + * 0,25 - : S = * 1 - : S = * 0,3 + * 0,7 - */ - ]; - - //$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']); - - // - - if ($wp_type == 18) { - $r['type'] = 1; - } elseif ($wp_type == 19) { - $r['type'] = 2; - } elseif ($wp_type == 20) { - $r['type'] = 3; - } elseif ($wp_type == 21) { - $r['type'] = 4; - } else { - $r['type'] = 0; - } - // - // - if ($r['type'] == 1) { - $p['S'] = $st1['s1'] * 0.25 + $st1['s2'] * 0.75; - $p['U'] = $st1['a1'] * 1.00; // - // - } elseif ($r['type'] == 2) { - $p['S'] = $st1['s1'] * 1.20; - $p['U'] = $st1['a2'] * 1.00; // - // - } elseif ($r['type'] == 3) { - $p['S'] = $st1['s1'] * 0.5 + $st1['s4'] * 1.00; - $p['U'] = $st1['a3'] * 1.00; // - // - } elseif ($r['type'] == 4) { - $p['S'] = $st1['s3'] * 1.00; - $p['U'] = $st1['a4'] * 1.00; // - // - } elseif ($r['type'] >= 5 && $r['type'] < 12) { - $p['S'] = $st1['s1'] * 0.5 + $st1['s2'] * 0.5; - $p['U'] = $st1['mg' . ($r['type'] - 4)] * 1.00; // - $p['Mage'] = true; - } else { - $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]); - - // - //$p['Mstart'] = 0; // - if ($r['type'] == 12) { - $r['min'] = ($p['B'][0] + $weapom_min) * $p['T'] * (1 + $p['M'] / 100); - $r['max'] = ($p['B'][1] + $weapom_max) * $p['T'] * (1 + $p['M'] / 100); - } 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%) - if ($r['type'] < 5) { - $r['min'] = round($r['min'] / 100 * (100 - $this->zago($st2['za']))); - $r['max'] = round($r['max'] / 100 * (100 - $this->zago($st2['za']))); - $r['Kmin'] = round($r['Kmin'] / 100 * (100 - $this->zago($st2['za']))); - $r['Kmax'] = round($r['Kmax'] / 100 * (100 - $this->zago($st2['za']))); - } elseif ($r['type'] == 12) { - $r['min'] = round($r['min'] / 100 * (100 - $this->zago($st2['za']))); - $r['max'] = round($r['max'] / 100 * (100 - $this->zago($st2['za']))); - $r['Kmin'] = round($r['Kmin'] / 100 * (100 - $this->zago($st2['za']))); - $r['Kmax'] = round($r['Kmax'] / 100 * (100 - $this->zago($st2['za']))); - } else { - $r['min'] = round($r['min'] / 100 * (100 - $this->zmgo($st2['zm']))); - $r['max'] = round($r['max'] / 100 * (100 - $this->zmgo($st2['zm']))); - $r['Kmin'] = round($r['Kmin'] / 100 * (100 - $this->zmgo($st2['zm']))); - $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']); - $r['Kmax'] = round($r['Kmax']); - - $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; - } - - $r['min'] -= floor($r['min'] / 100 * $min_yrn); - $r['max'] -= floor($r['max'] / 100 * $min_yrn); - $r['Kmin'] -= floor($r['Kmin'] / 100 * ($min_yrn)); - $r['Kmax'] -= floor($r['Kmax'] / 100 * ($min_yrn)); - $r['min_'] -= floor($r['min_'] / 100 * $min_yrn); - $r['max_'] -= floor($r['max_'] / 100 * $min_yrn); - $r['Kmin_'] -= floor($r['Kmin_'] / 100 * ($min_yrn)); - $r['Kmax_'] -= floor($r['Kmax_'] / 100 * ($min_yrn)); - - $defd = mysql_fetch_array(mysql_query('SELECT SUM(`vals`) FROM `battle_actions` WHERE `btl` = "' . $this->info['id'] . '" AND `vars` = "use_defteam' . $u2['team'] . '" LIMIT 1')); - if ($defd[0] > 100) { - $defd[0] = 100; - } - $defd = 0 + $defd[0]; - $powd = mysql_fetch_array(mysql_query('SELECT SUM(`vals`) FROM `battle_actions` WHERE `btl` = "' . $this->info['id'] . '" AND `vars` = "use_powteam' . $u1['team'] . '" LIMIT 1')); - if ($powd[0] > 100) { - $powd[0] = 100; - } - $powd = 0 + $powd[0]; - $defd = $defd - $powd; - - $r['min'] -= floor($defd); - $r['max'] -= floor($defd); - $r['Kmin'] -= floor($defd * 2); - $r['Kmax'] -= floor($defd * 2); - $r['min_'] -= floor($defd); - $r['max_'] -= floor($defd); - $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; - } - if ($r['max'] < 1) { - $r['max'] = 1; - } - if ($r['Kmin'] < 2) { - $r['Kmin'] = 2; - } - if ($r['Kmax'] < 2) { - $r['Kmax'] = 2; - } - if ($r['Kmin_'] < 2) { - $r['Kmin_'] = 2; - } - if ($r['Kmin_'] < 2) { - $r['Kmax_'] = 2; - } - - $r['m_k'] = $r['Kmax']; - - return $r; - } - - public $pr_not_use = [], $pr_reset = [], $pr_yrn = false, $prnt = []; - // - // pl - // u1 - // t1 - // 99 = - // u2 - //$this->delPriem($pd[$k2][1][$k],${'p'.$k2},1,${'p'.$k2jn}); - public $del_val = [], $re_pd = []; - - public function delPriem( - $pl, - $u1, - $t = 1, - $u2 = false, - $rznm = ' ', - $k2nm = null, - $yrn = null, - $yrnt = null - ) { - global $u, $priem; - if (isset($pl['priem']['id']) && !isset($this->del_val['eff'][$pl['priem']['id']])) { - if ($pl['x'] > 1) { - $pl['name'] = $pl['name'] . ' x' . $pl['x'] . ''; - } - if ($pl['timeUse'] == 77) { - // - mysql_query('DELETE FROM `eff_users` WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); - } - $vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login'] . ''; - if (isset($u2['id'])) { - $vLog .= '||s2=' . $u2['sex'] . '||t2=' . $u2['team'] . '||login2=' . $u2['login'] . ''; - } - $mas1 = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => '', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - if ($t == 4) { - $mas1['id_hod']++; - $t = 2; - } - if ($t == 1) { - $mas1['id_hod']++; - if ($pl['priem']['file'] != '0') { - if (file_exists('../../_incl_data/class/priems/' . $pl['priem']['file'] . '.php')) { - require('priems/' . $pl['priem']['file'] . '.php'); - } - } elseif ($pl['priem']['file3'] != '0') { - if (file_exists('../../_incl_data/class/priems/' . $pl['priem']['file3'] . '.php')) { - require('priems/' . $pl['priem']['file3'] . '.php'); - } - } else { - $mas1['text'] = '{tm1} {u1} {1x16x0} "' . $pl['name'] . '".'; - $this->del_val['eff'][$pl['priem']['id']] = true; - } - } elseif ($t == 2) { - $mas1['text'] = '{tm1} {u1} "' . $pl['name'] . '".'; - } elseif ($t == 99) { - $mas1['text'] = '{u1} "' . $pl['name'] . '" ' . $rznm . ' .'; - } else { - if ($t == 100) { - $mas1['id_hod']++; - } - $mas1['text'] = '{tm1} "' . $pl['name'] . '" {u1}.'; - } - if ($pl['priem']['id'] != 24) { - $this->add_log($mas1); - } - $this->stats[$this->uids[$pl['uid']]] = $u->getStats($pl['uid'], 0, 0, false, false, true); - } else { - // - } - } - - public function hodUserPriem($pl, $u1, $t = 1, $u2 = false, $rznm = ' ', $k2nm, $yrn, $yrnt) - { - global $u, $priem; - if (isset($pl['priem']['id']) && !isset($this->del_val['eff'][$pl['priem']['id']])) { - if ($yrnt == 1) { - // - $yrn = round($yrn); - } elseif ($yrnt == 6) { - // - $yrn = 0; - } elseif ($yrnt == 9) { - // - $yrn = 0; - } elseif ($yrnt == 3) { - // - - $yrn = round($yrn * 1.95) + ceil($yrn / 125 * $this->stats[$this->uids[$u1['id']]]['m3']); - } elseif ($yrnt == 4) { - // - - $yrn = round($yrn * 0.45) + ceil($yrn / 125 * $this->stats[$this->uids[$u1['id']]]['m3']); - } else { - // - $yrn = 0; - } - - if ($pl['x'] > 1) { - $pl['name'] = $pl['name'] . ' x' . $pl['x'] . ''; - } - $vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login'] . ''; - if (isset($u2['id'])) { - $vLog .= '||s2=' . $u2['sex'] . '||t2=' . $u2['team'] . '||login2=' . $u2['login'] . ''; - } - $mas1 = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => '', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - if ($t == 4) { - $mas1['id_hod']++; - $t = 2; - } - if ($t == 1) { - $mas1['id_hod']++; - if ($pl['priem']['file'] != '0') { - if (file_exists('../../_incl_data/class/priems/' . $pl['priem']['file'] . '.php')) { - require('priems/' . $pl['priem']['file'] . '.php'); - } - } else { - $mas1['text'] = '{tm1} {u1} {1x16x0} "' . $pl['name'] . '".'; - $this->del_val['eff'][$pl['priem']['id']] = true; - } - } - $this->add_log($mas1); - $this->stats[$this->uids[$pl['uid']]] = $u->getStats($pl['uid'], 0, 0, false, false, true); - } else { - // - } - } - - // - 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; - } - - // - public function bronGo($min, $max) - { - $v = 0; - //$v = ceil(($min+$max)/2,$max); - $v = ceil($min, $max); - return $v; - } - - // (test) - public function bronGoTest($min, $max) - { - $v = 0; - //$v = ceil(($min+$max)/2,$max); - $v = ceil(round($min, $max)); - return $v; - } - - // - public function lookStats($m) - { - $ist = []; - $di = explode('|', $m); - $i = 0; - $de = false; - while ($i < count($di)) { - $de = explode('=', $di[$i]); - $ist[$de[0]] = $de[1]; - $i++; - } - return $ist; - } - - // - public function mfsgo1($a, $b) - { - $r = $this->form_mf($a, $b); - return $r; - } - - // - public function mfsgo2($a, $b) - { - $r = $this->form_mf($a, $b); - return $r; - } - - // . () - public function form_mf($u, $au) - { - $v = $u * 5.1 - $au * 5.1; - if ($v < 0) { - $v = 0; - } - $r = (1 - (pow(99 / 100, (($v) / 100)))) * 100; - $r = round($r); - return $r; - } - - // () 5 . - public function msf_st2($mf, $lvl1, $lvl2) - { - $r = 0; - - if ($lvl1 > $lvl2) { - $lvl = $lvl1; - } else { - $lvl = $lvl2; - } - - /* - 1-: 0 50 - 0 25% - 2-: 51 151 - 25% 50% - 3-: 151 400 - 50% 75% - 4-: 400 - 75% + 0,01 * ( - 1000) - - 350 50 300 85 - 350 100 250 - 350 150 200 85 - 350 175 175 - 350 200 150 - 350 225 125 - 350 250 100 65 - 50 35 - - - - */ - // - if ($mf < 0) { - $mf = 0; - } - if ($lvl <= 7) { - // 0-7 - if ($mf <= 100) { //0-35 - $prc = $mf; - $r = 35 / 50 * $prc; - } elseif ($mf <= 200) { //35-65 - $prc = $mf - 101; - $r = $prc / 99 * 30; - $r += 35; - } elseif ($mf <= 400) { //65-85 - $prc = $mf - 201; - $r = $prc / 199 * 20; - $r += 65; - } else { //> 75 - $r = 85 + 0.01 * abs(($mf - 1000)); - } - } else { - // - if ($mf <= 100) { //0-45 - $prc = $mf; - $r = 45 / 100 * $prc; - } elseif ($mf <= 300) { //45-65 - $prc = $mf - 101; - $r = $prc / 199 * 20; - $r += 45; - } elseif ($mf <= 450) { //65-75 - $prc = $mf - 301; - $r = $prc / 149 * 10; - $r += 65; - } else { //> 75 - $r = 85; - //$r = 75 + 0.01 * abs(($mf-1000)); - } - } - - if ($r < 0) { - $r = 0; - } - - return $r; - } - - // () - public function msf_st($mf, $lvl1, $lvl2) - { - $r = 0; - - if ($lvl1 > $lvl2) { - $lvl = $lvl1; - } else { - $lvl = $lvl2; - } - - /* - 1-: 0 100 - 0 25% - 2-: 101 400 - 35% 70% - 3-: 401 1000 - 70% 85% - 4-: 1000 - 85% + 0,01 * ( - 1000) - */ - /* . 150 , 350 . - - - 75 750 675 85 - 100 750 650 70 - 150 750 600 - 200 750 550 55 - - 300 750 450 50 - 350 750 400 50 - - 700 , 750 . . - */ - - if ($mf < 0) { - $mf = 0; - } - // - if ($lvl <= 7) { - // 0-7 - if ($mf <= 200) { //0-60 - $prc = $mf; - $r = 60 / 200 * $prc; - } elseif ($mf <= 550) { //60-70 - $prc = $mf - 201; - $r = $prc / 349 * 10; - $r += 60; - } elseif ($mf <= 675) { //70-75 - $prc = $mf - 551; - $r = $prc / 124 * 5; - $r += 70; - } else { //> 85 - $r = 76; - //$r = 85 + 0.01 * abs(($mf-1000)); - } - } else { - // - /* . 150 , 350 . - - - 50 950 1000 85 - 100 950 850 - 150 950 800 - 250 950 700 80 - - 300 950 650 75 - 400 950 550 70 - - - 100 - 50, . . - */ - if ($mf <= 250) { //0-35 - $prc = $mf; - $r = 35 / 250 * $prc; - } elseif ($mf <= 600) { //35-50 - $prc = $mf - 251; - $r = $prc / 349 * 15; - $r += 35; - } elseif ($mf <= 800) { //50-70 - $prc = $mf - 601; - $r = $prc / 199 * 20; - $r += 50; - } else { //> 85 - $r = 75; - //$r = 75 + 0.01 * abs(($mf-1000)); - } - } - - if ($r < 0) { - $r = 0; - } - - - return floor($r * 1.25); - } - - // - public function mfs($type, $mf, $lvl1, $lvl2) - { - $rval = 0; - switch ($type) { - case 1: - - // - - if ($mf['amf'] < 0) { - $mf['amf'] = 0; - } - if ($mf['mf'] < 0) { - $mf['mf'] = 0; - } - if ($mf['mf'] > $mf['smf']) { - $rval = 100 - floor(((($mf['smf']) / ($mf['mf'] + 1)) * 100)); - } else { - $rval = 0; - } - - if ($rval < 1) { - $rval = 0; - } - if ($rval > 75) { - $rval = 75; - } - if ($mf['amf'] >= 1) { - if ($mf['amf'] > 100) { - $mf['amf'] = 100; - } - if (($mf['amf'] * 100) >= mt_rand(1, 10000)) { - $rval = 100; - } - } - - - break; - case 2: - - if ($mf['mf'] < 0) { - $mf['mf'] = 0; - } - if ($mf['amf'] < 0) { - $mf['amf'] = 0; - } - if ($mf['smf'] < 0) { - $mf['smf'] = 0; - } - if ($mf['asmf'] < 0) { - $mf['asmf'] = 0; - } - - if ($mf['mf'] > $mf['smf']) { - $rval = 100 - floor(((($mf['smf']) / ($mf['mf'] + 1)) * 100)); //2.5 - } else { - $rval = 0; - } - if ($rval < 1) { - $rval = 0; - } - if ($rval > 75) { - $rval = 75; - } - if ($mf['asmf'] >= 0) // - { - if ($mf['asmf'] > 100) { - $mf['asmf'] = 100; - } - if ($mf['asmf'] >= rand(1, 100)) { - $rval = 0; - } - } - if ($mf['amf'] >= 0) { - if ($mf['amf'] > 100) { - $mf['amf'] = 100; - } - if ($mf['amf'] >= rand(1, 100)) { - $rval = 100; - } - } - - - break; - case 3: - //$mf[1] -= 4; - //$mf[2] -= 4; - if ($mf[1] < 1) { - $mf[1] = 1; - } - if ($mf[2] < 1) { - $mf[2] = 1; - } - - //$rval = $mf[1] - $mf[2]; // - $rval = $mf[1] - $mf[2] / 2; - if ($rval > 75) { - $rval = 75; - } - //$rval = round($rval/3); - if ($rval < 1) { - $rval = 1; - } - - //$rval = (1-( pow(0.75, ($rval/125) ) ))*100; - - //if( $rval > 60 ) { - // $rval = 60; - //} - - break; - case 4: - $mf = round($mf * 0.6); - if ($mf < 1) { - $mf = 0; - } - if ($mf > 100) { - $mf = 100; - } - //$mf = (1-( pow(0.5, ($mf/200) ) ))*100; - $rval = min($mf, 100); // - break; - case 5: - if ($mf < 1) { - $mf = 0; - } - $rval = min($mf, 85); // - break; - case 6: - // - //$mf['a'] - //$mf['b'] - if ($mf['a'] > 0) { - if ($mf['b'] > 0) { - $rval = round($mf['a'] - ($mf['b'] / 2)); - } else { - $rval = $mf['a']; - } - } else { - $rval = 0; - } - - - if ($rval < 1) { - $rval = 0; - } - if ($rval > 75) { - $rval = 75; - } - - - break; - } - if ($this->get_chanse($rval) == true) { - $rval = 1; - } else { - $rval = 0; - } - return $rval; - } - - public function dodge($a, $b) - { - $i = 0; - $arr = []; // - while ($i < ($b - $a)) { - while (in_array($rand, $arr)) { - $rand = mt_rand(1, 100); - } - $arr[] = $rand; - $i++; - } - - $n = mt_rand(1, 100); - return (!!array_search($n, $arr)); - } - - 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; - } - - // - public function get_chanse_new($persent) - { - $mm = 1; - if (mt_rand($mm, 100 * $mm) <= $persent * $mm) { - return true; - } else { - return false; - } - } - - // - 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 { - return ' '; - } - } - - //- // - public function autoSmena() - { - global $u; - $ms = []; - $ms_all = []; - $ms_ansf = []; - $i = 0; - $j = 0; - $z = 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'] > 0 && -($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']; - } - if (isset($this->ga[$this->users[$i]['id']][$u->info['id']])) { - $ms_ansf[$z] = $this->users[$i]['id']; - $z++; - } - } - $i++; - } - $msh = []; - if ($j == 0 && $z == 0) { - $enemydie = 0; - - if (isset($this->stats[$this->uids[$u->info['enemy']]])) { - $u->info['enemy'] = 0; - $enemydie = 1; - } - - if ((!isset($this->uids[(-($u->info['enemy']))]) || $this->stats[$this->uids[(-($u->info['enemy']))]]['hpNow'] < 1) && ($u->info['enemy'] < 0 || $enemydie == 1)) { - $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']) { - $ms[$j] = $this->users[$i]['id']; - $msh[$ms[$j]] = true; - $j++; - } - $i++; - } - } - } - - $ms = $ms[rand(0, $j - 1)]; - $ms_ansf = $ms_ansf[rand(0, $z - 1)]; - if ($z > 0) { - $this->smena($ms_ansf, true); - } elseif ($j > 0) { - if (isset($msh[$ms])) { - $this->smena($ms, true, true); - } else { - $this->smena($ms, true); - } - } 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); - } - } - } - - //- new - /*public function autoSmena() - { - global $u; - $ms = array(); - $ms_all = array(); - $i = 0; $j = 0; - while($iusers)) - { - 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 'Fatal error: '.$smnr5.' #'.$j.''; - } - 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 ( - `uid2` = "' . $pl . '" AND `uid1` = "' . $uid . '" - )) LIMIT 1')); - - if ($tp == 1 && !isset($test_atack['id'])) { - $test_uid = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "' . $uid . '" AND `hpNow` >= 1 LIMIT 1')); - $test_pl = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "' . $pl . '" AND `hpNow` >= 1 LIMIT 1')); - if (isset($test_uid['id']) && isset($test_pl['id']) && $test_uid['id'] != $test_pl['id']) { - $a = rand(1, 5) . '' . rand(1, 5) . '' . rand(1, 5) . '' . rand(1, 5) . '' . rand(1, 5); - $b = rand(1, 5); - $d = mysql_query('INSERT INTO `battle_act` (`battle`,`time`,`uid1`,`uid2`,`a1`,`b1`) VALUES ("' . $this->info['id'] . '","' . time() . '","' . $pl . '","' . $uid . '","' . $a . '","' . $b . '")'); - } - } elseif ($tp == 2) { - // - $test_uid = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "' . $uid . '" AND `hpNow` >= 1 LIMIT 1')); - $test_pl = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "' . $pl['uid2'] . '" AND `hpNow` >= 1 LIMIT 1')); - if (isset($test_uid['id']) && isset($test_pl['id']) && $test_uid['id'] != $test_pl['id']) { - $bot = $this->users[$this->uids[$pl['uid2']]]; - $na = ['id' => 0, 'a' => [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0], 'b' => 0]; - $a222 = rand(1, 5) . '_' . rand(1, 5) . '_' . rand(1, 5) . '_' . rand(1, 5) . '_' . rand(1, 5); - $a = explode('_', $a222); - $i = 1; - $na['id'] = time(); - while ($i <= 5) { - if (isset($a[$i - 1])) { - $a[$i - 1] = intval(round($a[$i - 1])); - if ($a[$i - 1] >= 1 && $a[$i - 1] <= 5) { - $na['a'][$i] = $a[$i - 1]; - } else { - $na['a'][$i] = 0; - } - } - $i++; - } - $na['b'] = rand(1, 5); - // - - $this->atacks[$pl['id']]['a2'] = $a222; - $this->atacks[$pl['id']]['b2'] = $na['b']; - $this->startAtack($pl['id']); - } - } - //unset($test_uid,$test_pl,$test_atack); - } - - // , , , - public function testActions() - { - // - $m = mysql_query('SELECT * FROM `battle_act` WHERE `battle` = "' . $this->info['id'] . '" ORDER BY `id` ASC'); - $i = 0; - $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; - $this->ga[$pl['uid1']][$pl['uid2']] = $pl['id']; - $this->ag[$pl['uid2']][$pl['uid1']] = $pl['id']; - if (isset($this->iBots[$pl['uid1']])) { - // - $botA[$pl['uid1']] = $pl['id']; - } elseif (isset($this->iBots[$pl['uid2']])) { - // - $botR[$pl['uid2']] = $pl['id']; - if ($this->users[$this->uids[$pl['uid2']]]['timeGo'] < time()) { - $this->botAtack($pl['uid1'], $pl, 2); - } - } - } 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 - $pl['out1'] = time(); - $pl['tout1'] = 1; - // 2 - $pl['out2'] = time(); - $pl['tout2'] = 1; - } elseif ($pl['a1'] == 0) { - // 1 - $pl['out1'] = time(); - $pl['tout1'] = 1; - } elseif ($pl['a2'] == 0) { - // 2 - $pl['out2'] = time(); - $pl['tout2'] = 1; - } - // - if (!isset($pluids['hpNow'])) { - $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'].'")'); - } - } - } - } - // - if ($this->uAtc['id'] > 0) { - if ($this->na == 1) { - if ($pl['out1'] == 0 && $pl['out2'] == 0) { - // - if ($pl['uid1'] == $u->info['id'] || $pl['uid2'] == $u->info['id']) { - $this->addNewAtack(); - } - } else { - $this->addNewAtack(); - } - } - } - // - - // - - //, - $i = 0; - while ($i < count($this->bots)) { - $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) { - $tnbot = time() + rand(1, 1); - } else { - $tnbot = time() + rand(1, 2); - } - if ($this->users[$j]['timeGo'] >= time() || $this->users[$this->uids[$bot]]['timeGo'] >= time()) { - } elseif ($this->users[$j]['hpNow'] >= 1 && $this->users[$this->uids[$bot]]['hpNow'] >= 1 && $this->users[$this->uids[$bot]]['team'] != $this->users[$j]['team']) { - if (isset($this->users[$j]) && $this->stats[$j]['hpNow'] >= 1 && $this->stats[$this->uids[$bot]]['hpNow'] >= 1 && !isset($this->ga[$bot][$this->users[$j]['id']]) && !isset($this->ag[$bot][$this->users[$j]['id']]) && $this->users[$j]['id'] != $bot && $this->users[$j]['team'] != $this->users[$this->uids[$bot]]['team']) { - if ($this->users[$j]['timeGo'] < time() && $this->users[$this->uids[$bot]]['timeGo'] < time()) { - $this->botAtack($this->users[$j]['id'], $bot, 1); - mysql_query('UPDATE `stats` SET `timeGo` = "' . $tnbot . '" WHERE `id` = "' . $this->users[$this->uids[$bot]]['id'] . '" LIMIT 1'); - } - } elseif (isset($this->users[$i]) && $this->users[$i]['bot'] > 0 && $this->stats[$i]['hpNow'] >= 1 && $this->stats[$this->uids[$bot]]['hpNow'] >= 1 && $this->users[$i]['id'] != $bot && $this->users[$i]['team'] != $this->users[$this->uids[$bot]]['team']) { - if ($this->users[$j]['timeGo'] < time() && $this->users[$this->uids[$bot]]['timeGo'] < time()) { - if ($this->botAct($bot) == true) { - if (!isset($this->ga[$bot][$this->users[$i]['id']]) && $this->users[$this->uids[$bot]]['timeGo'] < time() && !isset($this->ag[$bot][$this->users[$i]['id']])) { - $this->botAtack($this->users[$i]['id'], $bot, 1); - mysql_query('UPDATE `stats` SET `timeGo` = "' . $tnbot . '" WHERE `id` = "' . $this->users[$this->uids[$bot]]['id'] . '" LIMIT 1'); - } elseif (isset($this->ag[$bot][$this->users[$i]['id']])) { - } elseif (isset($this->ga[$bot][$this->users[$i]['id']]) && $this->users[$this->uids[$bot]]['timeGo'] < time()) { - $this->botAtack($bot, $this->users[$i]['id'], 1); - mysql_query('UPDATE `stats` SET `timeGo` = "' . $tnbot . '" WHERE `id` = "' . $this->users[$this->uids[$bot]]['id'] . '" LIMIT 1'); - } - } - } - } else { - // - // - if ($this->users[$j]['timeGo'] < time() && $this->users[$this->uids[$bot]]['timeGo'] < time() && $this->users[$j]['hpNow'] >= 1 && $this->users[$this->uids[$bot]]['hpNow'] >= 1) { - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a1'] = rand(1, 5) . '' . rand(1, - 5) . '' . rand(1, 5) . '' . rand(1, 5) . '' . rand(1, 5); - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5); - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a2'] = rand(1, 5) . '' . rand(1, - 5) . '' . rand(1, 5) . '' . rand(1, 5) . '' . rand(1, 5); - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a1'] = rand(1, 5) . '' . rand(1, - 5) . '' . rand(1, 5) . '' . rand(1, 5) . '' . rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a2'] = rand(1, 5) . '' . rand(1, - 5) . '' . rand(1, 5) . '' . rand(1, 5) . '' . rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5); - if (isset($this->ga[$bot][$this->users[$j]['id']]) && $this->users[$j]['bot'] > 0) { - if ($this->users[$j]['timeGo'] < time() && $this->users[$this->uids[$bot]]['timeGo'] < time()) { - $tnbot = time() + rand(3, 7); - if ($this->info['type'] == 329) { // - $tnbot = time() - 1; - } - $this->startAtack($this->ga[$bot][$this->users[$j]['id']]); - $this->users[$this->uids[$bot]]['timeGo'] = $tnbot; - mysql_query('UPDATE `stats` SET `timeGo` = "' . $tnbot . '" WHERE `id` = "' . $this->users[$this->uids[$bot]]['id'] . '" LIMIT 1'); - } - } elseif (isset($this->ag[$bot][$this->users[$j]['id']]) && $this->users[$j]['bot'] > 0) { - if ($this->users[$this->uids[$bot]]['timeGo'] < time() && $this->users[$j]['timeGo'] < time()) { - $this->startAtack($this->ag[$bot][$this->users[$j]['id']]); - $tnbot = time() + rand(3, 7); - if ($this->info['type'] == 329) { // - $tnbot = time() - 1; - } - $this->users[$this->uids[$bot]]['timeGo'] = $tnbot; - mysql_query('UPDATE `stats` SET `timeGo` = "' . $tnbot . '" WHERE `id` = "' . $this->users[$this->uids[$bot]]['id'] . '" LIMIT 1'); - } - } - } - // - } - } - $j++; - } - } - $i++; - } - } - - // - public function botAct($uid) - { - $r = false; - if ($this->users[$this->uids[$uid]]['bot'] > 0) { - if ($this->users[$this->uids[$uid]]['online'] < time() - 3) { - $r = true; - $this->users[$this->uids[$uid]]['online'] = time(); - mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . ((int)$uid) . '" LIMIT 1'); - } else { - if (rand(0, 2) == 1) { - $r = true; - } - } - } - return $r; - } - - // - public function battleInfo($id) - { - $b = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1')); - if (isset($b['id'])) { - $this->hodID = mysql_fetch_array(mysql_query('SELECT `id_hod` FROM `battle_logs` WHERE `battle` = "' . $b['id'] . '" ORDER BY `id` DESC LIMIT 1')); - if (isset($this->hodID['id_hod'])) { - $this->hodID = $this->hodID['id_hod']; - } 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; - } - } - - // - public function addAtack() - { - global $js; - if (isset($_POST['atack'], $_POST['block'])) { - $na = ['id' => 0, 'a' => [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0], 'b' => 0]; - $a = explode('_', $_POST['atack']); - $i = 1; - $na['id'] = time(); - while ($i <= 5) { - if (isset($a[$i - 1])) { - $a[$i - 1] = intval(round($a[$i - 1])); - if ($a[$i - 1] >= 1 && $a[$i - 1] <= 5) { - $na['a'][$i] = $a[$i - 1]; - } else { - $na['a'][$i] = 0; - } - } - $i++; - } - - $na['b'] = intval(round($_POST['block'])); - if ($na['b'] < 1 || $na['b'] > 5) { - $na['b'] = 0; - } - - $this->uAtc = $na; - $js .= 'testClearZone();'; - } else { - $this->e = ' '; - } - } - - // - public function teamsTake() - { - global $u; - $rs = ''; - $ts = []; - $tsi = 0; - if ($this->info['id'] > 0) { - // - $nxtlg = []; - $t = mysql_query('SELECT `u`.`room`,`u`.`no_ip`,`u`.`twink`,`u`.`stopexp`,`u`.`id`,`u`.`notrhod`,`u`.`login`,`u`.`login2`,`u`.`sex`,`u`.`online`,`u`.`admin`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`,`u`.`level`,`u`.`battle`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`animal`,`st`.`stats`,`st`.`hpNow`,`st`.`mpNow`,`st`.`exp`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`battle_text`,`st`.`upLevel`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`bot`,`st`.`lider`,`st`.`btl_cof`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`id`,`st`.`last_hp`,`st`.`last_pr`,`u`.`sex`,`u`.`money`,`u`.`bot_id`,`u`.`money3`,`u`.`money2` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle` = "' . $this->info['id'] . '"'); - $i = 0; - $bi = 0; - $up = ''; - if ($this->info['start2'] == 0) { - $tststrt = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `start2` = "0" LIMIT 1')); - if (isset($tststrt['id'])) { - $upd = mysql_query('UPDATE `battle` SET `start2` = "' . time() . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - } else { - $this->info['start2'] = time(); - } - } - while ($pl = mysql_fetch_array($t)) { - // - if ($pl['login2'] == '') { - $pl['login2'] = $pl['login']; - } - $this->users[$i] = $pl; - $this->uids[$pl['id']] = $i; - - if ($this->info['start2'] == 0) { - mysql_query('UPDATE `users` SET `notrhod` = "-1" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - $this->users[$i]['notrhod'] = -1; - } - - if ($pl['bot'] > 0) { - $this->bots[$bi] = $pl['id']; - $this->iBots[$pl['id']] = $bi; - $bi++; - } - // - $this->stats[$i] = $u->getStats($pl, 0, 0, false, $this->cached, true); - // - if ($this->info['start2'] == 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]['s7']) / $this->stats[$i]['hpAll'] * $this->stats[$i]['hpNow']); - } - - if ($this->stats[$i]['s7'] > 49) { - mysql_query('UPDATE `eff_users` SET `delete`="' . time() . '" WHERE `uid` = "' . $this->users[$i]['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, '" . $this->stats[$i]['id'] . "', '', 'add_spasenie=1', 101, 77, 0, '" . $this->stats[$i]['id'] . "', 0, 'priem', 324, 'preservation.gif', 1, -1, '', 0, 0, '', 0, 0, 0, 1, 0); - "); - } - - - # ) Ost. Costa - #$this->users[$i]['tactic7'] += $this->stats[$i]['s7']; - ##### - // animal_bonus - 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')); - 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` = "' . $this->users[$i]['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,"' . $this->users[$i]['id'] . '","' . $tpa3[$a['type']] . ' [' . $a['level'] . ']","' . $anl . '","100","77","priem","' . $this->users[$i]['id'] . '")'); - - // - if ($a['type'] == 7) { - if ($a['level'] == 10) { - $this->users[$i]['tactic7'] = floor((50 + $this->stats[$i]['s7']) / $this->stats[$i]['hpAll'] * $this->stats[$i]['hpNow']); - } elseif ($a['level'] == 11) { - $this->users[$i]['tactic7'] = floor((65 + $this->stats[$i]['s7']) / $this->stats[$i]['hpAll'] * $this->stats[$i]['hpNow']); - } elseif ($a['level'] == 12) { - $this->users[$i]['tactic7'] = floor((90 + $this->stats[$i]['s7']) / $this->stats[$i]['hpAll'] * $this->stats[$i]['hpNow']); - } - } - // - $anl = $u->lookStats($anl); - - $vLog = 'time1=' . time() . '||s1=' . $this->users[$i]['sex'] . '||t1=' . $this->users[$i]['team'] . '||login1=' . $this->users[$i]['login'] . ''; - $vLog .= '||s2=1||t2=' . $this->users[$i]['team'] . '||login2=' . $a['name'] . ' ( ' . $this->users[$i]['login'] . ')'; - - $mas1 = [ - 'time' => time(), - 'battle' => $this->info['id'], - '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) { - if ($u->items['add'][$i6] == 'mib1') { - $ba .= ' : +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } elseif ($u->items['add'][$i6] == 'mib2') { - $ba .= ' : +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } elseif ($u->items['add'][$i6] == 'mib3') { - $ba .= ' : +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } elseif ($u->items['add'][$i6] == 'mib4') { - $ba .= ' : +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } elseif ($u->items['add'][$i6] == 'mab1' || $u->items['add'][$i6] == 'mab2' || $u->items['add'][$i6] == 'mab3' || $u->items['add'][$i6] == 'mab4') { - } else { - $ba .= $u->is[$u->items['add'][$i6]] . ': +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } - } - } - $i6++; - } - $ba = trim($ba, ', '); - if ($ba == '') { - $ba = ' '; - } - - $mas1['text'] = '{tm1} {u2} , "' . $tpa3[$a['type']] . ' [' . $a['level'] . ']" {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'],''.$a['name'].' ...',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'])) { - // - $this->addstatuser($pl['id']); - } - $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 '


'; - - // - - if ($this->info['start1'] == 0) { - $tststrt = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `start1` = "0" LIMIT 1')); - if (isset($tststrt['id'])) { - $upd = mysql_query('UPDATE `battle` SET `start1` = "' . time() . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - if ($upd) { - $i = 0; - $r = ''; - while ($i <= $tsi) { - if (isset($rs[$i]) && $rs[$i] != '') { - $r .= rtrim($rs[$i], ', ') . ' '; - } - $i++; - } - $r = rtrim($r, ' '); - $r = str_replace('"', '\\\\\"', $r); - $this->hodID++; - $vLog = 'time1=' . time() . '||'; - $mass = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => 'test', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $r = ' ' . date('d.m.Y H:i', - $this->info['time_start']) . ', ' . $r . ' .'; - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $r . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - if (!$ins) { - //echo $r; - } - $this->info['start1'] = time(); - } - } - - // - - if (count($nxtlg) > 0) { - $i = 0; - while ($i < count($nxtlg)) { - $this->add_log($nxtlg[$i]); - $i++; - } - } - // - } - } - } - - // - public function restZonb($uid1, $uid2) - { - if ($this->stnZbVs[$uid1] > 0) { - $this->stats[$this->uids[$uid1]]['zonb'] = $this->stnZbVs[$uid1]; - } - if ($this->stnZbVs[$uid2] > 0) { - $this->stats[$this->uids[$uid1]]['zonb'] = $this->stnZbVs[$uid2]; - } - } - - // () - public function testZonbVis() - { - global $u; - if ($this->stnZbVs == 0) { - $zb = $this->stats[$this->uids[$u->info['id']]]['zonb']; - $this->stnZbVs = $zb; - } else { - $zb = $this->stnZb; - } - $eu = $this->users[$this->uids[$u->info['id']]]['enemy']; - if ($zb > 3) { - $zb = 3; - } - if ($eu != '' && $eu != 0) { - if ($this->stats[$this->uids[$eu]]['weapon1'] == 1 || $this->stats[$this->uids[$eu]]['weapon2'] == 1) { - if ($this->stats[$this->uids[$u->info['id']]]['weapon1'] != 1 && $this->stats[$this->uids[$u->info['id']]]['weapon2'] != 1) { - $zb -= 1; - } - } - } - if ($zb < 1) { - $zb = 1; - } - return $zb; - } - - // - public function testZonb($uid, $uid2) - { - global $u; - $zba = [1 => 0, 2 => 0]; - - $zba[1] = $this->stats[$this->uids[$uid]]['zonb']; - $zba[2] = $this->stats[$this->uids[$uid2]]['zonb']; - - if ($this->stnZb[$uid] == 0) { - $zba[1] = $this->stats[$this->uids[$uid]]['zonb']; - $this->stnZb[$uid] = $zba[1]; - } else { - $zba[1] = $this->stnZb[$uid]; - } - - if ($this->stnZb[$uid2] == 0) { - $zba[2] = $this->stats[$this->uids[$uid2]]['zonb']; - $this->stnZb[$uid] = $zba[2]; - } else { - $zba[2] = $this->stnZb[$uid2]; - } - - if ($zba[1] > 3) { - $zba[1] = 3; - } - if ($zba[2] > 3) { - $zba[2] = 3; - } - - // 1 - if ($this->stats[$this->uids[$uid2]]['weapon1'] == 1 || $this->stats[$this->uids[$uid2]]['weapon2'] == 1) { - if ($this->stats[$this->uids[$uid]]['weapon1'] != 1 && $this->stats[$this->uids[$uid]]['weapon2'] != 1) { - $zba[1] -= 1; - } - } - - // 2 - if ($this->stats[$this->uids[$uid]]['weapon1'] == 1 || $this->stats[$this->uids[$uid]]['weapon2'] == 1) { - if ($this->stats[$this->uids[$uid2]]['weapon1'] != 1 && $this->stats[$this->uids[$uid2]]['weapon2'] != 1) { - $zba[2] -= 1; - } - } - - if ($zba[1] < 1) { - $zba[1] = 1; - } - if ($zba[2] < 1) { - $zba[2] = 1; - } - - $this->stats[$this->uids[$uid]]['zonb'] = $zba[1]; - $this->stats[$this->uids[$uid2]]['zonb'] = $zba[2]; - if ($this->stats[$this->uids[$uid]]['min_zonb'] > 0 && $this->stats[$this->uids[$uid]]['zonb'] < $this->stats[$this->uids[$uid]]['min_zonb']) { - $this->stats[$this->uids[$uid]]['zonb'] = $this->stats[$this->uids[$uid]]['min_zonb']; - } - if ($this->stats[$this->uids[$uid2]]['min_zonb'] > 0 && $this->stats[$this->uids[$uid2]]['zonb'] < $this->stats[$this->uids[$uid2]]['min_zonb']) { - $this->stats[$this->uids[$uid2]]['zonb'] = $this->stats[$this->uids[$uid2]]['min_zonb']; - } - } - - // - public function genTeams($you) - { - global $u; - $ret = ''; - $teams = []; - // - $i = 0; - $j = 1; - $tms = []; - //if( $this->users[$this->uids[$you]]['team'] > 0 && $this->stats[$this->uids[$you]]['hpNow'] > 0 ) { - $teams[$this->users[$this->uids[$you]]['team']] = ''; - $tms[0] = $this->users[$this->uids[$you]]['team']; - //} - while ($i < count($this->uids)) { - if ($this->stats[$i]['hpNow'] > 0) { - if (!isset($teams[$this->users[$i]['team']])) { - $tms[$j] = $this->users[$i]['team']; - $j++; - } - if ($this->stats[$i]['hpNow'] < 0) { - $this->stats[$i]['hpNow'] = 0; - } - if ($this->stats[$i]['hpAll'] < $this->stats[$i]['hpNow']) { - $this->stats[$i]['hpNow'] = $this->stats[$i]['hpAll']; - } - $a1ms = ''; - if (isset($this->ga[$this->users[$i]['id']][$you]) && $this->ga[$this->users[$i]['id']][$you] != false) { - $a1mc = ''; - $ac = mysql_fetch_array(mysql_query('SELECT * FROM `battle_act` WHERE `id` = "' . $this->ga[$this->users[$i]['id']][$you] . '" LIMIT 1')); - if (isset($ac) && $ac['time'] + $this->info['timeout'] - 15 < time()) { - $a1mc = 'color:red;'; - } - $a1ms = 'style=\"text-decoration: underline; ' . $a1mc . '\"'; - } elseif (isset($this->ag[$this->users[$i]['id']][$you]) && $this->ag[$this->users[$i]['id']][$you] != false) { - $a1mc = ''; - $ac = mysql_fetch_array(mysql_query('SELECT * FROM `battle_act` WHERE `id` = "' . $this->ag[$this->users[$i]['id']][$you] . '" LIMIT 1')); - if (isset($ac) && $ac['time'] + $this->info['timeout'] - 15 < time()) { - $a1mc = 'color:green;'; - } - $a1ms = 'style=\"text-decoration: overline; ' . $a1mc . '\"'; - } - if ($this->users[$i]['login2'] == '') { - $this->users[$i]['login2'] = $this->users[$i]['login']; - } - if ($this->users[$i]['align'] == 9) { - $this->stats[$i]['hpNow'] = $this->stats[$i]['hpNow'] / ($this->stats[$i]['hpAll'] / 100); - $this->stats[$i]['hpAll'] = '100%'; - } - $ldr = ''; - if ($this->users[$i]['lider'] == $this->info['id']) { - $ldr = 'users[$i]['team'] . '.gif \>'; - } - $teams[$this->users[$i]['team']] .= ', ' . $ldr . 'users[$i]['team'] . '\" onClick=\"top.chat.addto(\'' . $this->users[$i]['login2'] . '\',\'to\'); return false;\" oncontextmenu=\"top.infoMenu(\'' . $this->users[$i]['login2'] . '\',event,\'main\'); return false;\">' . $this->users[$i]['login2'] . ' [' . floor($this->stats[$i]['hpNow']) . '/' . $this->stats[$i]['hpAll'] . ']'; - } - $i++; - } - - // - $i = 0; - while ($i < count($tms)) { - $teams[$tms[$i]] = ltrim($teams[$tms[$i]], ', '); - if ($teams[$tms[$i]] != '') { - //if($u->info['team'] == $tms[$i]) { - // $teams[$tms[$i]] = ' '.$teams[$tms[$i]]; - //}else{ - $teams[$tms[$i]] = ' ' . $teams[$tms[$i]]; - //} - $ret .= $teams[$tms[$i]]; - if (count($tms) > $i + 1) { - $ret .= '     '; - } - } - $i++; - } - return 'genteam("' . $ret . '");'; - } - - - public function addTravm($uid, $type, $lvl) - { - global $u; - $t = $type; - if ($t == 1) { - $name = ' '; - $stat = rand(1, 3); // - $timeEnd = rand(1, 3);// 1.30 6 - $data = 'add_s' . $stat . '=-' . $lvl; - $img = 'eff_travma1.gif'; - $v1 = 1; - //echo ''.$name.''; - } elseif ($t == 2) { - $name = ' '; - $stat = rand(1, 3); // - $timeEnd = rand(3, 5);// 6 12 - $data = 'add_s' . $stat . '=-' . ($lvl * 2); - $v1 = 2; - $img = 'eff_travma2.gif'; - } elseif ($t == 3) { - $name = ' '; - $stat = rand(1, 3); // - $timeEnd = rand(5, 7);// 12 6 - $data = 'add_s' . $stat . '=-' . ($lvl * 3); - $v1 = 3; - $img = 'eff_travma3.gif'; - } elseif ($t == 4) { - $name = ' '; - $stat = rand(1, 3); // - $timeEnd = 24;// 24 - $data = 'add_s' . $stat . '=-' . ($lvl * 50); - $v1 = 4; - $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", "")'); - } - - public function testUserInfoBattle($uid) - { - global $u; - if (!isset($this->uids[$uid])) { - // ( ) - if (!isset($this->uids[$uid])) { - $this->uids[$uid] = count($this->users); - } - $this->users[$this->uids[$uid]] = mysql_fetch_array(mysql_query('SELECT - - `u`.`id`,`u`.`login`,`u`.`login2`,`u`.`online`,`u`.`admin`,`u`.`city`,`u`.`cityreg`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`, - `u`.`level`,`u`.`money`,`u`.`money3`,`u`.`money2`,`u`.`money4`,`u`.`battle`,`u`.`sex`,`u`.`obraz`,`u`.`win`,`u`.`win_t`, - `u`.`lose`,`u`.`lose_t`,`u`.`nich`,`u`.`timeMain`,`u`.`invis`,`u`.`bot_id`,`u`.`animal`,`u`.`type_pers`, - `u`.`notrhod`,`u`.`bot_room`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`activ`,`u`.`stopexp`,`u`.`real`, - - `st`.* - - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id` = "' . $uid . '" LIMIT 1')); - $this->stats[$this->uids[$uid]] = $u->getStats($this->users[$this->uids[$uid]], 0, 0, false, false, true); - } - } - - ///---- - public function spaCheck($u1) - { - if ($this->stats[$this->uids[$u1]]['hpNow'] < 1) { - mysql_query('DELETE FROM `battle_act` WHERE `uid1` = "' . $u1 . '" OR `uid2` = "' . $u1 . '"'); - if ($this->stats[$this->uids[$u1]]['spasenie'] > 0 && $this->users[$this->uids[$u1]]['tactic7'] >= 25) // - { - // - // - if ($this->stats[$this->uids[$u1]]['s7'] > 49 && $this->stats[$this->uids[$u1]]['s7'] < 75) { - // - 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, '" . $u1 . "', ' ', 'add_zmproc=75|add_zaproc=75', 0, 77, 0, '" . $u1 . "', 0, 'priem', 141, 'spirit_block25.gif', 1, 1, '0', 0, 0, '', 0, 0, 0, 0, 0);"); - $this->stats[$this->uids[$u1]]['hpNow'] = floor($this->stats[$this->uids[$u1]]['hpAll'] * 0.5); - $this->stats[$this->uids[$u1]]['mpNow'] = floor($this->stats[$this->uids[$u1]]['mpAll'] * 0.5); - } elseif ($this->stats[$this->uids[$u1]]['s7'] > 74 && $this->stats[$this->uids[$u1]]['s7'] < 100) { - // - 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, '" . $u1 . "', ' ', 'add_zmproc=100|add_zaproc=100', 0, 77, 0, '" . $u1 . "', 0, 'priem', 358, 'block_absolute.gif', 1, 1, '0', 0, 0, '', 0, 0, 0, 0, 0);"); - $this->stats[$this->uids[$u1]]['hpNow'] = floor($this->stats[$this->uids[$u1]]['hpAll'] * 0.75); - $this->stats[$this->uids[$u1]]['mpNow'] = floor($this->stats[$this->uids[$u1]]['mpAll'] * 0.75); - } elseif ($this->stats[$this->uids[$u1]]['s7'] > 99) { - // x2 - 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, '" . $u1 . "', ' ', 'add_zmproc=100|add_zaproc=100', 0, 77, 0, '" . $u1 . "', 0, 'priem', 358, 'wis_white_shield.gif', 1, 2, '0', 0, 0, '', 0, 0, 0, 0, 0);"); - $this->stats[$this->uids[$u1]]['hpNow'] = floor($this->stats[$this->uids[$u1]]['hpAll']); - $this->stats[$this->uids[$u1]]['mpNow'] = floor($this->stats[$this->uids[$u1]]['mpAll']); - } - - if ($this->stats[$this->uids[$u1]]['hpNow'] < 1) { - $this->stats[$this->uids[$u1]]['hpNow'] = 1; - } - if ($this->stats[$this->uids[$u1]]['mpNow'] < 1) { - $this->stats[$this->uids[$u1]]['mpNow'] = 1; - } - if ($this->stats[$this->uids[$u1]]['hpNow'] > $this->stats[$this->uids[$u1]]['hpAll']) { - $this->stats[$this->uids[$u1]]['hpNow'] = floor($this->stats[$this->uids[$u1]]['hpAll']); - } - if ($this->stats[$this->uids[$u1]]['mpNow'] > $this->stats[$this->uids[$u1]]['mpAll']) { - $this->stats[$this->uids[$u1]]['mpNow'] = floor($this->stats[$this->uids[$u1]]['mpAll']); - } - - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $u1 . '" AND `id_eff` = 22 AND `v1` = "priem" AND `v2` = 324'); - mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$this->uids[$u1]]['hpNow'] . '",`mpNow` = "' . $this->stats[$this->uids[$u1]]['mpNow'] . '", `tactic7` = `tactic7` - 25 WHERE `id` = "' . $u1 . '" LIMIT 1'); - $mas['text'] = '{tm1} ' . $this->stats[$this->uids[$u1]]['login'] . ' ...' . $this->stats[$this->uids[$u1]]['login'] . ' . '; - $this->priemAddLog($id, 1, 2, $u->info['id'], $u1, - ' ', - $mas['text'], - ($this->hodID + 0) - ); - // - - - } else { - if (isset($this->stats[$this->uids[$u1]]['login'])) { - mysql_query('UPDATE `stats` SET `hpNow` = "0",`mpNow` = "0" WHERE `id` = "' . $u1 . '" LIMIT 1'); - $this->stats[$this->uids[$u1]]['hpNow'] = 0; - $this->users[$this->uids[$u1]]['hpNow'] = 0; - $mas['text'] = '{tm1} ' . $this->stats[$this->uids[$u1]]['login'] . ' .'; - $this->priemAddLog($id, 1, 2, $u->info['id'], $u1, - ' ', - $mas['text'], - ($this->hodID + 1) - // // - ); - mysql_query('DELETE FROM `battle_act` WHERE `uid1` = "' . $this->stats[$this->uids[$u1]]['id'] . '" OR `uid2` = "' . $this->stats[$this->uids[$u1]]['id'] . '" OR `uid2` = "-' . $this->stats[$this->uids[$u1]]['id'] . '"'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $this->stats[$this->uids[$u1]]['id'] . '" AND `v1` = "priem" AND `delete` =0'); - // v1 priem - } - } - } - } - // - -} - -$btl = new battleClass; -?> diff --git a/_incl_data/class/__battle.php-cleared b/_incl_data/class/__battle.php-cleared deleted file mode 100644 index 49474796..00000000 --- a/_incl_data/class/__battle.php-cleared +++ /dev/null @@ -1,8360 +0,0 @@ -db = $db; - } - - /** Priems. - * @param $u1 - * @param $u2 - * @param $type - * @return string - */ - public function maginfoattack($u1, $u2, $type) - { - /* - 1 - , - 2 - , - 3 - , - 4 - - */ - $v_l = str_replace(' ', ' ', $this->users[$this->uids[$u1]]['login']); - - // - $v_z = 0 + $this->stats[$this->uids[$u2]]['zm' . $type]; - // - $v_p = round(($this->stats[$this->uids[$u1]]['pzm' . $type] + $this->stats[$this->uids[$u1]]['pzm']) * 0.4); - // - $v_m = 0 + $this->stats[$this->uids[$u1]]['pm' . $type]; - - return - ' magelogin=' . $v_l . - ' onMouseOver=top.hi(this,maginfo(' . $v_z . ',' . $v_p . ',' . $v_m . ',this),event,3,1,1,1,null); onMouseOut=top.hic(); onMouseDown=top.hic(); '; - } - - /** $x - * @param $x - * @return array - */ - private function typeBattle($x) - { - $r = [0, 0, ' ', ' ']; - if ($x >= 50000 && $x < 100000) { - $r = [25, 50, ' ', ' ']; - } elseif ($x < 500000) { - $r = [50, 75, ' ', ' ']; - } elseif ($x < 1000000) { - $r = [75, 100, ' ', ' ']; - } elseif ($x < 2500000) { - $r = [100, 125, ' ', ' ']; - } elseif ($x >= 5000000) { - $r = [150, 150, ' ', ' ']; - } - return $r; - } - - ## - PRIEMS () - public $mncolor = [ - 1 => '006699', - 2 => '006699', - 3 => '006699', - 4 => '006699', - 5 => '006699', - 6 => '006699', - 7 => '006699', - ]; // - public $mcolor = [ - 1 => 'A00000', - 2 => '008080', - 3 => '0000FF', - 4 => 'A52A2A', - 5 => '006699', - 6 => '006699', - 7 => '006699', - ]; // - public $mname = [ - '' => 1, - '' => 2, - '' => 3, - '' => 4, - '' => 5, - '' => 6, - '' => 7, - ]; - - /** (?) - *
act: - *
1 - - *
2 - - *
type_of: - *
1 - - *
2 - - *
3 - - *
4 - - *
5 - - * @var array[] - */ - private $prm = [ - 1 => ['name' => '', 'act' => 1, 'type_of' => 5], - 2 => ['name' => '', 'act' => 2, 'type_of' => 3], - 4 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 7 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - - 290 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - - // - //291 => array( 'name' => ' ', 'act' => 2, 'type_of' => 4 ), - - // - 294 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 295 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 296 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 297 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 298 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - - 141 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 147 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 148 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 149 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 150 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - - 142 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 144 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 146 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 145 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - - 8 => ['name' => ' ', 'act' => 1, 'type_of' => 1], - 9 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 10 => ['name' => '', 'act' => 1, 'type_of' => 1], - 11 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - - 45 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - - 47 => ['name' => ' ', 'act' => 2, 'type_of' => 2], - 48 => ['name' => ' ', 'act' => 1, 'type_of' => 1], - 49 => ['name' => ' ', 'act' => 1, 'type_of' => 1], - 138 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 140 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - 193 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 204 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 211 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - 213 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - 215 => ['name' => ' ', 'act' => 1, 'type_of' => 1], - 216 => ['name' => ' ', 'act' => 2, 'type_of' => 2], - 217 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 219 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 220 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 222 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 225 => ['name' => ' ', 'act' => 1, 'type_of' => 4], - 226 => ['name' => '', 'act' => 1, 'type_of' => 4], - 231 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 234 => ['name' => '', 'act' => 2, 'type_of' => 4], - 235 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 342 => ['name' => ' ', 'act' => 0, 'type_of' => 0], - 343 => ['name' => '', 'act' => 0, 'type_of' => 0], - - 237 => ['name' => ' ', 'act' => 2, 'type_of' => 3 /*, 'moment' => 3*/], - - 239 => ['name' => ' ', 'act' => 2, 'type_of' => 3], - 240 => ['name' => ' ', 'act' => 2, 'type_of' => 5], - - // - 21 => ['name' => ' [4]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 73 => ['name' => ' [5]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 74 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 75 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 76 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 77 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 78 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 79 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - - // - 22 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 80 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 81 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 82 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 83 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 84 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - - // - 36 => ['name' => ' [5]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 85 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 86 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 87 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 88 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 89 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 90 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - - // - 23 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 70 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 71 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 72 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - - // - 269 => ['name' => ' [8]', 'act' => 2, 'type_of' => 9], - 276 => ['name' => ' [9]', 'act' => 2, 'type_of' => 9], - 277 => ['name' => ' [10]', 'act' => 2, 'type_of' => 9], - - 270 => ['name' => ' ', 'act' => 2, 'type_of' => 5, 'type_sec' => 5], - 280 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 281 => ['name' => ' ', 'act' => 2, 'type_of' => 5], - 282 => ['name' => ' ', 'act' => 2, 'type_of' => 5], - - // - 24 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 3], - - // - 210 => ['name' => ' [4]', 'act' => 2, 'type_of' => 8], - 209 => ['name' => ' [7]', 'act' => 2, 'type_of' => 8], - 208 => ['name' => ' [8]', 'act' => 2, 'type_of' => 8], - 207 => ['name' => ' [9]', 'act' => 2, 'type_of' => 8], - 206 => ['name' => ' [10]', 'act' => 2, 'type_of' => 8], - 284 => ['name' => ' [11]', 'act' => 2, 'type_of' => 8], - - // - 175 => ['name' => ' [7]', 'act' => 2, 'type_of' => 8], - 176 => ['name' => ' [8]', 'act' => 2, 'type_of' => 8], - 177 => ['name' => ' [9]', 'act' => 2, 'type_of' => 8], - 178 => ['name' => ' [10]', 'act' => 2, 'type_of' => 8], - 179 => ['name' => ' [11]', 'act' => 2, 'type_of' => 8], - - // - 42 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 121 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 122 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 123 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 124 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 125 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - - 249 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 248 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 251 => ['name' => ': ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 252 => ['name' => ': ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - - // - 273 => ['name' => ' [10]', 'act' => 1, 'type_of' => 4], - 286 => ['name' => ' [9]', 'act' => 1, 'type_of' => 4], - 287 => ['name' => ' [8]', 'act' => 1, 'type_of' => 4], - 288 => ['name' => ' [7]', 'act' => 1, 'type_of' => 4], - - 255 => ['name' => ' ', 'act' => 2, 'type_of' => 8], - - //// - 337 => ['name' => ' ', 'act' => 2, 'type_of' => 5], - - // - 33 => ['name' => ' [6]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 56 => ['name' => ' [7]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 57 => ['name' => ' [8]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 58 => ['name' => ' [9]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 59 => ['name' => ' [10]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 60 => ['name' => ' [11]', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - - // - 245 => ['name' => ' ', 'act' => 2, 'type_of' => 9], - - //// - 327 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 328 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 329 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 330 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 331 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 332 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 333 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 3], - 334 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 335 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3,], - - //1 , - 299 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 300 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 301 => ['name' => ' ', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 302 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 303 => ['name' => ' ', 'act' => 2, 'type_of' => 4], - 304 => ['name' => ' !', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - 305 => ['name' => '', 'act' => 2, 'type_of' => 0, 'moment' => 0, 'moment_end' => 3], - ]; - - /** - * @return void - */ - private function saveLogs() - { - mysql_query('INSERT INTO `battle_logs_save` SELECT `id`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type` FROM `battle_logs` WHERE `battle` = ' . $this->info['id'] . ' AND `id_hod` <= ' . $this->hodID); - mysql_query('DELETE FROM `battle_logs` WHERE `battle` = ' . $this->info['id'] . 'all'); - mysql_query('DELETE FROM `battle_stat` WHERE `battle` < ' . ($this->info['id'] - 100)); - mysql_query('DELETE FROM `battle_actions` WHERE `btl` = ' . $this->info['id']); - } - - /** Priems - * @param $uid - * @param $hp - * @param $false_t7 - * @return false|float - */ - public function hphe($uid, $hp, $false_t7 = false) - { - if (!isset($this->stats[$this->uids[$uid]])) { - echo 'WARNING! ! !'; - } else { - $hpnow = floor($this->stats[$this->uids[$uid]]['hpNow']); - $hpall = $this->stats[$this->uids[$uid]]['hpAll']; - if ($hp > 0) { - // - if ($hpnow + $hp > $hpall) { - $hpli = $hpnow + $hp - $hpall; - $hp -= $hpli; - } - if (isset($this->stats[$this->uids[$uid]]['min_heal_proc']) && $this->stats[$this->uids[$uid]]['min_heal_proc'] < -99) { - $hp = 0; - } else { - $hp = $hp / 100 * (100 + $this->stats[$this->uids[$uid]]['min_heal_proc']); - } - // - if (!$false_t7) { - if ($this->users[$this->uids[$uid]]['tactic7'] <= 0) { - $hp = 0; - $this->users[$this->uids[$uid]]['tactic7'] = 0; - $this->stats[$this->uids[$uid]]['tactic7'] = $this->users[$this->uids[$uid]]['tactic7']; - } else { - $gdhh = round($hp / $this->stats[$this->uids[$uid]]['hpAll'] * 10, 2); - if ($gdhh == 0) { - $gdhh = 0.01; - } - - $gdhd = round($this->users[$this->uids[$uid]]['tactic7'] / $gdhh * 100); - - $this->users[$this->uids[$uid]]['tactic7'] = round(($this->users[$this->uids[$uid]]['tactic7'] - $gdhh), - 2); - if ($this->users[$this->uids[$uid]]['tactic7'] < 0) { - $this->users[$this->uids[$uid]]['tactic7'] = 0; - } - $this->stats[$this->uids[$uid]]['tactic7'] = $this->users[$this->uids[$uid]]['tactic7']; - if ($gdhd < 100) { - $hp = floor($hp / 100 * $gdhd); - } - } - } - } elseif ($hp < 0) { - // - if ($hpnow + $hp < 0) { - $hpli = $hpnow + $hp; - $hp += -($hpli); - } - } - - if ($this->stats[$this->uids[$uid]]['hpNow'] < 1) { - $hp = 0; - } - - $this->stats[$this->uids[$uid]]['last_hp'] = -$hp; - mysql_query('UPDATE `stats` SET - `last_hp` = ' . $this->users[$this->uids[$uid]]['last_hp'] . ', - `tactic7` = ' . $this->users[$this->uids[$uid]]['tactic7'] . ' - WHERE `id` = ' . $uid); - } - - return floor($hp); - } - - public function deleffm($pid, $uid, $id) - { - if ($id > 0) { - if (!mysql_query('DELETE FROM `eff_users` WHERE `id` = ' . $id . ' AND `v1` = "priem" AND `v2` != 0')) { - echo '[* [' . $id . ',' . $pid . ',' . $uid . ']]'; - } - } else { - mysql_query('DELETE FROM `eff_users` WHERE `uid` = ' . $uid . ' AND `v1` = "priem" AND `v2` = ' . $pid); - } - } - - /** - * @var int - */ - private $na = 1; - - /** % - * @var int - */ - private $expCoef = 0; - - /** - * @var int - */ - private $aBexp = 0; - - /** uid - * $ga[ {id } ][ {id } ] - * @var array - */ - private $ag = []; - - /** ID - * @var array - */ - private $bots = []; - - /** i ??? - * @var array - */ - private $iBots = []; - - private $stnZbVs = 0; - private $stnZb = []; - - /** (?) [?] - * @var array - */ - private $uAtc = [ - 'id' => 0, - 'a' => [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0], - 'b' => 0, - ]; - - /** - * @var string[][] - */ - private $lg_itm = [ - 0 => ['', ' ', '', '', '', ' ', ' ', ''], - 1 => ['', ' ', ' ', ' '], - 2 => [' ', '', ' ', '', ' '], - 3 => ['', '', ' ', '', ' ', ' '], - 4 => ['', '', '', ' ', ' ', ' ', ' ', ' ',], - 5 => [' ', '', ' ', ' ', ' '], - 22 => [''], - ]; - - /** - * @var string[][] - */ - private $lg_zon = [ - 1 => [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',], - 2 => [' ', ' ', ' ', ' ', ' '], - 3 => [' ', ' ', ' ', ' '], - 4 => [' < >', ' ', ' ', ' ', ' '], - 5 => [' ', ' ', ' ', ' ', ' '], - ]; - - /** () - * @var - */ - public $e; - - /** - * @var bool - */ - public $cached = false; - - /** : - *
1 - , - *
2 - , - *
3 - . - * @var int - */ - public $mainStatus = 1; - - /** - * @var array - */ - public $info = []; - - /** - * @var array - */ - public $users = []; - - /** - * @var array - */ - public $stats = []; - - /** id stats users. - *
id = 555 , $uids[555] users \ stats - * @var array - */ - public $uids = []; - - /** () - * @var array - */ - public $atacks = []; - - /** uid - *
$ga[ {id } ][ {id } ] - * @var array - */ - public $ga = []; - public $hodID = 0; - - public $is = []; - public $items = []; - - private $uclearc = []; - private $ucleari = []; - private $user = []; - /** - * @param $uid - * @return void - */ - private function clear_cache($uid) - { - if ($uid > 0 && !isset($this->uclearc[$uid])) { - $this->uclearc[$uid] = true; - $this->ucleari[] = $uid; - } - } - - /** - * @return void - */ - public function clear_cache_start() - { - $q = 'delete from battle_cache where uid in (' . implode(', ', $this->ucleari) . ')'; - mysql_query($q); - } - - // - - /** . Priems. - *
. - * @param $pid - * @param $u1 - * @param $u2 - * @param $hp - * @return mixed - */ - public function testYronPriemAttack($pid, $u1, $u2, $hp) - { - // 1 2 pid hp . - /* */ - // - - foreach ($this->stats[$this->uids[$u2]]['effects'] as $effect) { - if ( - isset($effect) && - $effect['id_eff'] == 22 && - $effect['v1'] == 'priem' && - in_array($effect['v2'], [45, 140, 211]) - ) { - // = 1 , 0 - $hp['y'] = -1; - $hp['r'] = 1; - $hp['k'] = 2; - $hp['m_y'] = 1; - $hp['m_k'] = 2; - } - } - return $hp; - } - - /** - * @param $y - * @param $s1 - * @param $s2 - * @param $id1 - * @param $id2 - * @return float|int - */ - private function testExp($y, $s1, $s2, $id1, $id2) - { - global $c; - // - $oplevel = [ // . - 0 => 1, - 1 => 1, - 2 => 1, - 3 => 1, - 4 => 2, - 5 => 2, - 6 => 2, - 7 => 2, - 8 => 3, - 9 => 4, - 10 => 5, - 11 => 6, - 12 => 7, - 13 => 50, - 14 => 75, - ]; - - if ($y < 0) { - $y = 0; - } - if ($s2['hpNow'] < 0) { - $y = 0; - } - if ($s2['hpNow'] < $y) { - $y = $s2['hpNow']; - } - if ($y < 0) { - $y = 0; - } - $addExp = (int)($y * $oplevel[$this->users[$this->uids[$s2['id']]]['level']]); - if ($s2['hpAll'] - $y <= 0) { - $addExp = 100; - } - - if ($addExp < 0) { - $addExp = 0; - } - if ($s2['levels'] != 'undefined' && $this->users[$this->uids[$s2['id']]]['pass'] != 'saintlucia') { - if ($this->info['razdel'] != 5 && $c['exp_limit_many']) { - $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]; - // - if ($texp > 5) { - $addExp = $addExp * 0.00; - } elseif ($texp > 4) { - $addExp = $addExp * 0.50; - } elseif ($texp > 3) { - $addExp = $addExp * 0.75; - } elseif ($texp > 2) { - $addExp = $addExp * 1.00; - } elseif ($texp > 1) { - $addExp = $addExp * 1.00; - } else { - $addExp = $addExp * 1.00; - } - } - } else { - $addExp = 0; - } - - return $addExp; - } - - /** \ - * @param $id - * @param $y - * @param $id1 - * @param $id2 - * @param $mgregen - * @return void - */ - public function takeExp($id, $y, $id1, $id2, $mgregen = false) - { - global $u; - if (isset($this->users[$this->uids[$id]])) { - $s1 = $this->stats[$this->uids[$id1]]; - $s2 = $this->stats[$this->uids[$id2]]; - if ($id1 != $id2) { - $e = $this->testExp($y, $s1, $s2, $id1, $id2); - } else { - $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 = [ // . - 4 => 750, - 5 => 1500, - 6 => 3500, - 7 => 8000, - 8 => 25000, - 9 => 50000, - 10 => 75000, - 11 => 125000, - 12 => 250000, - 13 => 500000, - 14 => 750000, - ]; - $dun_expFactor = [ // . - 4 => 5, - 5 => 5, - 6 => 5, - 7 => 5, - 8 => 5, - 9 => 3, - 10 => 1, - 11 => 1, - 12 => 1, - 13 => 1, - 14 => 1, - ]; - - if (isset($dun_expFactor[(int)$this->users[$this->uids[$id1]]['level']])) { - $e = $e * $dun_expFactor[(int)$this->users[$this->uids[$id1]]['level']]; - } - if ($this->info['dungeon'] > 1 && $this->users[$this->uids[$id1]]['battle'] > 0) { // - $dun_exp = []; // . - $rep = mysql_fetch_array(mysql_query('SELECT `dungeonexp`,`id` FROM `rep` WHERE `id` = ' . $this->users[$this->uids[$id1]]['id'])); - $rep = explode(',', $rep['dungeonexp']); - foreach ($rep as $key => $val) { - $val = explode('=', $val); - if (isset($val[0]) && isset($val[1]) && $val[0] != '' && $val[1] != 0) { - $dun_exp[(int)$val[0]] = (int)$val[1]; - } // - } - unset($rep); - - if (!isset($dun_exp[$this->info['dungeon']])) { - $dun_exp[$this->info['dungeon']] = 0; - } - if (!isset($dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']])) { // , . - $e = 0; - } elseif ( - isset($dun_exp[$this->info['dungeon']]) && - $dun_exp[$this->info['dungeon']] >= $dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']] - ) { // , . - $e = 0; - } elseif ( - isset($dun_exp[$this->info['dungeon']]) && - $dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']] > $dun_exp[$this->info['dungeon']] - ) { // . - if (($dun_exp[$this->info['dungeon']] + $e) > $dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']]) { - // , . - $e = abs($e - abs($dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']] - ($e + $dun_exp[$this->info['dungeon']]))); - $dun_exp[$this->info['dungeon']] += $e; - } elseif ($dun_limitForLevel[(int)$this->users[$this->uids[$id1]]['level']] > ($dun_exp[$this->info['dungeon']] + $e)) { - // , . - $dun_exp[$this->info['dungeon']] += $e; - } else { - $e = 0; - } - } else { // . - $e = 0; - } - } else // . - { - if ($this->info['dungeon'] == 102) { - $e = floor($e * 0.002); - } - } - } - - $this->users[$this->uids[$id1]]['battle_exp'] += floor($e); - // - if (!$mgregen) { - $this->users[$this->uids[$id1]]['battle_yron'] += floor($y); - if ($this->stats[$this->uids[$id1]]['notactic'] != 1) { - if ($s2['hpAll'] <= 1000) { - if ($this->stats[$this->uids[$id2]]['this_animal'] == 0) { - $this->users[$this->uids[$id1]]['tactic6'] += round(0.1 * (floor($y) / $s2['hpAll'] * 100), - 10); - } else { - $this->users[$this->uids[$id1]]['tactic6'] += round(0.1 * (floor($y) / $s2['hpAll'] * 100), - 10) / 3; - } - } else { - if ($this->stats[$this->uids[$id2]]['this_animal'] == 0) { - $this->users[$this->uids[$id1]]['tactic6'] += round(0.1 * (floor($y) / 1000 * 100), 10); - } else { - $this->users[$this->uids[$id1]]['tactic6'] += round(0.1 * (floor($y) / 1000 * 100), 10) / 3; - } - } - } - } - - $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); - if (!$upd) { - echo '[ ]'; - } else { - $this->stats[$this->uids[$id1]]['battle_exp'] = $this->users[$this->uids[$id1]]['battle_exp']; - $this->clear_cache($id1); - $this->stats[$this->uids[$id1]]['tactic6'] = $this->users[$this->uids[$id1]]['tactic6']; - if ($id1 == $u->info['id']) { - $u->info['tactic6'] = $this->users[$this->uids[$id1]]['tactic6']; - $u->stats['tactic6'] = $this->users[$this->uids[$id1]]['tactic6']; - $u->info['battle_exp'] = $this->users[$this->uids[$id1]]['battle_exp']; - $u->info['battle_yron'] = $this->users[$this->uids[$id1]]['battle_yron']; - $u->info['notactic'] = $this->users[$this->uids[$id1]]['notactic']; - $u->stats['notactic'] = $this->users[$this->uids[$id1]]['notactic']; - } - } - unset($s1, $s2); - } - } - - /** . - * @param $uid - * @param $y - * @return void - * @todo Priems. - */ - public function takeYronNow($uid, $y) - { - global $u; - $this->users[$this->uids[$uid]]['battle_yron'] += floor($y); - $this->stats[$this->uids[$uid]]['battle_yron'] += floor($y); - if ($uid == $u->info['id']) { - $u->info['battle_yron'] += floor($y); - $u->stats['battle_yron'] += floor($y); - } - mysql_query('UPDATE `stats` SET `battle_yron` = `battle_yron` + ' . mysql_real_escape_string(floor($y)) . ' WHERE `id` = ' . (int)$uid); - } - - /** JS . , _battles.. - * @param $id - * @param $t - * @return false|string - */ - public function myInfo($id, $t) - { - global $u; - if (isset($this->users[$this->uids[$id]]) || $u->info['id'] == $id) { - if ($u->info['id'] == $id || ($u->info['enemy'] == $id && $id > 0)) { - // - $this->users[$this->uids[$id]] = mysql_fetch_array(mysql_query('SELECT - - `u`.`zag`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`online`,`u`.`admin`,`u`.`city`,`u`.`cityreg`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`, - `u`.`level`,`u`.`money`,`u`.`money3`,`u`.`money2`,`u`.`money4`,`u`.`battle`,`u`.`sex`,`u`.`obraz`,`u`.`win`,`u`.`win_t`, - `u`.`lose`,`u`.`lose_t`,`u`.`nich`,`u`.`timeMain`,`u`.`invis`,`u`.`bot_id`,`u`.`animal`,`u`.`type_pers`, - `u`.`notrhod`,`u`.`bot_room`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`activ`,`u`.`stopexp`,`u`.`real`, - - `st`.* - - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id` = "' . $id . '" LIMIT 1')); - $this->stats[$this->uids[$id]] = $u->getStats($this->users[$this->uids[$id]], 0, 0, false, false, true); - } - - $ur = $this->users[$this->uids[$id]]; - $st = $this->stats[$this->uids[$id]]; - $itm = $this->stats[$this->uids[$id]]['items']; - $eff = $this->stats[$this->uids[$id]]['effects']; - $ef = ''; - $i = 0; - if ($u->info['seff'] < 1) { - $ef .= '
\',event,3,1,1,1,\'\');\" onmouseout=\"top.hic();\" onmousedown=\"top.hic();\">
'; - - while ($i != -1) { - $nseef = 0; - if ($this->users[$this->uids[$ur['id']]]['id'] != $u->info['id'] && $ur['id'] != 0) { - if ($this->stats[$this->uids[$ur['id']]]['seeAllEff'] != 1) { - $nseef = 1; - if ($eff[$i]['v1'] == 'priem') { - $eff[$i]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $eff[$i]['v2'] . '" LIMIT 1')); - } - if (isset($eff[$i]['priem']['id']) && $eff[$i]['priem']['neg'] == 1) { - $nseef = 0; - } - } - } - - if (isset($eff[$i]) && $eff[$i] != 'delete') { - if ($nseef == 0) { - $ei = '' . $eff[$i]['name'] . ''; - if ($eff[$i]['x'] > 1) { - $ei .= ' x' . $eff[$i]['x'] . ' '; - } - if ($eff[$i]['type1'] > 0 && $eff[$i]['type1'] < 7) { - $ei .= ' ()'; - } elseif (($eff[$i]['type1'] > 6 && $eff[$i]['type1'] < 11) || $eff[$i]['type1'] == 16) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 14) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 15) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 17) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 18 || $eff[$i]['type1'] == 19) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 20) { - $ei .= ' ()'; - } elseif ($eff[$i]['type1'] == 22) { - $ei .= ' ()'; - } else { - $ei .= ' ()'; - } - $ei .= '
'; - - $out = ''; - $time_still = ($eff[$i]['timeUse'] + ($eff[$i]['timeAce'] - $eff[$i]['timeUse']) + $eff[$i]['actionTime']); - if ($eff[$i]['timeAce'] == 0) { - $time_still += $eff[$i]['timeUse']; - } - $time_still -= time(); - if ($eff[$i]['bp'] == 0 && $eff[$i]['timeUse'] != 77) { - if ($eff[$i]['type1'] != 13) { - $ei .= ': ' . $u->timeOut($time_still); - } - } else { - if ($eff[$i]['timeUse'] != 77 && $eff[$i]['hod'] < 1) { - $ei .= ': ' . $u->timeOut($time_still); - } elseif ($eff[$i]['hod'] >= 0) { - $ei .= ': ' . $eff[$i]['hod']; - } - } - - if ($eff[$i]['user_use'] != '') { - if ($this->users[$this->uids[$eff[$i]['user_use']]]['login2'] != '') { - $ei .= '
: ' . $this->users[$this->uids[$eff[$i]['user_use']]]['login2'] . ''; - } elseif ($this->users[$this->uids[$eff[$i]['user_use']]]['login'] != '') { - $ei .= '
: ' . $this->users[$this->uids[$eff[$i]['user_use']]]['login'] . ''; - } - } - - // - $tr = ''; - $ti = $u->items['add']; - $x = 0; - $ed = $this->lookStats($eff[$i]['data']); - while ($x < count($ti)) { - $n = $ti[$x]; - if (isset($ed['add_' . $n], $u->is[$n]) && $n != 'pog') { - $z = ''; - if ($ed['add_' . $n] > 0) { - $z = '+'; - } - $tr .= '
' . $u->is[$n] . ': ' . $z . $ed['add_' . $n]; - } - $x++; - } - - if ($ed['add_mib1'] != 0) { - if ($ed['add_mab1'] != 0) { - $tr .= '
: ' . $ed['add_mib1'] . '-' . $ed['add_mab1']; - } else { - $m1l = $ed['add_mib1']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= '
: ' . $m1l; - } - } - if ($ed['add_mib2'] != 0) { - if ($ed['add_mab2'] != 0) { - $tr .= '
: ' . $ed['add_mib2'] . '-' . $ed['add_mab2']; - } else { - $m1l = $ed['add_mib2']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= '
: ' . $m1l; - } - } - if ($ed['add_mib3'] != 0) { - if ($ed['add_mab3'] != 0) { - $tr .= '
: ' . $ed['add_mib3'] . '-' . $ed['add_mab3']; - } else { - $m1l = $ed['add_mib3']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= '
: ' . $m1l; - } - } - if ($ed['add_mib4'] != 0) { - if ($ed['add_mab4'] != 0) { - $tr .= '
: ' . $ed['add_mib4'] . '-' . $ed['add_mab4']; - } else { - $m1l = $ed['add_mib4']; - if ($m1l > 0) { - $m1l = '+' . $m1l; - } - $tr .= '
: ' . $m1l; - } - } - - $efix = 0; - if (isset($ed['add_pog2']) && $ed['add_pog2'] > 0) { - $efix = $ed['add_pog2']; - } - if (isset($ed['add_pog'])) { - $tr .= '
' . $ed['add_pog'] . ' . '; - } - if (isset($ed['add_pog2'])) { - $tr .= '
' . $ed['add_pog2'] . ' . (' . $ed['add_pog2p'] . '%)'; - } - - if ($tr != '') { - $ei .= $tr; - } - if ($eff[$i]['info'] != '') { - $ei .= '
:
' . $eff[$i]['info']; - } - - $ef .= '
'; - unset($efix); - } - } elseif ($eff[$i] != 'delete') { - $i = -2; - } - $i++; - } - } else { - $ef .= '
\',event,3,1,1,1,\'\');\" onmouseout=\"top.hic();\" onmousedown=\"top.hic();\">
'; - } - - $ca = ''; - if ($ur['clan'] > 0) { - $cl = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = ' . $ur['clan'])); - if (isset($cl['id'])) { - $ca = ''; - } - } - if ($ur['align'] > 0) { - $ca = '' . $ca; - } - if ($ur['login2'] == '') { - $ur['login2'] = $ur['login']; - } - if (floor($st['hpNow']) > $st['hpAll']) { - $st['hpNow'] = $st['hpAll']; - } - if (floor($st['mpNow']) > $st['mpAll']) { - $st['mpNow'] = $st['mpAll']; - } - $stsua = '' . $ur['login2'] . ''; - $stsua .= '
: ' . $st['s1']; - $stsua .= '
: ' . $st['s2']; - $stsua .= '
: ' . $st['s3']; - $stsua .= '
: ' . $st['s4']; - if ($st['s5'] != 0) { - $stsua .= '
: ' . $st['s5']; - } - if ($st['s6'] != 0) { - $stsua .= '
: ' . $st['s6']; - } - if ($st['s7'] != 0) { - $stsua .= '
: ' . $st['s7']; - } - if ($u->info['admin'] > 0) { - $align = $ur['align']; - } - $tp_img = [ - 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 - ]; - $info = 'info_reflesh(' . $t . ',' . $ur['id'] . ',"' . $ca . '' . $ur['login2'] . ' [' . $ur['level'] . '] ","' . $ur['obraz'] . '",' . floor($st['hpNow']) . ',' . floor($st['hpAll']) . ',' . floor($st['mpNow']) . ',' . floor($st['mpAll']) . ',0,' . $ur['sex'] . ',"' . $ef . '","' . $stsua . '", "' . $align . '", "' . $ur['zag'] . '");shpb();'; - $i = 0; - while ($i < count($itm)) { - // - if (isset($st['items_img'][$tp_img[$itm[$i]['inOdet']]])) { - $itm[$i]['img'] = $st['items_img'][$tp_img[$itm[$i]['inOdet']]]; - } - // - $ttl = '' . $itm[$i]['name'] . ''; - $td = $this->lookStats($itm[$i]['data']); - $lvar = ''; - if ($td['add_hpAll'] > 0) { - $td['add_hpAll'] = '+' . $td['add_hpAll']; - $lvar .= '
: ' . $td['add_hpAll']; - } - if ($td['sv_yron_max'] > 0 || $td['sv_yron_min'] > 0) { - $lvar .= '
: ' . (0 + $td['sv_yron_min']) . '-' . (0 + $td['sv_yron_max']); - } - if ($td['add_mab1'] > 0) { - if ($td['add_mib1'] == $td['add_mab1'] && $pl['geniration'] == 1) { - $m1l = '+'; - $lvar .= '
: ' . $m1l . (0 + $td['add_mab1']); - } else { - $lvar .= '
: ' . (0 + $td['add_mib1']) . '-' . (0 + $td['add_mab1']); - } - } - if ($td['add_mab2'] > 0) { - if ($td['add_mib2'] == $td['add_mab2'] && $pl['geniration'] == 1) { - $m1l = '+'; - $lvar .= '
: ' . $m1l . (0 + $td['add_mab2']); - } else { - $lvar .= '
: ' . (0 + $td['add_mib2']) . '-' . (0 + $td['add_mab2']); - } - } - if ($td['add_mab3'] > 0) { - if ($td['add_mib3'] == $td['add_mab3'] && $pl['geniration'] == 1) { - $m1l = '+'; - $lvar .= '
: ' . $m1l . (0 + $td['add_mab3']); - } else { - $lvar .= '
: ' . (0 + $td['add_mib3']) . '-' . (0 + $td['add_mab3']); - } - } - if ($td['add_mab4'] > 0) { - if ($td['add_mib4'] == $td['add_mab4'] && $pl['geniration'] == 1) { - $m1l = '+'; - $lvar .= '
: ' . $m1l . (0 + $td['add_mab4']); - } else { - $lvar .= '
: ' . (0 + $td['add_mib4']) . '-' . (0 + $td['add_mab4']); - } - } - if ($itm[$i]['iznosMAX'] > 0) { - if ($itm[$i]['iznosMAXi'] == 999999999) { - $lvar .= '
: '; - } else { - $lvar .= '
: ' . floor($itm[$i]['iznosNOW']) . '/' . floor($itm[$i]['iznosMAX']); - } - } - $ttl .= $lvar; - $ccv = ''; - - if ($itm[$i]['magic_inci'] != '' || $itm[$i]['magic_inc'] != '') { - if ($itm[$i]['magic_inc'] == '') { - $itm[$i]['magic_inc'] = $itm[$i]['magic_inci']; - } - $temp01 = mysql_query('SELECT * FROM `eff_main` WHERE `id2` = ' . $itm[$i]['magic_inc'] . ' AND `type1` = 12345 LIMIT 1'); - if ($temp01) { - $mgi = mysql_fetch_array($temp01); - if (isset($mgi['id2'])) { - $ccv .= 'top.useMagicBattle(\'' . $mgi['mname'] . '\',' . $itm[$i]['id'] . ',\'' . $mgi['img'] . '\',1,2);'; - } - } - } - - $info .= 'abitms(' . (0 + $t) . ',' . (0 + $itm[$i]['uid']) . ',' . (0 + $itm[$i]['id']) . ',' . (0 + $itm[$i]['inOdet']) . ',"' . $itm[$i]['name'] . '","' . $ttl . '","' . $itm[$i]['img'] . '","' . $ccv . '");'; - $i++; - } - - return $info; - } else { - return false; - } - } - - // - public function testUsersLive() - { - $tl = 0; - for ($i = 0; $i < count($this->uids); $i++) { - if ($this->stats[$i]['id'] <= 0) { - continue; - } - if (isset($tml[$this->users[$i]['team']]) || floor($this->stats[$i]['hpNow']) < 1) { - continue; - } - $tml[$this->users[$i]['team']] = 1; - $tl++; - if ($tl > 1) { - break; - } - } - return $tl > 1; - } - - // - private function miniLogAdd(array $user, $text) - { - $time = time(); - $vLog = 'at1=00000||at2=00000||zb1=0||zb2=0||bl1=0||bl2=0||time1=' . $time . - '||time2=' . $time . - '||s1=' . $user['sex'] . - '||t1=' . $user['team'] . - '||login1=' . $user['login'] . - '||'; - $mas1 = [ - 'time' => $time, - 'battle' => $this->info['id'], - 'id_hod' => ($this->hodID + 1), - 'text' => $text, - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - - $this->add_log($mas1); - } - - /** . - *
[ ]: . - * @return void - */ - public function testFinish() - { - global $u; - // - mysql_query('START TRANSACTION;'); - // - $test = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `team_win` = -1 LIMIT 1 FOR UPDATE')); - // - mysql_query('COMMIT;'); - // - if ($this->info['team_win'] == -1 && isset($test['id'])) { - $hp = []; - $tml = []; - $tmv = []; - $tl = 0; - $i = 0; - $j = 0; - while ($i < count($this->uids)) { - if ($this->stats[$i]['id'] > 0) { - if (floor($this->stats[$i]['hpNow']) < 1) { - $this->stats[$i]['hpNow'] = 0; - } - $hp[$this->users[$i]['team']] += floor($this->stats[$i]['hpNow']); - if (!isset($tml[$this->users[$i]['team']]) && floor($this->stats[$i]['hpNow']) >= 1) { - $tml[$this->users[$i]['team']] = 1; - $tmv[$j] = $this->users[$i]['team']; - $tl++; - } - } - $i++; - } - - if ($tl <= 1) { - //. - $tmHpNow = []; - $tmNow = []; - $sp = mysql_query('SELECT `u`.`login`,`u`.`id`,`u`.`battle`,`s`.`team`,`s`.`hpNow` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`battle` = "' . $this->info['id'] . '"'); - while ($pl = mysql_fetch_array($sp)) { - if (!isset($tmHpNow[$pl['team']])) { - $tmHpNow[$pl['team']] = 0; - $tmNow[] = $pl['team']; - } - $hpTm = floor($pl['hpNow']); - if ($hpTm < 0) { - $hpTm = 0; - } - if ($hpTm > 0) { - $tmHpNow[$pl['team']] += $pl['hpNow']; - } - } - $gdj = 0; - $i = 0; - while ($i < count($tmNow)) { - if (isset($tmNow[$i])) { - $j = $tmNow[$i]; - if ($tmHpNow[$j] > 0) { - $gdj++; - } - } - $i++; - } - if ($gdj > 1) { - $tl = $gdj; - echo ' ... ( )'; - } - } - - if ($tl <= 1) { - // , - , - - $i = 0; - $tmwin = 0; - while ($i < count($tmv)) { - if ($tmv[$i] >= 1 && $tml[$tmv[$i]] > 0) { - $tmwin = $tmv[$i]; - } - $i++; - } - - if ($this->info['izlom'] == 0) { - $rs = ''; - $ts = []; - $tsi = 0; - if ($this->info['id'] > 0) { - // - unset($this->users, $this->stats, $this->uids, $this->bots, $this->iBots); - $trl = mysql_query('SELECT `u`.`no_ip`,`u`.`id`,`u`.`notrhod`,`u`.`login`,`u`.`login2`,`u`.`sex`,`u`.`online`,`u`.`admin`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`,`u`.`level`,`u`.`battle`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`animal`,`st`.`stats`,`st`.`hpNow`,`st`.`mpNow`,`st`.`exp`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`battle_text`,`st`.`upLevel`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`bot`,`st`.`lider`,`st`.`btl_cof`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`id`,`st`.`last_hp`,`st`.`last_pr`,`u`.`sex`,`u`.`money`,`u`.`money3`,`u`.`money2`,`u`.`bot_id` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle` = "' . $this->info['id'] . '" ORDER BY `st`.`bot` DESC'); - $ir = 0; - $bi = 0; - $this->users = null; - $this->stats = null; - $this->uids = null; - $this->bots = null; - $this->iBots = null; - while ($pl = mysql_fetch_array($trl)) { - // - if ($pl['login2'] == '') { - $pl['login2'] = $pl['login']; - } - $this->users[$ir] = $pl; - $this->uids[$pl['id']] = $ir; - if ($pl['bot'] > 0) { - $this->bots[$bi] = $pl['id']; - $this->iBots[$pl['id']] = $bi; - $bi++; - } - // - $this->stats[$ir] = $u->getStats($pl, 0, 0, false, false, true); - $ir++; - } - } - } elseif (!isset($this->uids[$u->info['id']])) { - $rs = ''; - $ts = []; - $tsi = 0; - if ($this->info['id'] > 0) { - // - $trl = mysql_query('SELECT `u`.`no_ip`,`u`.`id`,`u`.`notrhod`,`u`.`login`,`u`.`login2`,`u`.`sex`,`u`.`online`,`u`.`admin`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`,`u`.`level`,`u`.`battle`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`animal`,`st`.`stats`,`st`.`hpNow`,`st`.`mpNow`,`st`.`exp`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`battle_text`,`st`.`upLevel`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`bot`,`st`.`lider`,`st`.`btl_cof`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`id`,`st`.`last_hp`,`st`.`last_pr`,`u`.`sex`,`u`.`money`,`u`.`bot_id`,`u`.`money3`,`u`.`money2` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id` = "' . $this->info['id'] . '" LIMIT 1'); - $pl = mysql_fetch_array($trl); - // - if ($pl['login2'] == '') { - $pl['login2'] = $pl['login']; - } - $this->users[] = $pl; - $this->uids[$pl['id']] = $ir; - if ($pl['bot'] > 0) { - $this->bots[] = $pl['id']; - $this->iBots[$pl['id']] = $bi; - } - // - $this->stats[] = $u->getStats($pl, 0, 0, false, false, true); - } - } - - - if ($this->info['izlom'] > 0 && $tmwin == 1) { - // - $i = 0; - $dlt = ''; - $dlt2 = ''; - $sp = mysql_query('SELECT `users`.`id`,`stats`.`bot`,`stats`.`team` FROM `users`,`stats` WHERE `users`.`battle` = "' . $this->info['id'] . '" AND `stats`.`id` = `users`.`id` LIMIT 250'); - while ($pl = mysql_fetch_array($sp)) { - if ($pl['bot'] == 1 && $pl['team'] != $u->info['team']) { - $dlt .= ' `id`="' . $pl['id'] . '" OR'; - $dlt2 .= ' `uid`="' . $pl['id'] . '" OR'; - $i++; - } - } - - if ($i > 0) { - $dlt = trim($dlt, 'OR'); - $dlt2 = trim($dlt2, 'OR'); - mysql_query('DELETE FROM `users` WHERE ' . $dlt . ' LIMIT ' . $i); - mysql_query('DELETE FROM `stats` WHERE ' . $dlt . ' LIMIT ' . $i); - mysql_query('DELETE FROM `items_users` WHERE ' . $dlt2 . ' LIMIT ' . ($i * 100)); - mysql_query('DELETE FROM `eff_users` WHERE ' . $dlt2 . ' LIMIT ' . ($i * 100)); - } - - unset($i, $dlt, $dlt2); - - $j = 0; - $k = 0; - $obr = 0; - - // , - if ($this->get_chanse(20)) { - // - if ($this->info['izlomLvl'] == 8) { - $bots = [ - ' ', - ' ', - '', - ' ', - ' ', - ]; - //$bots = array( ' ' ); - } - $logins_bot = []; - // - echo '
...
'; - // - $id2 = rand(0, (count($bots) - 1)); - $id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "' . $bots[$id2] . '" AND `pishera` != "" AND `active` = "1" ORDER BY `level` DESC LIMIT 1')); - $bot = $u->addNewbot($id['id'], null, null, $logins_bot, null, - round($this->info['izlomRoundSee'])); - if (isset($id['id']) && $bot) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - $u->addAction(time(), 'win_bot_' . $id['id'], '', $this->users[$i]['id']); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - } else { - // - if ($this->info['izlomLvl'] == 8) { - $bots = [ - '', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]; - } - $logins_bot = []; - // - $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, - ($this->info['izlomRoundSee'] * 2)); - if (isset($id['id']) && $bot) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - // - $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, $this->info['izlomRoundSee']); - if (isset($id['id']) && $bot) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - // - if (rand(0, 100) < 70) { - $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, - $this->info['izlomRoundSee']); - if (isset($id['id']) && $bot) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - } - // 10 = +1 - $irb = floor($this->info['izlomRoundSee'] / 10); - while ($irb > 0) { - // - if (rand(0, 100) < 20) { - $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, - $this->info['izlomRoundSee']); - if (isset($id['id']) && $bot) { - // - $btxt = ''; - if ($id['align'] > 0) { - $btxt = $btxt . ''; - } - if ($id['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $id['level'] . ']'; - if ($id['sex'] == 1) { - $btxt = $btxt . ' .'; - } else { - $btxt = $btxt . ' .'; - } - $this->miniLogAdd([ - 'login' => $id['login'], - 'sex' => $id['sex'], - 'team' => 0, - ], '{tm1} ' . $btxt); - // - $logins_bot = $bot['logins_bot']; - mysql_query('UPDATE `users` SET `battle`="' . $this->info['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); - if (rand(0, 10000) < 1500) { - $obr++; - } - $j++; - } - } - $irb--; - } - } - // - unset($logins_bot); - if ($j == 0) { - // - $this->finishBattle($tml, $tmv, null, $tl); - $fin1 = mysql_query('INSERT INTO `izlom_rating` (`uid`,`time`,`voln`,`level`,`bots`,`rep`,`obr`,`btl`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $this->info['izlomRoundSee'] . '","' . $this->info['izlomLvl'] . '","0","0","' . ($this->info['izlomObr'] - $this->info['izlomObrNow']) . '","' . $this->info['id'] . '")'); - } else { - $this->info['izlomRound'] = $iz['round']; - mysql_query('UPDATE `battle` SET `izlomObrNow` = ' . $obr . ',`izlomObr` = `izlomObr` + ' . $obr . ',`timeout` = (`timeout`+5),`izlomRound` = "' . ($this->info['izlomRound'] + 1) . '",`izlomRoundSee` = `izlomRoundSee`+1 WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - $this->stats[$this->uids[$u->info['id']]]['hpNow'] += $this->stats[$this->uids[$u->info['id']]]['hpAll'] * 0.25; - $this->stats[$this->uids[$u->info['id']]]['mpNow'] += $this->stats[$this->uids[$u->info['id']]]['mpAll'] * 0.25; - $this->users[$this->uids[$u->info['id']]]['hpNow'] = $this->stats[$this->uids[$u->info['id']]]['hpAll']; - $this->users[$this->uids[$u->info['id']]]['mpNow'] = $this->stats[$this->uids[$u->info['id']]]['mpAll']; - $vLog = 'at1=00000||at2=00000||zb1=' . $this->stats[$this->uids[$u1]]['zonb'] . '||zb2=' . $this->stats[$this->uids[$u2]]['zonb'] . '||bl1=' . $this->atacks[$id]['b' . $a] . '||bl2=' . $this->atacks[$id]['b' . $b] . '||time1=' . $this->atacks[$id]['time'] . '||time2=' . $this->atacks[$id]['time2'] . '||s2=' . $this->users[$this->uids[$u2]]['sex'] . '||s1=' . $this->users[$this->uids[$u1]]['sex'] . '||t2=' . $this->users[$this->uids[$u2]]['team'] . '||t1=' . $this->users[$this->uids[$u1]]['team'] . '||login1=' . $this->users[$this->uids[$u1]]['login2'] . '||login2=' . $this->users[$this->uids[$u2]]['login2'] . ''; - - $mas = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => ($this->hodID + 1), - 'vars' => $vLog, - 'type' => 1, - ]; - if ($u->info['sex'] == 1) { - $mas['text'] = '' . date('H:i') . ' ' . $u->info['login'] . ' "".'; - } else { - $mas['text'] = '' . date('H:i') . ' ' . $u->info['login'] . ' "".'; - } - if ($u->stats['hpNow'] < $u->stats['hpAll']) { - $hpSks = floor(($u->stats['hpAll'] * ((rand(15, 25)) / 100))); - if ($hpSks > floor($u->stats['hpAll'] - $u->stats['hpNow'])) { - $hpSks = floor($u->stats['hpAll'] - $u->stats['hpNow']); - } - $mas['text'] .= ' +' . $hpSks . ''; - } else { - $hpSks = 0; - $mas['text'] .= ' --'; - } - $mas['text'] .= ' [' . floor($u->info['hpNow'] + $hpSks) . '/' . $u->stats['hpAll'] . ']'; - $this->add_log($mas); - - mysql_query('UPDATE `stats` SET `hpNow` = "' . ($u->info['hpNow'] + ($u->stats['hpAll'] * ((rand(15, - 25)) / 100))) . '",`mpNow` = "' . ($u->info['mpNow'] + ($u->stats['mpAll'] * 0.25)) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - } - } else { - // - $this->finishBattle($tml, $tmv, null, $tl); - if ($this->info['izlom'] > 0) { - $fin1 = mysql_query('INSERT INTO `izlom_rating` (`uid`,`time`,`voln`,`level`,`bots`,`rep`,`obr`,`btl`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $this->info['izlomRoundSee'] . '","' . $this->info['izlomLvl'] . '","0","0","' . ($this->info['izlomObr'] - $this->info['izlomObrNow']) . '","' . $this->info['id'] . '")'); - } - } - if (isset($fin1)) { - mysql_query('INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","31","23","' . $u->info['id'] . '"," ","nofastfinisheff=1","' . time() . '")'); - 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'] . "',' ""x" . (($this->info['izlomObr'] - $this->info['izlomObrNow']) * 7) . "','" . time() . "','6','0')"); - $i01 = 1; - while ($i01 <= (($this->info['izlomObr'] - $this->info['izlomObrNow'])) * 7) { - $u->addItem(1226, $u->info['id'], '|sudba=' . $u->info['login']); - $i01++; - } - mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $u->info['id'] . '","' . time() . '","capitalcity","' . $u->info['room'] . '","izlom"," ","","")'); - unset($fin1); - } - } - } else { - mysql_query('START TRANSACTION;'); - $test = mysql_fetch_array(mysql_query('SELECT `id`,`team_win`, `testfinish` FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `team_win` != -1 LIMIT 1 FOR UPDATE')); - mysql_query('COMMIT;'); - if (isset($test['id'])) { - $this->finishBattle(null, null, 10, $tl); - } - } - } - - - /** . - *
! Ѩ! - *
. - * @param $t ??? - * @param $v ??? - * @param $nl ??? - * @param $tl [unused] ??? - * @return void - */ - private function finishBattle($t, $v, $nl, $tl) - { - global $u, $c; - mysql_query('LOCK TABLES users,stats,battle,battle_last,battle_end,chat WRITE'); - $frtu = false; - $test = mysql_fetch_array(mysql_query('SELECT `id`,`team_win`,`testfinish` FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `team_win` != -1 LIMIT 1;')); - if ($test['testfinish'] != -1) { - $trtt = mysql_query('UPDATE `battle` SET `testfinish` = "-1" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - $relbf = $this->info['team_win']; - if ($nl != 10) { - $i = 0; - $dnr = 0; - if ($this->info['team_win'] == -1) { - $this->info['team_win'] = 0; - while ($i < count($v)) { - if ($v[$i] >= 1 && $t[$v[$i]] > 0) { - $this->info['team_win'] = $v[$i]; - } - $i++; - } - } - } - - - // - $t = mysql_query('SELECT `u`.`stopexp`,`u`.`twink`,`u`.`city`,`u`.`room`,`u`.`no_ip`,`u`.`pass`,`u`.`id`,`u`.`notrhod`,`u`.`login`,`u`.`login2`,`u`.`sex`,`u`.`online`,`u`.`admin`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`,`u`.`level`,`u`.`battle`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`animal`,`st`.`stats`,`st`.`hpNow`,`st`.`mpNow`,`st`.`exp`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`battle_text`,`st`.`upLevel`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`bot`,`st`.`lider`,`st`.`btl_cof`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`id`,`st`.`last_hp`,`st`.`last_pr`,`u`.`sex`,`u`.`money`,`u`.`bot_id`,`u`.`money3`,`u`.`money2` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle` = "' . $this->info['id'] . '"'); - $i = 0; - $bi = 0; - 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, 0, false, false, true); - $i++; - } - unset($pl, $t); - - if ($this->info['time_over'] == 0) { - $tststrt = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `time_over` = "0" LIMIT 1')); - if (isset($tststrt['id'])) { - if ($this->info['inTurnir'] == 0 || $this->info['type'] == 500) { - mysql_query('UPDATE `battle` SET `time_over` = "' . time() . '",`team_win` = "' . $this->info['team_win'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - } - mysql_query('UPDATE `battle_stat` SET `team_win` = "' . $this->info['team_win'] . '" WHERE `battle_id` = "' . $this->info['id'] . '"'); - // - $i = 0; - $vl = ''; - $vtvl = ''; - $relu = 0; - while ($i < count($this->users)) { - $vl .= '("' . $this->users[$i]['login'] . '","' . $this->users[$i]['city'] . '","' . $this->info['id'] . '","' . $this->users[$i]['id'] . '","' . time() . '","' . $this->users[$i]['team'] . '","' . $this->users[$i]['level'] . '","' . $this->users[$i]['align'] . '","' . $this->users[$i]['clan'] . '","' . $this->users[$i]['exp'] . '","' . $this->users[$i]['bot'] . '","' . $this->users[$i]['money'] . '","' . $this->users[$i]['money2'] . '","' . $this->users[$i]['money3'] . '"),'; - if ($this->users[$i]['team'] == $this->info['team_win'] && $this->info['team_win'] > 0) { - $vtvl .= '' . $this->users[$i]['login'] . ', '; - } - $i++; - } - - $this->info['players_c'] = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `login` NOT LIKE "%(%" AND `battle` = "' . $this->info['id'] . '" LIMIT 1')); - $this->info['players_c'] = $this->info['players_c'][0]; - - mysql_query('UPDATE `battle` SET `players_c` = "' . $this->info['players_c'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - - if ($vtvl != '') { - $vtvl = rtrim($vtvl, ', '); - $vtvl = str_replace('"', '\\\\\"', $vtvl); - $this->hodID++; - $vLog = 'time1=' . time(); - $mass = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => 'test', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $vtvl = ' , ' . $vtvl . '.'; - } else { - $this->info['players_cc'] = mysql_fetch_array(mysql_query('SELECT COUNT(`u`.`id`) FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `s`.`hpNow` > 0 AND `u`.`battle` = "' . $this->info['id'] . '" AND `s`.`team` != "' . $u->info['team'] . '" LIMIT 1')); - $this->info['players_cc'] = $this->info['players_cc'][0]; - $this->info['players_cc2'] = mysql_fetch_array(mysql_query('SELECT COUNT(`u`.`id`) FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `s`.`hpNow` >= 1 AND `u`.`battle` = "' . $this->info['id'] . '" AND `s`.`team` != "' . $u->info['team'] . '" LIMIT 1')); - $this->info['players_cc2'] = $this->info['players_cc2'][0]; - $inf_test = ', users: ' . $this->info['players_cc'] . ' and ' . $this->info['players_cc2'] . ''; - $this->hodID++; - $vLog = 'time1=' . time(); - $mass = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => 'test', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $vtvl = ' , .'; - } - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - - $this->saveLogs(); - - if ($this->info['type'] == 99) { - $vLog = 'time1=' . time(); - $mass = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => 'test', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $vtvl = ' ...'; - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - $i = 0; - $vtvl = ''; - $tr_nm = [ - 1 => '', - 2 => '', - 3 => '', - 4 => '', - ]; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] != $this->info['team_win']) { - $tr_pl = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = "' . $this->users[$i]['id'] . '" AND `delete` = "0" ORDER BY `v1` DESC LIMIT 1')); - if (!isset($tr_pl['id']) || $tr_pl['v1'] < 3) { - if ($this->info['smert'] == 1) { - $tr_tp = 4; - } else { - $tr_tp = rand(1, 3); - } - if (isset($tr_pl['id'])) { - $tr_tp = rand(($tr_pl['v1'] + 1), 3); - } - if ($this->users[$i]['sex'] == 1) { - $vtvl = '' . $this->users[$i]['login'] . ' : ' . $tr_nm[$tr_tp] . ' .
' . $vtvl; - } else { - $vtvl = '' . $this->users[$i]['login'] . ' : ' . $tr_nm[$tr_tp] . ' .
' . $vtvl; - } - $this->addTravm($this->users[$i]['id'], $tr_tp, rand(3, 5)); - } - } - $i++; - } - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - } - - if ($vl != '') { - $vl = rtrim($vl, ','); - mysql_query('INSERT INTO `battle_last` (`login`,`city`,`battle_id`,`uid`,`time`,`team`,`lvl`,`align`,`clan`,`exp`,`bot`,`money`,`money2`,`money3`) VALUES ' . $vl . ''); - } - mysql_query('INSERT INTO `battle_end` (`battle_id`,`city`,`time`,`team_win`) VALUES ("' . $this->info['id'] . '","' . $this->info['city'] . '","' . $this->info['time_start'] . '","' . $this->info['team_win'] . '")'); - } - - - $vLog = 'time1=' . time(); - $mass = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => 'test', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $i = 0; - $vtvl = ''; - $tr_nm = [ - 1 => '', - 2 => '', - 3 => '', - 4 => '', - ]; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] != $this->info['team_win'] && $this->info['team_win'] > 0) { - $tr_pl = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "priem" AND `v2` = 292 AND `uid` = "' . $this->users[$i]['id'] . '" AND `delete` = "0" LIMIT 1')); - - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl2 . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - - if (isset($tr_pl['id'])) { - if (rand(0, 100) < $tr_pl['data']) { - $tr_tp = rand(($tr_pl['v1'] + 1), 3); - if ($this->users[$i]['sex'] == 1) { - $vtvl = '' . $this->users[$i]['login'] . ' (, : ' . $this->users[$this->uids[$tr_pl['user_use']]]['login'] . '): ' . $tr_nm[$tr_tp] . ' .
' . $vtvl; - } else { - $vtvl = '' . $this->users[$i]['login'] . ' (, : ' . $this->users[$this->uids[$tr_pl['user_use']]]['login'] . '): ' . $tr_nm[$tr_tp] . ' .
' . $vtvl; - } - $this->addTravm($this->users[$i]['id'], $tr_tp, rand(3, 5)); - } - } - } - $i++; - } - if ($vtvl != '') { - if ($this->info['type'] != 99) { - $vtvl2 = ' ...'; - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl2 . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - } - $ins = mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $vtvl . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - } - - // - if ($this->info['inTurnir'] > 0 && $this->info['dungeon'] != 15 && $u->info['room'] != 413) { - $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "' . $this->info['inTurnir'] . '" LIMIT 1')); - $i = 0; - $j = 0; - while ($i < count($this->users)) { - if ($this->stats[$i]['hpNow'] < 1 && $this->users[$i]['clone'] == 0 && $this->stats[$i]['clone'] == 0) { - // - if ($this->users[$i]['sex'] == 0) { - $text .= '{u1} '; - } else { - $text .= '{u1} '; - } - // - $spik = mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `delete` ="0"'); - while ($plik = mysql_fetch_array($spik)) { - /* - -1 - */ - mysql_query('INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ( - "' . $this->users[$i]['dnow'] . '","' . $plik['item_id'] . '","' . (time() - 600) . '","' . $this->users[$i]['x'] . '","' . $this->users[$i]['y'] . '" - )'); - } - unset($spik, $plik); - // - $usrreal = ''; - $usr_real = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `login` = "' . $this->users[$i]['login'] . '" AND `inUser` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if (!isset($usr_real['id'])) { - $usr_real = $this->users[$i]; - } - if (isset($usr_real['id'])) { - if ($usr_real['align'] > 0) { - $usrreal .= ''; - } - if ($usr_real['clan'] > 0) { - $usrreal .= ''; - } - $usrreal .= '' . $usr_real['login'] . '[' . $usr_real['level'] . ']'; - } else { - $mereal = '[??]'; - } - $text = str_replace('{u1}', $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 . '" - )'); - // - // - 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 `actions` WHERE `uid` = "' . $this->users[$i]['id'] . '"'); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $this->users[$i]['id'] . '"'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $this->users[$i]['id'] . '"'); - mysql_query('DELETE FROM `users_delo` WHERE `uid` = "' . $this->users[$i]['id'] . '"'); - // - mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `login` = "' . $this->users[$i]['login'] . '" OR `inUser` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - mysql_query('UPDATE `bs_zv` SET `off` = "' . time() . '" WHERE `inBot` = "' . $this->users[$i]['id'] . '" AND `off` = "0" LIMIT 1'); - unset($text, $usrreal, $usr_real); - if ($this->users[$i]['pass'] != 'bstowerbot') { - $bs['users']--; - $bs['users_finish']++; - } else { - $bs['arhiv']--; - } - $j++; - } - $i++; - } - if ($j > 0) { - mysql_query('UPDATE `bs_turnirs` SET `arhiv` = "' . $bs['arhiv'] . '",`users` = "' . $bs['users'] . '",`users_finish` = "' . $bs['users_finish'] . '" WHERE `id` = "' . $bs['id'] . '" LIMIT 1'); - } - - unset($bs, $j); - } - - // - if ($this->info['type'] == 500 && isset($tststrt['id'])) { - // - - $i = 0; - while ($i < count($this->users)) { - if ($this->users[$i]['no_ip'] == 'trupojor') { - $mon = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_monsters` WHERE `uid` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if (isset($mon['id'])) { - if ($this->info['team_win'] == 0) { - // - mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$i]['hpAll'] . '",`mpNow` = "' . $this->stats[$i]['mpAll'] . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("! ' . mysql_real_escape_string(str_replace('{b}', - '' . $this->users[$i]['login'] . ' [' . $this->users[$i]['level'] . ']users[$i]['id'] . ' >', - $mon['nich_text'])) . ' ","' . $this->users[$i]['city'] . '","","6","1","' . time() . '")'); - } elseif ($this->info['team_win'] != $this->users[$i]['team']) { - // - $j = 0; - $usrwin = ''; - while ($j < count($this->users)) { - if ($this->users[$j]['no_ip'] != 'trupojor' && $this->users[$j]['bot'] == 0) { - if ($this->stats[$j]['hpNow'] > 0) { - $usrwin .= ', '; - if ($this->users[$j]['align'] > 0) { - $usrwin .= 'users[$j]['align'] . '.gif >'; - } - if ($this->users[$j]['clan'] > 0) { - $usrwin .= 'users[$j]['clan'] . '.gif >'; - } - $usrwin .= '' . $this->users[$j]['login'] . ' [' . $this->users[$j]['level'] . ']users[$j]['id'] . ' >'; - } - } - $j++; - } - if ($usrwin != '') { - $usrwin = ltrim($usrwin, ', '); - } else { - $usrwin = ' '; - } - - - mysql_query('UPDATE `users` SET `room` = "303" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - - $truptimelast = time() + rand(1800, 3600); - - mysql_query('UPDATE `stats` SET `res_x` = "' . $truptimelast . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("! ' . mysql_real_escape_string(str_replace('{b}', - '' . $this->users[$i]['login'] . ' [' . $this->users[$i]['level'] . ']users[$i]['id'] . ' >', - str_replace('{u}', $usrwin, - $mon['win_text']))) . ' ","' . $this->users[$i]['city'] . '","","6","1","' . time() . '")'); - unset($usrwin); - } else { - // - if ($mon['win_back'] == 1) { - mysql_query('UPDATE `users` SET `room` = "303" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } - mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$i]['hpAll'] . '",`mpNow` = "' . $this->stats[$i]['mpAll'] . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("! ' . mysql_real_escape_string(str_replace('{b}', - '' . $this->users[$i]['login'] . ' [' . $this->users[$i]['level'] . ']users[$i]['id'] . ' >', - $mon['lose_text'])) . ' ","' . $this->users[$i]['city'] . '","","6","1","' . time() . '")'); - } - } - } - $i++; - } - } - } - - // - $i = 0; - $botsi = 0; - if (isset($tststrt['id'])) { - while ($i < count($this->users)) { - // - if ($this->info['type'] == 33) { - $plde = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if (isset($plde['mail']) && $plde['mail'] == "haot@new-combats.com") { - $pld = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `inUser` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - - if (isset($pld['id'])) { - if ($this->users[$i]['battle_yron'] >= 500) { - $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'], ''); - $pld['battle_text'] .= ' (x5). '; - mysql_query('UPDATE `users_achiv` SET `pg`= `pg`+1 WHERE `id` = "' . $pld['id'] . '" LIMIT 1'); - - if ($this->users[$i]['team'] == $this->info['team_win']) { - if (rand(1, 100) <= 5) { - $u->addItem(10020, $pld['id'], ''); - $pld['battle_text'] .= ' . '; - } - } - } else { - $pld['battle_text'] .= ' . 500 .'; - } - - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $pld['city'] . "','" . $pld['room'] . "','','" . $pld['login'] . "','" . $pld['battle_text'] . "','-1','6','0')"); - 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'); - mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `inUser` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `users` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } - } - - unset ($plde, $pld); - } - - if ($this->users[$i]['bot'] == 1) { - $botsi++; - 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'); - } elseif ($this->users[$i]['bot'] == 2) { - $this->users[$i]['battle'] = 0; - mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "0",`exp` = `exp` + `battle_exp`,`battle_exp` = "0",`battle_yron` = "0",`enemy` = "0", `timeGo` = "' . time() . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - //mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "0",`exp` = `exp` + `battle_exp`,`battle_exp` = "0",`timeGo` = "'.time().'" WHERE `id` = "'.$this->users[$i]['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" LIMIT 100'); - } elseif ($this->users[$i]['bot'] > 0) { - $this->users[$i]['battle'] = 0; - mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "0",`exp` = `exp` + `battle_exp`,`battle_exp` = "0",`battle_yron` = "0",`enemy` = "0", `timeGo` = "' . time() . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" LIMIT 100'); - } - if ($this->users[$i]['clone'] > 0 && $this->users[$i]['bot'] > 0 && isset($this->users[$this->uids[$this->users[$i]['clone']]]['id']) && $this->users[$this->uids[$this->users[$i]['clone']]]['team'] != $this->users[$i]['team']) { - // - if ($this->users[$this->uids[$this->users[$i]['clone']]]['team'] == $this->info['team_win']) { - $u->addAction(time(), 'win_bot_clone', '', $this->users[$i]['clone']); - } elseif ($this->info['team_win'] == 0) { - $u->addAction(time(), 'nich_bot_clone', '', $this->users[$i]['clone']); - } else { - $u->addAction(time(), 'lose_bot_clone', '', $this->users[$i]['clone']); - } - } elseif ($this->users[$i]['bot'] > 0 && $this->users[$i]['bot_id'] > 0) { - // - $j = 0; - while ($j < count($this->users)) { - if ($this->users[$j]['bot'] == 0 && $this->users[$j]['team'] != $this->users[$i]['team']) { - if ($this->users[$j]['team'] == $this->info['team_win']) { - $u->addAction(time(), 'win_bot_' . $this->users[$i]['bot_id'], '', - $this->users[$j]['id']); - // - mysql_query('UPDATE `dialog_act` SET `now` = `now` + 1 WHERE `uid` = "' . $this->users[$j]['id'] . '" AND - ( `btl_bot` LIKE "' . $this->users[$i]['bot_id'] . '!%" OR `btl_bot` LIKE "%!' . $this->users[$i]['bot_id'] . '!%" ) - AND `val` != 1 - LIMIT 1'); - // - } elseif ($this->info['team_win'] == 0) { - $u->addAction(time(), 'nich_bot_' . $this->users[$i]['bot_id'], '', - $this->users[$j]['id']); - } else { - $u->addAction(time(), 'lose_bot_' . $this->users[$i]['bot_id'], '', - $this->users[$j]['id']); - } - } - $j++; - } - } - $i++; - } - } - - $botss = []; - - if ($nl != 10) { - // - if ($this->info['dungeon'] > 0) { - if ($this->info['team_win'] == $u->info['team'] && $this->info['dungeon'] == 102) { - $j1 = mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `type` = 2 AND `lib` = "' . $this->info['dn_id'] . '" AND `x` = "' . $this->info['x'] . '" AND `y` = "' . $this->info['y'] . '" LIMIT 1')); - if (isset($j1['id'])) { - mysql_query('DELETE FROM `laba_obj` WHERE `id` = "' . $j1['id'] . '" LIMIT 1'); - // - mysql_query('INSERT INTO `laba_obj` (`use`,`lib`,`time`,`type`,`x`,`y`,`vars`) VALUES ( - "0","' . $j1['lib'] . '","' . time() . '","6","' . $j1['x'] . '","' . $j1['y'] . '","' . (0 + $botsi) . '" - )'); - } - } elseif ($this->info['team_win'] == $u->info['team']) { - // , - $j1 = mysql_query('SELECT * FROM `dungeon_bots` WHERE `dn` = "' . $this->info['dn_id'] . '" AND `for_dn` = "0" AND `x` = "' . $this->info['x'] . '" AND `delete` = "0" AND `y`= "' . $this->info['y'] . '" LIMIT 100'); - while ($tbot = mysql_fetch_array($j1)) { - $j2 = 0; - while ($j2 < $tbot['colvo']) { - if (isset($tbot['id2'])) { - $tbot2 = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $tbot['id_bot'] . '" LIMIT 1')); - $itms = explode('|', $tbot2['p_items']); - $tii = 0; - $testdrop = 0; - while ($tii < count($itms) && $testdrop == 0) { - $itmz = explode('=', $itms[$tii]); - if ($itmz[0] > 0) { - if (isset($itmz[2]) && $itmz[2] != '') { - $questDrop = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%' . $itmz[2] . '%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 1')); - } - if (isset($questDrop['id'])) { // , - } elseif (isset($itmz[2]) && $itmz[2] != '') { - $itmz[1] = 0; - } // , , 0 - unset($questDrop); - - // - if ($itmz[1] * 100000 >= rand(1, 10000000)) { - $tou = 0; // - /* */ - $itmnm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itmz[0] . '" LIMIT 1')); - $itmnm = $itmnm['name']; - - $rtxt = ' ' . $tbot2['login'] . ' "' . $itmnm . '" '; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $this->info['dn_id'] . "','" . $this->users[0]['city'] . "','" . $this->users[0]['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1','1')"); - - $ins = mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`) VALUES ( - "' . $this->info['dn_id'] . '", - "' . $tou . '", - "' . $itmz[0] . '", - "' . time() . '", - "' . $this->info['x'] . '", - "' . $this->info['y'] . '")'); - if (!isset($questDrop['id'])) { - $testdrop = 1; // drop-drop //quest - } - } - } - $tii++; - } - } - $j2++; - } - // - // 1-15 , - if (date('m') == 9 && date('d') < 15) { - if ($this->get_chanse(99)) { - // - } elseif ($this->info['dungeon'] == 12 || $this->info['dungeon'] == 101) { - $tou = 0; // - /* */ - $itmz = [ - rand(4745, 4751), - 100, - ]; - // - $itmnm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itmz[0] . '" LIMIT 1')); - $itmnm = $itmnm['name']; - - $rtxt = ' ' . $tbot2['login'] . ' "' . $itmnm . '" '; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $this->info['dn_id'] . "','" . $this->users[0]['city'] . "','" . $this->users[0]['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1','1')"); - - $ins = mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`) VALUES ( - "' . $this->info['dn_id'] . '", - "' . $tou . '", - "' . $itmz[0] . '", - "' . time() . '", - "' . $this->info['x'] . '", - "' . $this->info['y'] . '")'); - } - } - // - // , - - if (rand(1, 100) <= 99) { - // - } elseif ($this->info['dungeon'] == 12 || $this->info['dungeon'] == 3 || - $this->info['dungeon'] == 101 || $this->info['dungeon'] == 16 || - $this->info['dungeon'] == 9 || $this->info['dungeon'] == 10 || - $this->info['dungeon'] == 13 || $this->info['dungeon'] == 106) { - $tou = 0; // - // - $itmz = rand(3143, 3192); - // - $itmnm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $itmz . '" LIMIT 1')); - $itmnm = $itmnm['name']; - - $rtxt = ' ' . $tbot2['login'] . ' "' . $itmnm . '" '; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $this->info['dn_id'] . "','" . $this->users[0]['city'] . "','" . $this->users[0]['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1','1')"); - - $ins = mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`) VALUES ( - "' . $this->info['dn_id'] . '", - "' . $tou . '", - "' . $itmz . '", - "' . time() . '", - "' . $this->info['x'] . '", - "' . $this->info['y'] . '")'); - } - } - mysql_query('UPDATE `dungeon_bots` SET `delete` = "' . time() . '" AND `inBattle` = "' . $this->info['id'] . '" WHERE `dn` = "' . $this->info['dn_id'] . '" AND `for_dn` = "0" AND `delete` = "0" '); - } else { - // RESTART - $dnr = 1; - if ($this->info['dungeon'] != 102) { - mysql_query('UPDATE `dungeon_bots` SET `inBattle` = "0" WHERE `dn` = "' . $this->info['dn_id'] . '" AND `for_dn` = "0" AND `x` = "' . $this->info['x'] . '" AND `y`= "' . $this->info['y'] . '"'); - } - } - } - } - $gm = []; - $gms = []; - $bm = []; - $bms = []; - - // - // - // - $i = $this->uids[$u->info['id']]; - - if ($this->info['team_win'] >= 0) { - if ($this->stats[$i]['pbe'] > 0) { - // - $this->expCoef += $this->stats[$i]['pbe']; - } - - if ( - $this->info['razdel'] == 5 && - (($c['m'] >= 6 && $c['m'] <= 8) || ($c['w'] == 0 || $c['w'] == 6)) - ) { - // - $this->expCoef += 5; - } - - $this->stats[$i]['exp'] += $this->expCoef; - - $this->stats[$i]['exp'] += $this->aBexp * $c['exp']; - - if ($this->stats[$i]['os4'] > 0) { - $this->stats[$i]['exp'] += $this->stats[$i]['os4']; - } - - $act01 = 0; - $this->users[$i]['battle_exp'] = round($this->users[$i]['battle_exp'] + ($this->users[$i]['battle_exp'] / 100 * (1 + $this->info['addExp'] + $this->stats[$i]['exp']))); - - if ($this->info['type'] == 564) { - // - $this->users[$i]['battle_exp'] = 0; - } - - if ($this->info['dungeon'] == 104) { - $this->users[$i]['battle_exp'] = ($u->info['level'] * 2) * (count($this->uids) - 1); - } elseif ($this->info['dungeon'] > 0 && $this->users[$i]['dnow'] != 0 && $this->info['dungeon'] != 1 && $this->users[$i]['team'] == $this->info['team_win']) { - $dun_limitForLevel = [ - 4 => 750, - 5 => 1500, - 6 => 3500, - 7 => 8000, - 8 => 25000, - 9 => 50000, - 10 => 75000, - 11 => 100000, - 12 => 100000, - 13 => 100000, - 14 => 100000, - ]; - // . - - if ($this->users[$i]['battle_exp'] > 0) { - $dun_exp = []; // . - $rep = mysql_fetch_array(mysql_query('SELECT `dungeonexp`,`id` FROM `rep` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - $rep = explode(',', $rep['dungeonexp']); - foreach ($rep as $key => $val) { - $val = explode('=', $val); // - if (isset($val[0]) && isset($val[1]) && $val[0] != '' && $val[1] != 0) { - $dun_exp[(int)$val[0]] = (int)$val[1]; - } - } - unset($rep); - } - - if (!isset($dun_exp[$this->info['dungeon']])) { - $dun_exp[$this->info['dungeon']] = 0; - } - - if (!isset($dun_limitForLevel[(int)$this->users[$i]['level']])) { // , . - $this->users[$i]['battle_exp'] = 0; - } elseif ( - isset($dun_exp[$this->info['dungeon']]) && - $dun_exp[$this->info['dungeon']] >= $dun_limitForLevel[(int)$this->users[$i]['level']] - ) { // , . - $this->users[$i]['battle_exp'] = 0; - } elseif ( - isset($dun_exp[$this->info['dungeon']]) && - $dun_limitForLevel[(int)$this->users[$i]['level']] > $dun_exp[$this->info['dungeon']] - ) { // . - if (($dun_exp[$this->info['dungeon']] + $this->users[$i]['battle_exp']) > $dun_limitForLevel[(int)$this->users[$i]['level']]) { - // , . - $this->users[$i]['battle_exp'] = abs($this->users[$i]['battle_exp'] - abs($dun_limitForLevel[(int)$this->users[$i]['level']] - ($this->users[$i]['battle_exp'] + $dun_exp[$this->info['dungeon']]))); - $dun_exp[$this->info['dungeon']] += $this->users[$i]['battle_exp']; - } elseif ($dun_limitForLevel[(int)$this->users[$i]['level']] > ($dun_exp[$this->info['dungeon']] + $this->users[$i]['battle_exp'])) { - // , . - $dun_exp[$this->info['dungeon']] += $this->users[$i]['battle_exp']; - } else { - $this->users[$i]['battle_exp'] = 0; - } - } else { // . - $this->users[$i]['battle_exp'] = 0; - } - - - if ($this->users[$i]['battle_exp'] > 0 && isset($dun_exp[$this->info['dungeon']]) && $dun_exp[$this->info['dungeon']] > 0) { - $dunexp = []; - foreach ($dun_exp as $key => $val) { - $dunexp[$key] = $key . '=' . $val; // - } - $dun_exp = implode(",", $dunexp); - mysql_query('UPDATE `rep` SET `dungeonexp` = "' . $dun_exp . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - unset($dunexp, $dun_exp); - } - unset($dun_limitForLevel); - } - - $sinf = ''; - if ($c['exp_mega']) { - $this->users[$i]['battle_exp'] += floor($this->users[$i]['battle_exp'] / 100 * $c['exp_mega_val'][$this->users[$i]['level']]); - } - - if ($this->info['team_win'] == 0 && $this->info['type'] != 564) { - // - if ($this->users[$i]['level'] <= 1) { - $this->users[$i]['battle_exp'] = floor($this->users[$i]['battle_exp'] * 0.50); - } else { - $this->users[$i]['battle_exp'] = ceil($this->users[$i]['battle_exp'] * 0.10); - } - $this->users[$i]['nich'] += 1; - // - mysql_query('UPDATE `users` SET `swin` = 0, `slose` = 0 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - } elseif ($this->users[$i]['team'] == $this->info['team_win'] && $this->info['type'] != 564) { - // - $gm[$i] = $this->info['money']; - - $gms[$i] = $this->info['money3']; - - $this->users[$i]['win'] += 1; - $act01 = 1; - // - mysql_query('UPDATE `users` SET `swin` = `swin` + 1, `slose` = 0 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - } elseif ($this->info['type'] != 564) { - // - if ($this->users[$i]['level'] <= 1) { - $this->users[$i]['battle_exp'] = ceil($this->users[$i]['battle_exp'] * 0.33); - } else { - $this->users[$i]['battle_exp'] = ceil($this->users[$i]['battle_exp'] * 0.10); - } - $bm[$i] = $this->info['money']; - - $bms[$i] = $this->info['money3']; - - $this->users[$i]['lose'] += 1; - mysql_query('UPDATE `users` SET `swin` = 0, `slose` = `slose` + 1 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - $act01 = 2; - } - // - ( .) - if ($this->info['money3'] > 0 && isset($gms[$i]) && $this->info['type'] != 564) { - $mn = [ - 'l' => 0, // - 'w' => 0, // - 'm' => 0 // () - ]; - if ($act01 == 1) { - $mn['l'] = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `battle_users` WHERE `battle` = "' . $this->info['id'] . '" AND `team` != "' . $this->users[$i]['team'] . '" LIMIT 1')); - $mn['l'] = $mn['l'][0]; - $mn['w'] = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `battle_users` WHERE `battle` = "' . $this->info['id'] . '" AND `team` = "' . $this->users[$i]['team'] . '" LIMIT 1')); - $mn['w'] = $mn['w'][0]; - $mn['m'] = round(($mn['l'] * $this->info['money3']) / 100 * 87, 2); - $gms[$i] = round(($mn['m'] / $mn['w']), 2); - } - } - // - // - // - if ($act01 == 1) { - // - if ($this->users[$i]['dnow'] == 0) { - if ($this->users[$i]['hpNow'] < 1) { - $lom = 0.05; - } - } - } elseif ($act01 == 2) { - // - $lom = 0.55; - } else { - // - $lom = 0.05; - } - //$lom = round($lom*2.75,2); - $nlom = [0 => rand(0, 18), 1 => rand(0, 18), 2 => rand(0, 18), 3 => rand(0, 18)]; - if ($this->info['type'] == 564) { - $lom = 0; - } - if ($this->stats[$i]['silver'] >= 4) { - $lom = 0; - } - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW`+' . $lom . ' WHERE `inOdet` < "18" AND `inOdet` > "0" AND `uid` = "' . $this->users[$i]['id'] . '" AND `inOdet`!="0" AND `inOdet`!=' . $nlom[0] . ' AND `inOdet`!=' . $nlom[1] . ' AND `inOdet`!=' . $nlom[2] . ' AND `inOdet`!=' . $nlom[3] . ' LIMIT 18'); - - $prc = ''; - if ($this->users[$i]['align'] == 2) { - $this->users[$i]['battle_exp'] = floor($this->users[$i]['battle_exp'] / 2); - } - if ($this->users[$i]['animal'] > 0) { - $ulan = $u->testAction('`uid` = "' . $this->users[$i]['id'] . '" AND `vars` = "animal_use' . $this->info['id'] . '" LIMIT 1', - 1); - if (isset($ulan['id']) && $this->users[$i]['team'] == $this->info['team_win'] && $this->users[$i]['level'] > $ulan['vals']) { - $a004 = mysql_fetch_array(mysql_query('SELECT `max_exp`,`name` 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')); - //33% , - $aexp = (round($this->users[$i]['battle_exp'] / 100 * 33)); - if ($aexp > $a004['max_exp']) { - $aexp = $a004['max_exp']; - } - unset($ulan); - // - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat` - ) VALUES ( - '1','" . $this->users[$i]['city'] . "','" . $this->users[$i]['room'] . "','','" . $this->users[$i]['login'] . "' - ,' "" . $a004['name'] . "" : " . $aexp . "','-1','6','0')"); - // - $upd = mysql_query('UPDATE `users_animal` SET `exp` = `exp` + ' . $aexp . ' WHERE `id` = "' . $this->users[$i]['animal'] . '" AND `level` < ' . $this->users[$i]['level'] . ' LIMIT 1'); - if ($upd) { - $this->users[$i]['battle_exp'] = round($this->users[$i]['battle_exp'] / 100 * 67); - $this->info['addExp'] -= 33.333; - } - } - } - - $prsusers = mysql_fetch_array(mysql_query('SELECT SUM(`price1`) FROM `battle_users` WHERE `battle` = "' . $this->info['id'] . '" LIMIT 1')); - unset($prsusers); - $btlstatus = $this->typeBattle($prsusers[0]); - if ($this->info['smert'] == 1) { - $btlstatus = [150, 150, ' ', ' ']; - } - // - if ($this->stats[$i]['clanpos'] > 0) { - if ($this->stats[$i]['clanpos'] == 1) { - $this->info['addExp'] += 0; - } elseif ($this->stats[$i]['clanpos'] == 2) { - $this->info['addExp'] += 0; - } elseif ($this->stats[$i]['clanpos'] == 3) { - $this->info['addExp'] += 0; - } - } - - unset($r1); - // - if ($btlstatus[0] > 0) { - if ($this->info['type'] == 99) { - $this->info['addExp'] += $btlstatus[1]; - } else { - $this->info['addExp'] += $btlstatus[0]; - } - } - - if ($this->users[$i]['align'] == 2 || $this->users[$i]['haos'] > time()) { - $this->stats[$i]['exp'] = -($this->info['addExp'] + 50); - } - if ($this->info['addExp'] + $this->stats[$i]['exp'] != 0) { - $prc = ' (' . (100 + $this->info['addExp'] + $this->stats[$i]['exp']) . '%)'; - } - if ($this->info['money'] > 0) { - if (isset($gm[$i])) { - $prc .= ' ' . $gm[$i] . ' . .'; - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $gm[$i] . ' . ( ' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0); - $this->users[$i]['money'] += $gm[$i]; - } elseif (isset($bm[$i])) { - $prc .= ' ' . $bm[$i] . ' . .'; - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $gm[$i] . ' . ( ' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0); - $this->users[$i]['money'] -= $bm[$i]; - } - } - // - if ($c['money_haot'] && $this->users[$i]['exp'] <= 200000000) { - if ($act01 == 1 && $this->info['razdel'] == 5 && $this->users[$i]['level'] >= 8) { - // - $trexp = [ - 8 => 1200, - 9 => 3000, - 10 => 4500, - 11 => 12000, - 12 => 20000, - 13 => 30000, - 14 => 30000, - 15 => 30000, - 16 => 30000, - 17 => 30000, - 18 => 30000, - 19 => 30000, - 20 => 30000, - 21 => 30000, - ]; - $trexp = $trexp[$this->users[$i]['level']]; - - // - $trmn = [ - 8 => 1000, - 9 => 3000, - 10 => 2500, - 11 => 3000, - 12 => 3000, - 13 => 3000, - 14 => 3000, - 15 => 3000, - 16 => 3000, - 17 => 3000, - 18 => 3000, - 19 => 3000, - 20 => 3000, - 21 => 3000, - ]; - $trmn = $trmn[$this->users[$i]['level']]; - - // - $admn = [ - 8 => 0.05, //0.05 - 9 => 0.065, //0.065 - 10 => 0.075, //0.075 - 11 => 0.085, //0.085 - 12 => 0.1, //0.1 - 13 => 0.1, - 14 => 0.1, - 15 => 0.1, - 16 => 0.1, - 17 => 0.1, - 18 => 0.1, - 19 => 0.1, - 20 => 0.1, - 21 => 0.1, - ]; - $admn = $admn[$this->users[$i]['level']]; - - if ($c['m'] >= 6 && $c['m'] <= 8) { - // - if ($c['w'] == 0 || $c['w'] == 5 || $c['w'] == 6) { - // - $admn = $admn * 2; - } - } elseif ($c['w'] == 0 || $c['w'] == 5 || $c['w'] == 6) { - // - $admn = $admn * 2; - } - if ($this->users[$i]['battle_exp'] < $trexp) { - // - $prc .= ', 0 ( ).'; - // - } elseif ($admn > 0) { - if ($this->info['type'] != 33) { - $prc .= ', ' . $admn . ' .'; - } - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $admn . ' ( ' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0); - $this->users[$i]['money2'] += $admn; - } - } - } - - if ($this->info['money3'] > 0) { - if (isset($gms[$i])) { - $prc .= ' ' . $gms[$i] . ' $. .'; - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $gms[$i] . ' $. ( ' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0); - $this->users[$i]['money3'] += $gms[$i]; - mysql_query('UPDATE `users` SET `money3` = `money3` + "' . $gms[$i] . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } elseif (isset($bms[$i])) { - $prc .= ' ' . $bms[$i] . ' $. .'; - $u->addDelo(4, $this->users[$i]['id'], - '"System.battle": ' . $gms[$i] . ' $. ( ' . $this->info['id'] . ').', - time(), $this->info['city'], 'System.battle', 0, 0); - $this->users[$i]['money3'] -= $bms[$i]; - mysql_query('UPDATE `users` SET `money3` = `money3` - "' . $bms[$i] . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } - } - - $lime = [ - 8 => 18000, - 9 => 28000, - 10 => 84000, - 11 => 100, - 12 => 100, - 13 => 100, - 14 => 100, - 15 => 100, - 16 => 100, - 17 => 100, - 18 => 100, - 19 => 100, - 20 => 100, - 21 => 100, - ]; - - if ($this->users[$i]['level'] < 8) { - $lime = 5400; - } else { - $lime = $lime[$this->users[$i]['level']]; - } - - if ($this->stats[$i]['silver'] >= 5) { - $lime += round($lime); - } - - if ($this->users[$i]['stopexp'] == 1) { - $lime = 0; - $this->users[$i]['battle_exp'] = 0; - } - - if ($lime < $this->users[$i]['battle_exp'] && $c['limitedexp']) { - $this->users[$i]['battle_exp'] = $lime; - } - unset($lime); - - if ($btlstatus[0] > 0) { - if ($this->info['type'] == 99) { - $prc .= ' (' . $btlstatus[3] . ')'; - } else { - $prc .= ' (' . $btlstatus[2] . ')'; - } - } - - if ($this->info['dungeon'] == 1 && $this->users[$i]['team'] == $this->info['team_win']) { - // - $rep = mysql_fetch_array(mysql_query('SELECT `dl1`,`id` FROM `rep` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if ($rep['dl' . $this->info['dungeon']] > 0) { - $this->users[$i]['battle_exp'] += 3 * count($this->users); - if ($rep['dl' . $this->info['dungeon']] > $this->users[$i]['battle_exp']) { - $rep['dl' . $this->info['dungeon']] -= $this->users[$i]['battle_exp']; - } else { - $this->users[$i]['battle_exp'] = $rep['dl' . $this->info['dungeon']]; - $rep['dl' . $this->info['dungeon']] = 0; - } - mysql_query('UPDATE `rep` SET `dl' . $this->info['dungeon'] . '` = "' . $rep['dl' . $this->info['dungeon']] . '" WHERE `id` = "' . $rep['id'] . '" LIMIT 1'); - } else { - $this->users[$i]['battle_exp'] = 0; - } - } - - if ($this->users[$i]['battle_exp'] < 1) { - $this->users[$i]['battle_exp'] = 0; - } - - if ( - $this->users[$i]['battle_exp'] < 1 && - $this->users[$i]['twink'] == 0 && - $this->info['money'] == 0 && - $this->info['money3'] == 0 && - $this->info['kingfight'] == 0 && - empty($admnb) - ) { - $prc = ''; - } - - if ($this->user[$i]['host_reg'] == 'real_bot_user') { - $this->users[$i]['battle_exp'] = round($this->users[$i]['battle_exp'] / 3); - } - - if ($sinf != '') { - $sinf = ' ( ' . $sinf . ' )'; - } - - //-------------- 8-9-------------- - - if ($this->users[$i]['level'] == 8 && $this->users[$i]['battle_exp'] >= 23000) { - $this->users[$i]['battle_exp'] = 23000; - } - if ($this->users[$i]['level'] == 9 && $this->users[$i]['battle_exp'] >= 31000) { - $this->users[$i]['battle_exp'] = 31000; - } - if ($this->users[$i]['level'] == 10 && $this->users[$i]['battle_exp'] >= 52000) { - $this->users[$i]['battle_exp'] = 52000; - } - if ($this->users[$i]['level'] >= 11 && $this->users[$i]['battle_exp'] >= 75000) { - $this->users[$i]['battle_exp'] = 75000; - } - //------------------------------------- - - if ($this->info['type'] != 33) { - $this->users[$i]['battle_text'] = ' . : ' . floor($this->users[$i]['battle_yron']) . ' HP. : ' . (0 + $this->users[$i]['battle_exp']) . '' . $prc . '.' . $sinf; //stats - } - - /* */ - if ($c['nolevel']) { - $rex95 = substr($this->users[$i]['exp'], -1); - if ($this->users[$i]['money4'] < 1000 && $this->users[$i]['exp'] == 12499) { - $rex95 = 6; - $rex95 = 5; - } - } else { - $rex95 = 5; - } - - if ($c['zuby'] && $this->info['dungeon'] == 0 && ($this->info['clone'] == 0 || $this->users[$i]['level'] < 5) && $rex95 != 9 && $this->info['type'] != 564) { - if ($this->users[$i]['align'] != 2 && $this->users[$i]['level'] >= 0 && $this->users[$i]['level'] < 8 && $this->users[$i]['battle_exp'] > 0) { - $rzb = 0; - - if ($this->get_chanse(50)) { - $rzb += rand(1, 3); - } elseif ($this->users[$i]['battle_exp'] > 15) { - $rzb += 1; - } - - $chzbs = 100; - - if ($this->stats[$i]['silver'] > 0) { - $chzbs = 150; - } - - if ($this->users[$i]['battle_exp'] > 9) { - if ($this->users[$i]['level'] > 1) { - // - if ($this->get_chanse(25 / 100 * $chzbs)) { - $rzb += 10; - } - } elseif ($this->users[$i]['level'] == 1 && $this->get_chanse(30 / 100 * $chzbs)) { - $rzb += 10; - } - - if ($this->users[$i]['level'] > 3 && $this->get_chanse(5 / 100 * $chzbs)) { - $rzb += 100; - } - } - - if ($this->users[$i]['team'] == $this->info['team_win']) { - // - if ($this->users[$i]['level'] < 8) { - $rzb += 1; - } - } elseif ($this->users[$i]['team'] == 0) { - // - if ($this->get_chanse(25 / 100 * $chzbs) && $this->users[$i]['battle_exp'] > 2) { - $rzb = rand(0, 1); - } else { - $rzb = 0; - } - } else { - // - if ($this->users[$i]['level'] >= 1) { - $rzb = 0; - } else { - if ($this->users[$i]['battle_exp'] < 3) { - $rzb = 0; - } elseif ($this->user[$i]['lose'] > $this->user[$i]['win']) { - if ($this->get_chanse(5 / 100 * $chzbs)) { - $rzb = rand(0, 1); - } else { - $rzb = 0; - } - } elseif ($this->get_chanse(10 / 100 * $chzbs)) { - $rzb = rand(0, 1); - } - } - $rzb = 0; - } - - if ($rex95 == 6) { - $rzb = $this->users[$i]['battle_exp'] > 10 ? rand(0, 1) : 0; - } - - if ($rzb > 0 && rand(0, 1000) <= 500) { - $rzb = rand(1, 3); - } - if ($rzb > 0) { - if ($this->stats[$i]['silver'] >= 5) { - $rzb = $rzb * 2; - } - mysql_query('UPDATE `users` SET `money4` = `money4` + "' . $rzb . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - $this->users[$i]['battle_text'] .= ' ' . $u->zuby($rzb, - 1) . ' .'; - } - } - } - - if ($this->info['priz'] > 0) { - // - /* - [4754] - 2-3 = 1 - 4-5 = 1 - 6-7 = 2 - 8-9 = 3 - (3) - - */ - - $tmon = [ - 2 => 1, - 3 => 1, - 4 => 1, - 5 => 1, - 6 => 1, - 7 => 2, - 8 => 3, - 9 => 3, - 10 => 5, - 11 => 5, - ]; - $tmon = $tmon[$this->users[$i]['level']]; - // - $tmonc = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `battle` WHERE `id` IN ( SELECT `battle_id` FROM `battle_last` WHERE `uid` = "' . $this->users[$i]['id'] . '" ) AND `priz` > 0 AND `time_start` > "' . strtotime(date('d.m.Y')) . '"')); - $tmonc = $tmonc[0]; - // - if ($this->users[$i]['team'] == $this->info['team_win']) { - // - if ($tmonc < 1) { - $tmonc = 1; - } elseif ($tmonc > 96) { - $tmonc = 96; - } - $tmon = ($tmon * $tmonc); - } - // - $tmoni = 1; - while ($tmoni <= floor($tmon / 2)) { - $u->addItem(4754, $this->users[$i]['id'], ''); // - $tmoni++; - } - // - $this->users[$i]['battle_text'] .= ' (x' . floor($tmon / 2) . '). ( , ! ' . ($tmonc) . '/96 )'; - // - unset($tmon, $tmoni); - } - // - if ($this->info['dungeon'] == 0 && $this->info['razdel'] == 5 && $this->users[$i]['team'] == $this->info['team_win']) { - //2 - $u->repexp_add($this->users[$i]['id'], 2); // +2 - $check = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 478 AND `uid` = "' . $this->users[$i]['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;')); - if (isset($check['id'])) { - $urcheck = 10000; - if ($this->users[$i]['level'] == 8) { - $urcheck = 3000; - } elseif ($this->users[$i]['level'] == 9) { - $urcheck = 7000; - } elseif ($this->users[$i]['level'] == 10) { - $urcheck = 12000; - } elseif ($this->users[$i]['level'] >= 11) { - $urcheck = 18000; - } - - if ($this->users[$i]['battle_yron'] >= $urcheck) { - mysql_query('UPDATE `eff_users` SET `timeUse` = `timeUse` - 300 WHERE `id_eff`=478 AND `delete` = 0 AND `uid` =' . $this->users[$i]['id'] . ' LIMIT 1'); - $this->users[$i]['battle_text'] .= ' ' . $urcheck . ' -5 . !'; - } - } - mysql_query('UPDATE `users_achiv` SET `vx`= `vx`+1 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); // - - } - // - if ($this->info['dungeon'] == 0 && $this->info['type'] == 250 && $this->users[$i]['team'] == $this->info['team_win']) { - mysql_query('UPDATE `users_achiv` SET `kw`= `kw`+1 WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - if (date('w') == 0 || date('w') == 6 || date('w') == 4) { - $u->repexp_add($this->users[$i]['id'], 25); // () 25 - } - } - // - if ($this->info['dungeon'] == 0 && $this->info['type'] == 99 && $this->users[$i]['team'] == $this->info['team_win']) { - if (date('w') == 0 || date('w') == 6 || date('w') == 5) { - $u->repexp_add($this->users[$i]['id'], 10); // () 10 - } - } - - // - if ($this->info['dungeon'] == 0 && $this->info['type'] == 500 && $this->users[$i]['team'] == $this->info['team_win'] && $this->users[$i]['no_ip'] != 'trupojor' && $this->users[$i]['bot'] == 0) { - if ($this->users[$i]['level'] > 9) { - $mid = 903093; - } else { - $mid = 89489; - } - $mon = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_monsters` WHERE `uid` = "' . $mid . '" LIMIT 1')); - - if ($this->users[$i]['battle_yron'] >= 2000) { - $ritem = rand(1, 100); - if ($ritem <= 20) { - $mon['win_itm'] = '4459@1'; - } elseif ($ritem <= 40) { - $mon['win_itm'] = '4460@1'; - } elseif ($ritem <= 60) { - $mon['win_itm'] = '4461@1'; - } elseif ($ritem <= 80) { - $mon['win_itm'] = '4462@1'; - } else { - $mon['win_itm'] = '4463@1'; - } - } elseif ($this->users[$i]['battle_yron'] >= 1500) { - $ritem = rand(1, 100); - if ($ritem <= 20) { - $mon['win_itm'] = '4459@1'; - } elseif ($ritem <= 40) { - $mon['win_itm'] = '4460@1'; - } elseif ($ritem <= 60) { - $mon['win_itm'] = '4461@1'; - } elseif ($ritem <= 80) { - $mon['win_itm'] = '4462@1'; - } else { - $mon['win_itm'] = '4463@1'; - } - } elseif ($this->users[$i]['battle_yron'] >= 1000) { - $ritem = rand(1, 100); - if ($ritem <= 25) { - $mon['win_itm'] = '4460@1'; - } elseif ($ritem <= 50) { - $mon['win_itm'] = '4461@1'; - } elseif ($ritem <= 75) { - $mon['win_itm'] = '4462@1'; - } else { - $mon['win_itm'] = '4463@1'; - } - } else { - $mon['win_itm'] = '4392@1'; - $timewait = 0; - } - if ($this->users[$i]['battle_yron'] > 0) { - mysql_query('INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","478","111","' . $this->users[$i]['id'] . '"," ","pravonapodvig=1","' . time() . '")'); - } - mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $this->users[$i]['id'] . '","' . (time() - $timewait) . '","capitalcity","' . $this->users[$i]['room'] . '","end_trup"," ","","")'); - 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() . '")'); - $ritem = rand(1, 1000); - if ($ritem == 555) { - $mon['win_itm'] = $mon['win_itm'] . ',5022@1'; - } - - $this->addGlobalItems($mid, $this->users[$i]['id'], $mon['win_itm'], $mon['win_eff'], - $mon['win_ico'], 1, $mon['win_money1'], $mon['win_money2']); //$mon['win_exp'] - - } - - if ($this->info['dungeon'] == 0 && $this->info['razdel'] == 5 && $u->info['battle_yron'] >= 2000) { - // ang_g - if ($this->users[$i]['team'] == $this->info['team_win']) { - // - $tmoni = 2; - } else { - $tmoni = 1; - } - - $tmon = $tmoni; - $effblago = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = ' . $this->users[$i]['id'] . ' AND `delete` = 0 AND `id_eff`= 414 LIMIT 1')); - if (isset ($effblago['id'])) { - $limitg = 50; - } else { - $limitg = 25; - } - while ($tmoni >= 1) { - if ($u->info['ang_g'] < $limitg) { - $u->addItem(4754, $this->users[$i]['id'], ''); - mysql_query('UPDATE `users` SET `ang_g`=`ang_g`+1 WHERE `id` =' . $this->users[$i]['id']); - } else { - $tmon--; - } - $tmoni--; - } - - if ($this->info['type'] != 33) { - $this->users[$i]['battle_text'] .= ' (' . $tmon . '). [' . ($u->info['ang_g'] + $tmon) . '/' . $limitg . '] . '; - } - unset($tmon, $tmoni, $effblago, $limitg); - } - - - if ($this->info['razdel'] == 5 || $this->info['razdel'] == 4) { - if (date('d.m') == '31.10' || (date('m') == 11 && date('d') < 7)) { - // 4504 - $this->users[$i]['battle_text'] .= ' (x1).'; - $u->addItem(4504, $this->users[$i]['id'], '|sudba=1'); - } - } - - - // - if ($this->info['dungeon'] == 0 && $this->info['razdel'] == 5 && $this->users[$i]['exp'] >= 1500 - ) { - if ($this->users[$i]['battle_exp'] > 100 * $this->users[$i]['level']) { - $rzbvo = $this->users[$i]['battle_exp'] * 6 / 1000; - - if ($this->users[$i]['level'] == 8) { - if ($rzbvo >= 100) { - $rzbvo = 100; - } - } - if ($this->users[$i]['level'] == 9) { - if ($rzbvo >= 150) { - $rzbvo = 150; - } - } - if ($this->users[$i]['level'] == 10) { - if ($rzbvo >= 200) { - $rzbvo = 200; - } - } - if ($this->users[$i]['level'] == 11) { - if ($rzbvo >= 250) { - $rzbvo = 250; - } - } - if ($this->users[$i]['level'] == 12) { - if ($rzbvo >= 250) { - $rzbvo = 250; - } - } - if ($this->info['type'] != 33) { - $this->users[$i]['battle_text'] .= ' ' . $rzbvo . ' .'; - } - mysql_query('UPDATE `rep` SET `rep3` = `rep3` + ' . $rzbvo . ' WHERE `id` = ' . $this->users[$i]['id']); - mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("' . $this->users[$i]['id'] . '","' . time() . '","capitalcity","' . $this->users[$i]['room'] . '","end_xaot"," ","' . $zadID . '","")'); - } - } - - if ($this->stats[$i]['hpNow'] >= 1) { - $this->stats[$i]['test_heal'] = mysql_fetch_array(mysql_query('SELECT SUM(`yrn`) FROM `battle_stat` WHERE `uid2` = "' . $this->users[$i]['id'] . '" AND `battle` = "' . $this->info['id'] . '" LIMIT 1')); - $this->stats[$i]['test_heal'] = $this->stats[$i]['test_heal'][0]; - $this->stats[$i]['test_start'] = mysql_fetch_array(mysql_query('SELECT `hpStart` FROM `battle_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `battle` = "' . $this->info['id'] . '" LIMIT 1')); - $this->stats[$i]['test_start'] = $this->stats[$i]['test_start']['hpStart']; - // - $this->stats[$i]['hpNow'] = ($this->stats[$i]['test_start'] - $this->stats[$i]['test_heal']); - if ($this->stats[$i]['hpNow'] < 1) { - $this->stats[$i]['hpNow'] = 1; - } - } 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->users[$i]['clan'] > 0) { - $cpr = 1; - if ($this->info['typeBattle'] == 9) { - $cpr = 25; - } elseif ($this->info['typeBattle'] == 50) { - $cpr = 65; - } - if ($this->stats[$i]['silver'] >= 5) { - $cpr = floor($cpr / 100 * 150); - } - mysql_query('UPDATE `clan` SET `exp` = `exp` + "' . round($this->users[$i]['battle_exp'] / 100 * $cpr) . '" WHERE `id` = "' . $this->users[$i]['clan'] . '" LIMIT 1'); - } - - $this->users[$i]['battle_exp'] = 0; //stats - - if ($this->users[$i]['team'] == $this->info['team_win']) { - mysql_query('UPDATE `rep` SET `n_capitalcity` = `n_capitalcity` + ' . $this->users[$i]['bn_capitalcity'] . ' ,`n_demonscity` = `n_demonscity` + ' . $this->users[$i]['bn_demonscity'] . ' ,`n_demonscity` = `n_demonscity` + ' . $this->users[$i]['bn_suncity'] . ' WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - } - - // - $this->users[$i]['bn_demonscity'] = 0; - $this->users[$i]['bn_capitalcity'] = 0; - $this->users[$i]['bn_suncity'] = 0; - // - $spe = mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `file_finish` != "" AND `v1` = "priem" LIMIT 30'); - while ($ple = mysql_fetch_array($spe)) { - if (file_exists('../../_incl_data/class/priems/' . $ple['file_finish'] . '.php')) { - require('../../_incl_data/class/priems/' . $ple['file_finish'] . '.php'); - } - } - // - mysql_query('DELETE FROM `eff_users` WHERE `v1` = "priem" AND `uid` = "' . $this->users[$i]['id'] . '" LIMIT 50'); - if ($dnr == 1) { - if ($this->users[$i]['room'] == 370) { - $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `dn` = "' . $this->users[$i]['dnow'] . '" AND `vars` = "dielaba" LIMIT 1')); - $dies = $dies[0]; - mysql_query('INSERT INTO `dungeon_actions` (`dn`,`uid`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( - "' . $this->users[$i]['dnow'] . '","' . $this->users[$i]['id'] . '","' . $this->users[$i]['x'] . '","' . $this->users[$i]['y'] . '","' . time() . '","dielaba","" - )'); - } else { - $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `dn` = "' . $this->users[$i]['dnow'] . '" AND `vars` = "die" LIMIT 1')); - $dies = $dies[0]; - mysql_query('INSERT INTO `dungeon_actions` (`dn`,`uid`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( - "' . $this->users[$i]['dnow'] . '","' . $this->users[$i]['id'] . '","' . $this->users[$i]['x'] . '","' . $this->users[$i]['y'] . '","' . time() . '","die","" - )'); - } - if ($dies < 2 || $this->info['dungeon'] == 15) { - // - $tshbn = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `delete` = 0 AND `item_id` = "4910" LIMIT 1')); - if (isset($tshbn['id'])) { - // - mysql_query('DELETE FROM `items_users` WHERE `id` = "' . $tshbn['id'] . '" LIMIT 1'); - // - mysql_query('INSERT INTO `dungeon_obj` ( - `name`,`dn`,`x`,`y`,`img`,`delete`,`action`,`for_dn`, - `type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date` - ) VALUES ( - "","' . $this->info['dn_id'] . '","' . $this->users[$i]['x'] . '","' . $this->users[$i]['y'] . '","shaiba.png","0","fileact:15/shaiba","0", - "0","120","220","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt1:69,rl1:-47,rt2:74,rl2:126,rt3:76,rl3:140,rt4:80,rl4:150}" - )'); - // - } - // ( 00) - $this->users[$i]['x'] = $this->users[$i]['res_x']; - $this->users[$i]['y'] = $this->users[$i]['res_y']; - $this->users[$i]['s'] = $this->users[$i]['res_s']; - $r_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `room` WHERE `id` = "' . (int)$this->users[$i]['room'] . '" LIMIT 1')); - if ($this->users[$i]['room'] == 370) { - if ($this->users[$i]['sex'] == 0) { - $rtxt = '' . $this->users[$i]['login'] . ' '; - } else { - $rtxt = '' . $this->users[$i]['login'] . ' '; - } - } else { - if ($this->users[$i]['sex'] == 0) { - $rtxt = '' . $this->users[$i]['login'] . ' "' . $r_n['name'] . '"'; - } else { - $rtxt = '' . $this->users[$i]['login'] . ' "' . $r_n['name'] . '"'; - } - } - } elseif ($this->info['dungeon'] == 102) { - $nld = ''; - $lab = mysql_fetch_array(mysql_query('SELECT `id`,`users` FROM `laba_now` WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1')); - if ($lab['users'] < 2) { - // - mysql_query('DELETE FROM `laba_now` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `laba_map` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); - mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '"'); - mysql_query('DELETE FROM `laba_act` WHERE `lib` = "' . $lab['id'] . '"'); - mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "' . $lab['id'] . '"'); - } else { - $lab['users']--; - mysql_query('UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); - } - mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('UPDATE `users` SET `room` = "369" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND (`dn_delete` = "1" OR `data` LIKE "%fromlaba=1%")'); - if ($this->users[$i]['login'] != '') { - if ($this->users[$i]['sex'] == 0) { - $rtxt = '' . $this->users[$i]['login'] . ' ' . $nld; - } else { - $rtxt = '' . $this->users[$i]['login'] . ' ' . $nld; - } - } - } else { - $tinf = mysql_fetch_array(mysql_query('SELECT `uid` FROM `dungeon_now` WHERE `id` = "' . $this->info['dn_id'] . '" LIMIT 1')); - $nld = ''; - if ($tinf['uid'] == $this->users[$i]['id']) { - $tinf = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dnow` = "' . $this->info['dn_id'] . '" AND `hpNow` >= 1 LIMIT 1')); - if (isset($tinf['id'])) { - $tinf = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `id` = "' . $tinf['id'] . '" LIMIT 1')); - $nld .= ', "' . $tinf['login'] . '"'; - mysql_query('UPDATE `dungeon_now` SET `uid` = "' . $tinf['id'] . '" WHERE `id` = "' . $this->info['dn_id'] . '" LIMIT 1'); - } - } - $rooms = [ - 374 => 372, // ( ) - 189 => 188, // ( ) - 392 => 393, // ( ) - - 398 => 397, // ( ) - 243 => 395, // ( ) - 360 => 242, // ( ) - - 19 => 293 // - ]; - // $n_rm = $rooms[$this->users[$i]['room']]; - mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - mysql_query('UPDATE `users` SET `room` = "321" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - // - mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `dn_delete` = "1" LIMIT 1000'); - mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `item_id` = "1189" OR `item_id` = "4447" OR `item_id` = "1174") LIMIT 1000'); - if ($this->users[$i]['sex'] == 0) { - $rtxt = '' . $this->users[$i]['login'] . ' ' . $nld; - } else { - $rtxt = '' . $this->users[$i]['login'] . ' ' . $nld; - } - } - if ($rtxt != '') { - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $this->info['dn_id'] . "','" . $this->users[$i]['city'] . "','" . $this->users[$i]['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1','1')"); - } - } - - mysql_query('UPDATE `users` SET `login2` = "" WHERE `battle` = "' . $this->info['id'] . '"'); - mysql_query('UPDATE `users` SET `login2` = "", `money` = "' . $this->users[$i]['money'] . '", `money2` = "' . $this->users[$i]['money2'] . '",`win` = "' . $this->users[$i]['win'] . '",`lose` = "' . $this->users[$i]['lose'] . '",`nich` = "' . $this->users[$i]['nich'] . '",`battle` = "-1" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - - if ($u->info['id'] == $this->users[$i]['id']) { - $u->info['battle_text'] = $this->users[$i]['battle_text']; - } - - mysql_query('UPDATE `stats` SET `hpNow` = "' . $this->stats[$i]['hpNow'] . '",`mpNow` = "' . $this->stats[$i]['mpNow'] . '",`bn_capitalcity` = 0,`bn_demonscity` = 0,`smena` = 3,`tactic7` = "-100",`x`="' . $this->users[$i]['x'] . '",`y`="' . $this->users[$i]['y'] . '",`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",`last_pr`="0",`tactic1`="0",`tactic2`="0",`tactic3`="0",`tactic4`="0",`tactic5`="0",`tactic6`="0.00000000",`tactic7`="10",`exp` = "' . $this->users[$i]['exp'] . '",`battle_exp` = "' . $this->users[$i]['battle_exp'] . '",`battle_text` = "' . $this->users[$i]['battle_text'] . '",`battle_yron` = "0",`enemy` = "0",`last_b`="' . $this->info['id'] . '",`regHP` = "' . time() . '",`regMP` = "' . time() . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1'); - if ($this->info['turnir'] == 0) { - // - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$i]['city'] . "','" . $this->users[$i]['room'] . "','','" . $this->users[$i]['login'] . "','" . $this->users[$i]['battle_text'] . "','-1','6','0')"); - } else { - mysql_query('UPDATE `turnirs` SET `winner` = "' . $this->info['team_win'] . '" WHERE `id` = "' . $this->info['turnir'] . '" LIMIT 1'); - } - // - mysql_query('UPDATE `battle` SET `time_over` = "' . time() . '",`team_win` = "' . $this->info['team_win'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - - // - 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')); - if (isset($a['id'])) { - if ($a['eda'] < 1) { - $u->send('', $this->users[$i]['room'], $this->users[$i]['city'], '', - $this->users[$i]['login'], '' . $a['name'] . ' ...', - time(), 6, 0, 0, 0, 1); - } - } - } - mysql_query("UPDATE `stats` SET `battle_text` = '',`last_b` = 0 WHERE `id` = " . $this->users[$i]['id']); - mysql_query("UPDATE `battle_users` SET `finish` = 1 WHERE `uid` = " . $this->users[$i]['id']); - $this->saveLogs(); - if ($u->info['battle'] != 0 && !isset($u->info['battle_lsto'])) { - echo ''; - } - } - } else { - sleep(2); - } - mysql_query('UPDATE `battle` SET `testfinish` = 0 WHERE `id` = ' . $this->info['id']); - mysql_query('UNLOCK TABLES'); - } - - // - private $ainm = []; - - /** - * @param $uid - * @param int $itemId - * @param string $data - * @return void - */ - private function addGlobalItem($uid, $itemId, $data) - { - $room = $this->users[$this->uids[$uid]]['room']; - $login = $this->users[$this->uids[$uid]]['login']; - $q = "insert into items_local (room, time, item_id, data, tr_login, colvo) values - ($room, unix_timestamp(), $itemId, $data, $login, 1)"; - mysql_query($q); - } - - private function addGlobalItems($bid, $uid, $itm, $eff, $ico, $exp, $cr, $ecr) - { - global $u; - // - // - if ($bid == 1008) { - // - $jit = 0; - $iit = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `online` > unix_timestamp() - 120')); - $iit = floor($iit[0] / 20); - $iit = rand(1, $iit); - while ($jit < $iit) { - if (rand(0, 100) < 50) { - $svtk = array_fill(0, 71, 1000); - array_push($svtk, - 1461, 1462, 1463, 4037, - 4038, 4039, 4040, 911, - 1172, 1173, 2142, 2141, - 2143, 2870, 2144); - - $svtk = $svtk[rand(0, count($svtk) - 1)]; - if ($svtk == 1000) { - $this->addGlobalItem($uid, $svtk, '|nosale=1|srok=259200'); - $this->addGlobalItem($uid, $svtk, '|nosale=1|srok=259200'); - $this->addGlobalItem($uid, $svtk, '|nosale=1|srok=259200'); - $this->addGlobalItem($uid, $svtk, '|nosale=1|srok=259200'); - $this->addGlobalItem($uid, $svtk, '|nosale=1|srok=259200'); - $this->addGlobalItem($uid, $svtk, '|nosale=1|srok=259200'); - } - $this->addGlobalItem($uid, $svtk, '|nosale=1|srok=259200'); - } - $jit++; - } - unset($svtk); - } elseif ($bid == 1007) { - //, CAPITAL CITY - $jit = 0; - $iit = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `online` > unix_timestamp() - 120')); - $iit = floor($iit[0] / 20); - $iit = rand(1, $iit); - while ($jit < $iit) { - if (rand(0, 100) < 50) { - $this->addGlobalItem($uid, 4504, ''); - } - $jit++; - } - } elseif ($bid == 1006) { - // CAPITAL CITY - if (rand(0, 100) < 10) { - $this->addGlobalItem($uid, 4451, 'srok=86400'); - } - } elseif ($bid == 1000) { - // CAPITAL CITY - $this->addGlobalItem($uid, 4460, 'srok=2592000'); - } elseif ($bid == 1001) { - // CAPITAL CITY - $this->addGlobalItem($uid, 4461, 'srok=2592000'); - } elseif ($bid == 1002) { - // CAPITAL CITY - $this->addGlobalItem($uid, 4462, 'srok=2592000'); - } elseif ($bid == 1003) { - // CAPITAL CITY - $this->addGlobalItem($uid, 4463, 'srok=2592000'); - } elseif ($bid == 1004) { - // CAPITAL CITY - $this->addGlobalItem($uid, 4459, 'srok=2592000'); - } - - if ($exp >= 0) { - $this->users[$this->uids[$uid]]['battle_exp'] += round($exp * $this->users[$this->uids[$uid]]['battle_yron'] / $this->stats[$this->uids[$bid]]['hpAll']); - mysql_query('UPDATE `stats` SET `battle_exp` = "' . mysql_real_escape_string($this->users[$this->uids[$uid]]['battle_exp']) . '" WHERE `id` = "' . mysql_real_escape_string($uid) . '" LIMIT 1'); - } - - if ($cr != '' && $cr > 0) { - if ($this->stats[$this->uids[$uid]]['hpNow'] > 0) { - mysql_query('UPDATE `users` SET `money` = (`money` + ' . mysql_real_escape_string($cr) . ') WHERE `id` = "' . mysql_real_escape_string($uid) . '" LIMIT 1'); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' : " . mysql_real_escape_string($cr) . " .','-1','6','0')"); - } - } - // - if ($ecr != '' && $ecr > 0) { - if ($this->stats[$this->uids[$uid]]['hpNow'] > 0) { - $this->users[$this->uids[$uid]]['money2'] += $ecr; - $resulttp = mysql_query('UPDATE `users` SET `money2` = (`money2` + ' . mysql_real_escape_string($ecr) . ') WHERE `id` = "' . $this->users[$this->uids[$uid]]['id'] . '" LIMIT 1'); - if (!$resulttp) { - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' !!!','-1','6','0')"); - $u->addDelo(4, $this->users[$this->uids[$uid]]['id'], - '"System.battle>": ( ), !!! ', - time(), - $this->users[$this->uids[$uid]]['city'], 'System.battle', 0, 0); - } else { - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' -: " . mysql_real_escape_string($ecr) . " .','-1','6','0')"); - $u->addDelo(4, $this->users[$this->uids[$uid]]['id'], - '"System.battle": ' . $ecr . ' ( ), : ' . $this->users[$this->uids[$uid]]['money2'] . ' ', - time(), $this->users[$this->uids[$uid]]['city'], 'System.battle', 0, 0); - } - } - } - // - if ($ico != '') { - /* - 0(, 1 - , 2 - )@ - 1( )@ - 2( )@ - 3()@ - 4( 0 1, -1)@ - 5( % 0.001)@ - 6( : add_s1=5|add_hpAll=50)@ - 7( , )@ - 8( 0 1)@ - 9( 0 or 1) - */ - $i = 0; - $txt = ''; - $ico = explode('#', $ico); - while ($i < count($ico)) { - $ico_e = explode('@', $ico[$i]); - if (isset($ico_e[3])) { - // - $add = 1; - if ($ico_e[4] == 1 && floor($this->stats[$this->uids[$uid]]['hpNow']) < 1) { - $add = 0; - } - if ($add == 1) { - $ins = false; - if ($ico_e[8] == 0) { - $ins = true; - if ($ico_e[9] == 1) { - mysql_query('DELETE FROM `users_ico` WHERE `uid` = ' . (int)$uid . ' AND `img` = ' . mysql_real_escape_string($ico_e[2])); - } - } else { - $old_ico = mysql_fetch_array(mysql_query('SELECT `id` FROM `users_ico` WHERE `uid` = ' . (int)$uid . ' AND (`endTime` > unix_timestamp() OR `endTime` = 0) AND `img` = ' . mysql_real_escape_string($ico_e[2]) . ' LIMIT 1')); - if (!isset($old_ico['id'])) { - $ins = true; - } else { - if ($old_ico['id'] > 0) { - $txt .= ', "' . $ico_e[3] . ' ()"'; - mysql_query('UPDATE `users_ico` SET `x` = `x` + 1,`endTime` = ' . (time() + $ico_e[1] * 60) . ' WHERE `id` = ' . $old_ico['id']); - } else { - $ins = true; - } - } - unset($old_ico); - } - - if ($ins) { - if ($ico_e[9] == 1) { - mysql_query('DELETE FROM `users_ico` WHERE `uid` = ' . mysql_real_escape_string($uid) . ' AND `img` = ' . mysql_real_escape_string($ico_e[2])); - } - mysql_query('INSERT INTO `users_ico` (`uid`,`time`,`text`,`img`,`endTime`,`type`,`bonus`) VALUES ( - ' . mysql_real_escape_string($uid) . ', - unix_timestamp(), - ' . mysql_real_escape_string($ico_e[3]) . ', - ' . mysql_real_escape_string($ico_e[2]) . ', - ' . mysql_real_escape_string(time() + $ico_e[1] * 60) . ', - ' . mysql_real_escape_string($ico_e[0]) . ', - ' . mysql_real_escape_string($ico_e[6]) . ' - )'); - $txt .= ', "' . $ico_e[3] . '"'; - } - } - } - $i++; - } - if ($txt != '') { - $txt = ltrim($txt, ', '); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' : " . mysql_real_escape_string($txt) . "','-1','6','0')"); - } - } - // - if ($itm != '') { - $i = 0; - $txt = ''; - $itm = explode(',', $itm); - while ($i < count($itm)) { - $itm_e = explode('@', $itm[$i]); - if ($itm_e[0] > 0) { - $j = 0; - while ($j < $itm_e[1]) { - $u->addItem($itm_e[0], $uid, '|' . $itm_e[2]); - $j++; - } - if (!isset($this->ainm[$itm_e[0]])) { - $this->ainm[$itm_e[0]] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = ' . mysql_real_escape_string($itm_e[0]))); - } - if (isset($this->ainm[$itm_e[0]]['id'])) { - // - $txt .= ', ' . $this->ainm[$itm_e[0]]['name'] . ''; - if ($itm_e[1] > 1) { - $txt .= ' (x' . $itm_e[1] . ')'; - } - } - } - $i++; - } - if ($txt != '') { - $txt = ltrim($txt, ', '); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $this->users[$this->uids[$uid]]['city'] . "','" . $this->users[$this->uids[$uid]]['room'] . "','','" . $this->users[$this->uids[$uid]]['login'] . "',' : " . mysql_real_escape_string($txt) . "','-1','6','0')"); - } - } - } - - /** - * @return void - */ - private function addNewAtack() - { - 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; - - while ($i <= $us['zona']) { - if ($this->uAtc['a'][$i] == 0) { - $no = 1; - } - $i++; - } - - if ($this->uAtc['b'] == 0) { - $no = 1; - } - - if ($no == 0) { - // - if ($u->info['enemy'] > 0) { - if (!isset($this->ga[$u->info['enemy']][$u->info['id']])) { - if ( - $this->stats[$this->uids[$u->info['id']]]['hpNow'] >= 1 && - $this->stats[$this->uids[$u->info['enemy']]]['hpNow'] >= 1 - ) { - // - $a = $this->uAtc['a'][1] . - $this->uAtc['a'][2] . - $this->uAtc['a'][3] . - $this->uAtc['a'][4] . - $this->uAtc['a'][5]; - $b = $this->uAtc['b']; - mysql_query('DELETE FROM `battle_act` WHERE `battle` = ' . $this->info['id'] . ' AND ((`uid2` = ' . $u->info['id'] . ' AND `uid1` = ' . $u->info['enemy'] . ') OR (`uid1` = ' . $u->info['id'] . ' AND `uid2` = ' . $u->info['enemy'] . ')) LIMIT 2'); - $d = mysql_query('INSERT INTO `battle_act` (`battle`,`time`,`uid1`,`uid2`,`a1`,`b1`) VALUES (' . $this->info['id'] . ',' . time() . ',' . $u->info['id'] . ',' . $u->info['enemy'] . ',' . $a . ',' . $b . ')'); - if (!$d) { - $this->e = ' ...'; - } else { - $this->ga[$u->info['id']][$u->info['enemy']] = mysql_insert_id(); - } - } - } else { - // - if ($this->stats[$this->uids[$u->info['id']]]['hpNow'] >= 1 && $this->stats[$this->uids[$u->info['enemy']]]['hpNow'] >= 1) { - if (isset($this->atacks[$this->ga[$u->info['enemy']][$u->info['id']]]['id'])) { - $this->atacks[$this->ga[$u->info['enemy']][$u->info['id']]]['a2'] = $this->uAtc['a'][1] . $this->uAtc['a'][2] . $this->uAtc['a'][3] . $this->uAtc['a'][4] . $this->uAtc['a'][5]; - $this->atacks[$this->ga[$u->info['enemy']][$u->info['id']]]['b2'] = $this->uAtc['b']; - $this->startAtack($this->atacks[$this->ga[$u->info['enemy']][$u->info['id']]]['id']); - } - } - } - } - } else { - $this->e = ' '; - } - } else { - $this->e = ' , ...'; - } - } - } - - - /** , - . - * . . - *
: /class/priems/* - * @param int $uid1 - * @param int $uid2 - * @param int $end > 0, *.end.php, *.php - * @return void - */ - private function magicItems($uid1, $uid2, $end) - { - if (!isset($this->stats[$this->uids[$uid1]])) { - return; - } - foreach ($this->stats[$this->uids[$uid1]]['items'] as $item) { - if (!$item['id'] || !$this->lookStats($item['data'])['bm_a1']) { - continue; - } - $file = $this->lookStats($item['data'])['bm_a1'] . $end > 0 ? '.end.php' : '.php'; - if (file_exists('../../_incl_data/class/priems/' . $file)) { - require_once '../../_incl_data/class/priems/' . $file; - } - } - } - - private $rehodeff = []; - - // - private $poglast = []; - - public function testPogB($uid, $yr, $pliid, $test = 0) - { - $yr2 = $yr; - - $checktuman = mysql_fetch_array(mysql_query('SELECT id FROM `eff_users` WHERE `uid` = ' . $uid . ' - AND v2 in (273, 286, 287, 288) - AND `delete` =0 LIMIT 1')); // - //if ( !isset($checktuman['id'])) - if ($yr > 0 && !isset($checktuman['id'])) { - global $priem; - $i = 0; - while ($i < count($this->stats[$this->uids[$uid]]['set_pog2'])) { - $j = $this->stats[$this->uids[$uid]]['set_pog2'][$i]; - if ($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['id'] == $pliid || $test == 1) { - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'] = str_replace('add_pog2=' . $j['y'], - 'add_pog2=$', $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - $dt3 = $this->lookStats($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - - $dt3['add_pog2p'] = min(floor($j['y'] / $yr2 * 100), $dt3['add_pog2p']); - - if (isset($dt3['add_pog2mp'])) { - if ((round(round($yr2 / 100 * (100 - $dt3['add_pog2p'])) * $dt3['add_pog2mp'])) > $this->stats[$this->uids[$uid]]['mpNow']) { - // , % - $j['yhj'] = $this->stats[$this->uids[$uid]]['mpNow'] / (round(round($yr2 / 100 * (100 - $dt3['add_pog2p'])) * $dt3['add_pog2mp'])) * 100; - $j['yhj'] = floor($j['yhj']); // % - $dt3['add_pog2p'] = floor($dt3['add_pog2p'] / 100 * $j['yhj']); - } - if ($test == 1) { - $priem->minMana($uid, round(round($yr2 / 100 * $dt3['add_pog2p']) * $dt3['add_pog2mp'])); - } - } - if (!isset($this->poglast[$uid])) { - $this->poglast[$uid] = 0; - } - $this->poglast[$uid] += $yr2; - if ($test == 1) { - $j['y'] -= round($this->poglast[$uid] / 100 * $dt3['add_pog2p']); - $priem->minMana($uid, - round(round($this->poglast[$uid] / 100 * $dt3['add_pog2p']) * $dt3['add_pog2mp'])); - } - if (isset($dt3['add_pog2p'])) { - $yr2 = round($yr2 / 100 * (100 - $dt3['add_pog2p'])); - } - if ($j['y'] < 0 || ($this->stats[$this->uids[$uid]]['mpNow'] <= 0 && $dt3['add_pog2mp'] > 0)) { - $dt2 = $this->lookStats($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - if (isset($dt2['endPog']) && $dt2['endPog'] == 1) { - // - // - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['v2'] . '" LIMIT 1')); - $this->delPriem($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1], - $this->users[$this->uids[$uid]], 4, $uid); - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1] = 'delete'; - } - unset($dt2); - $j['y'] = 0; - } - $this->stats[$this->uids[$uid]]['set_pog'][$i]['y'] = $j['y']; - if (isset($this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'])) { - $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'] = str_replace('add_pog2=$', - 'add_pog2=' . $j['y'], $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data']); - mysql_query('UPDATE `eff_users` SET `data` = ' . $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['data'] . ' WHERE `id` = ' . $this->stats[$this->uids[$uid]]['effects'][$j['id'] - 1]['id']); - } - - if ($j['y'] - $this->poglast[$uid] + $yr2 < 0) { - $yr -= $yr + ($j['y'] - $this->poglast[$uid] + $yr2); - $yr2 = $yr; - $i = count($this->stats[$this->uids[$uid]]['set_pog2']) + 1; - } - } - $i++; - } - } - return $yr2; - } - - /** . */ - private function newRazmen($id) - { - $at = [1 => [0], 2 => [0]]; - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->atacks[$id]['out1'] == 0) { - $at[1] = $this->usersTestAtack($id, $uid1, $uid2); - } - if ($this->atacks[$id]['out2'] == 0) { - $at[2] = $this->usersTestAtack($id, $uid2, $uid1); - } - - return $at; - } - - /** 1 2 (?) */ - private function usersTestAtack($id, $uid1, $uid2) - { - $r = []; - $block = [0, 0, 0, 0, 0, 0,]; - - // - $i = 1; - if ($uid1 == $this->atacks[$id]['uid1']) { - $a = 2; - $j = $this->atacks[$id]['b2']; - $atack = [ - 0, - $this->atacks[$id]['a1'][0], - $this->atacks[$id]['a1'][1], - $this->atacks[$id]['a1'][2], - $this->atacks[$id]['a1'][3], - $this->atacks[$id]['a1'][4], - ]; - } elseif ($uid2 == $this->atacks[$id]['uid1']) { - $a = 1; - $j = $this->atacks[$id]['b1']; - $atack = [ - 0, - $this->atacks[$id]['a2'][0], - $this->atacks[$id]['a2'][1], - $this->atacks[$id]['a2'][2], - $this->atacks[$id]['a2'][3], - $this->atacks[$id]['a2'][4], - ]; - } - if ($this->atacks[$id]['out' . $a] == 0) { - while ($i <= $this->stats[$this->uids[$uid2]]['zonb']) { - //echo '{'.$j.'}'; - $block[$j] = 1; - $j++; - if ($j > 5 || $j < 1) { - $j = 1; - } - $i++; - } - } - // - $i = 1; - while ($i <= $this->stats[$this->uids[$uid1]]['zona']) { - if (!isset($atack[$i]) || $atack[$i] == 0) { - $atack[$i] = rand(1, 5); - } - if ($atack[$i] > 0) { - if ($block[$atack[$i]] == 1) { - // - // , - $r['atack'][] = [$atack[$i], 3, 0]; - } else { - // - // , - $r['atack'][] = [$atack[$i], 1, 0]; - } - } - $i++; - } - return $r; - } - - // - - /** - * @param $id - * @param $uid1 - * @param $uid2 - * @param $atack - * @return bool (bool) - */ - public function testRazmenblock1($id, $uid1, $uid2, $atack) - { - $block = []; - // - $i = 1; - $j = 0; - if ($uid1 == $this->atacks[$id]['uid1']) { - $j = $this->atacks[$id]['b2']; - } elseif ($uid2 == $this->atacks[$id]['uid1']) { - $j = $this->atacks[$id]['b1']; - } - if ($this->atacks[$id]['out2'] == 0) { - while ($i <= $this->stats[$this->uids[$uid2]]['zonb']) { - //echo '{'.$j.'}'; - $block[$j] = 1; - $j++; - if ($j > 5 || $j < 1) { - $j = 1; - } - $i++; - } - } - // - return $atack > 0 && $block[$atack] == 1; - } - - // . () - /** - * private function firstRazmen($id, $at) - * { - * $uid1 = $this->atacks[$id]['uid1']; - * $uid2 = $this->atacks[$id]['uid2']; - * - * $i = 1; - * while ($i <= 2) { - * if ($i == 1) { - * $u1 = $uid1; - * $u2 = $uid2; - * } else { - * $u1 = $uid2; - * $u2 = $uid1; - * } - * - * // - * $i++; - * } - * return $at; - * } - */ - - /** yhod_user. - * @var int - */ - private $import_user = 0; - - /** */ - private function yhod_user($uid1, $uid2, $type) - { - // 1 - . 2 - . - // - if ($this->import_user == 0) { - $r = $uid1; - $rand_user = false; - if ($type == 2) { - // ( ) - $i = 0; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] == $this->users[$this->uids[$uid2]]['team']) { - $rand_user[] = $this->users[$i]['id']; - } - $i++; - } - } elseif ($type == 4) { - // , - $i = 0; - while ($i < count($this->users)) { - //if( $this->users[$i]['team'] == $this->users[$this->uids[$uid1]]['team'] ) { - $rand_user[] = $this->users[$i]['id']; - //} - $i++; - } - } elseif ($type == 5) { - // , ( ) - $i = 0; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] == $this->users[$this->uids[$uid2]]['team'] && $uid2 != $this->users[$i]['id']) { - $rand_user[] = $this->users[$i]['id']; - } - $i++; - } - } elseif ($type == 6) { - // - $i = 0; - while ($i < count($this->users)) { - if ($this->users[$i]['team'] != $this->users[$this->uids[$uid2]]['team']) { - $rand_user[] = $this->users[$i]['id']; - } - $i++; - } - } elseif ($type > 100) { - // - if (!isset($this->users[$this->uids[$type]]) || $this->users[$this->uids[$type]]['id'] != $type) { - $r = $uid2; - } else { - $r = $type; - } - } - if (!empty($rand_user)) { - $r = $rand_user[rand(0, (count($rand_user) - 1))]; - } - $this->import_user = $r; - } else { - $r = $this->import_user; - } - return $r; - } - - /** */ - private function mf1Razmen($id, $at, $v, $pat = false, $rjd = 0) - { - if ($pat) { - $pat = $at; - $at = $pat['p']; - } else { - $pat = false; - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = $uid1; - $u2 = $uid2; - } else { - $a = 2; - $b = 1; - $u1 = $uid2; - $u2 = $uid1; - } - - // (u2) (u1) - $j = 0; - $wp01 = 3; - $k01 = 0; - if ($rjd > 0) { - $j = $rjd - 1; - } - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ($k01 == 0 && isset($this->stats[$this->uids[$u1]]['wp3id'])) { - // - $wp01 = 3; - $k01 = 1; - } else { - // - if ( - isset($this->stats[$this->uids[$u1]]['wp14id']) && - $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp14id']]['type'] != 13 - ) { - $wp01 = 14; - } else { - $wp01 = 3; - } - $k01 = 0; - } - $witm_type01 = 0; - $witm01 = $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp' . $wp01 . 'id']]; - $witm_data01 = $this->lookStats($witm01['data']); - if ($at[$a]['atack'][$j][2] == $v) { - $tyv = $this->mfs(2, [ - 'u1' => $u1, - 'u2' => $u2, - 'mf' => $this->stats[$this->uids[$u2]]['m4'], - 'amf' => (int)$this->stats[$this->uids[$u2]]['m15'], - 'smf' => ($this->stats[$this->uids[$u1]]['m5'] + $witm_data01['sv_m5']), - 'asmf' => $this->stats[$this->uids[$u1]]['m21'], - ], $this->users[$this->uids[$u1]]['level'], $this->users[$this->uids[$u2]]['level']); - if ($tyv == 1 && $this->atacks[$id]['out' . $b] == 0) { - //, :) - $this->stats[$this->uids[$u1]]['nopryh'] = floor(0 + (int)$this->stats[$this->uids[$u1]]['nopryh']); - if (!isset($this->stats[$this->uids[$u1]]['nopryh']) || $this->stats[$this->uids[$u1]]['nopryh'] <= 0) { - $at[$a]['atack'][$j][1] = 2; - } else { - $this->stats[$this->uids[$u1]]['nopryh']--; - $this->stats[$this->uids[$u1]]['nopryh_act']++; - } - } - } - $j++; - } - $i++; - } - unset($witm01, $witm_type01, $wp01, $k01); - - if ($pat) { - $pat['p'] = $at; - $at = $pat; - } - - return $at; - } - - /** */ - private function mf2Razmen($id, $at, $v, $pat = false, $rjd = 0) - { - global $u; - - if ($pat) { - $pat = $at; - $at = $pat['p']; - } else { - $pat = false; - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $u1 = $uid1; - $u2 = $uid2; - } else { - $a = 2; - $u1 = $uid2; - $u2 = $uid1; - } - - // (u1) (u2) - $j = 0; - $wp01 = 0; - $k01 = 0; - if ($rjd > 0) { - $j = $rjd - 1; - } - while ($j < count($at[$a]['atack']) && $j <= 8) { - // , - if ($k01 == 0 && isset($this->stats[$this->uids[$u1]]['wp3id'])) { - // - $wp01 = 3; - $k01 = 1; - } else { - // - if ( - isset($this->stats[$this->uids[$u1]]['wp14id']) && - $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp14id']]['type'] != 13 - ) { - $wp01 = 14; - } else { - $wp01 = 3; - } - $k01 = 0; - } - $witm_type01 = 0; - $witm01 = $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp' . $wp01 . 'id']]; - $witm_data01 = $this->lookStats($witm01['data']); - if ($this->mfs(1, [ - 'u1' => $u1, - 'u2' => $u2, - 'mf' => $this->stats[$this->uids[$u1]]['m1'] + $witm_data01['sv_m1'], - 'amf' => $this->stats[$this->uids[$u1]]['m14'], - 'smf' => $this->stats[$this->uids[$u2]]['m2'], - 'aamf1' => (int)$this->stats[$this->uids[$u2]]['enemy_am1'], - ], $this->users[$this->uids[$u1]]['level'], $this->users[$this->uids[$u2]]['level']) == 1) { - //, :) - if ($at[$a]['atack'][$j][1] == 3) { - // - $at[$a]['atack'][$j][1] = 4; // - } elseif ($at[$a]['atack'][$j][1] != 2 && $at[$a]['atack'][$j][1] != 6 && $at[$a]['atack'][$j][1] != 7 && $at[$a]['atack'][$j][1] != 8) { - // - $at[$a]['atack'][$j][1] = 5; - } else { - $at[$a]['atack'][$j][1] = 1; - } - } - $j++; - } - $i++; - } - unset($witm01, $witm_type01, $k01, $wp01); - - if ($pat) { - $pat['p'] = $at; - $at = $pat; - } - - return $at; - } - - /** */ - private function mf3Razmen($id, $at, $v, $pat = false, $rjd = 0) - { - if ($pat) { - $pat = $at; - $at = $pat['p']; - } else { - $pat = false; - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = $uid1; - $u2 = $uid2; - } else { - $a = 2; - $b = 1; - $u1 = $uid2; - $u2 = $uid1; - } - - // (u2) (u1) - //print_r( $at[$i] ); - $j = 0; - if ($rjd > 0) { - $j = $rjd - 1; - } - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ((!isset($this->stats[$this->uids[$u2]]['no_pr1']) || $this->stats[$this->uids[$u2]]['no_pr1'] == 0) && $at[$a]['atack'][$j][2] == $v) { - if ($this->mfs(3, [ - 'u1' => $u1, - 'u2' => $u2, - '1' => $this->stats[$this->uids[$u2]]['m7'], - '2' => $this->stats[$this->uids[$u1]]['m7'], - ], $this->users[$this->uids[$u1]]['level'], - $this->users[$this->uids[$u2]]['level']) == 1 && $this->atacks[$id]['out' . $b] == 0) { - //, :) - $this->stats[$this->uids[$u1]]['nopryh'] = floor(0 + (int)$this->stats[$this->uids[$u1]]['nopryh']); - if ((!isset($this->stats[$this->uids[$u1]]['nopryh']) || $this->stats[$this->uids[$u1]]['nopryh'] == 0) && $this->stats[$this->uids[$u1]]['nopryh_act'] < 1) { - $at[$a]['atack'][$j][1] = 6; - $this->stats[$this->uids[$u1]]['nopryh']--; - $this->stats[$this->uids[$u1]]['nopryh_act']++; - } - } - } - $j++; - } - $i++; - } - - if ($pat) { - $pat['p'] = $at; - $at = $pat; - } - - return $at; - } - - /** ( ) */ - private function mf4Razmen($id, $at, $v, $pat = false, $rjd = 0) - { - if ($pat) { - $pat = $at; - $at = $pat['p']; - } else { - $pat = false; - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = $uid1; - $u2 = $uid2; - } else { - $a = 2; - $b = 1; - $u1 = $uid2; - $u2 = $uid1; - } - if ($this->stats[$this->uids[$u2]]['sheld1'] > 0) { - // (u2) (u1) - //print_r( $at[$i] ); - $j = 0; - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ($at[$a]['atack'][$j][2] == $v && $this->mfs(5, - ($this->stats[$this->uids[$u2]]['m8'] / 2 + $this->stats[$this->uids[$u2]]['m18']), - $this->users[$this->uids[$u1]]['level'], - $this->users[$this->uids[$u2]]['level']) == 1 && $this->atacks[$id]['out' . $b] == 0) { - // , :) - $at[$a]['atack'][$j][1] = 7; - } - $j++; - } - } - $i++; - } - - if ($pat) { - $pat['p'] = $at; - $at = $pat; - } - - return $at; - } - - /** */ - private function mf5Razmen($id, $at, $v, $rjd = 0) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = $uid1; - $u2 = $uid2; - } else { - $a = 2; - $b = 1; - $u1 = $uid2; - $u2 = $uid1; - } - - // (u2) (u1) - $j = 0; - if ($rjd > 0) { - $j = $rjd - 1; - } - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ($at[$a]['atack'][$j][2] == $v && $at[$a]['atack'][$j][1] == 2 && $this->mfs(6, [ - 'u1' => $u1, - 'u2' => $u2, - 'a' => $this->stats[$this->uids[$u2]]['m6'], - 'b' => $this->stats[$this->uids[$u1]]['m6'], - ], $this->users[$this->uids[$u1]]['level'], $this->users[$this->uids[$u2]]['level']) == 1) { - //, :) - $at[$a]['atack'][$j][1] = 8; - $rnd_a = rand(1, 5); - $rjd = count($at[$b]['atack']); - if (!$this->testRazmenblock1($id, $u2, $u1, $rnd_a)) { - $at[$b]['atack'][] = [$rnd_a, 1, 0, 1]; // 3 , 0 , 1 - } else { - $at[$b]['atack'][] = [$rnd_a, 3, 0, 1]; // 3 , 0 , 1 - } - $at = $this->contrRestart($id, $at, 1, $rjd); - } - $j++; - } - $i++; - } - return $at; - } - - // - public function addlt($a, $id, $s, $rnd = null) - { - global $log_text; - if (is_null($rnd)) { - $rnd = rand(0, (count($log_text[$s][$id]) - 1)); - } - return '{' . $a . 'x' . $id . 'x' . $rnd . '}'; - } - - private function addNewStatDb($id) - { - mysql_query('INSERT INTO `battle_stat` - ( `battle`,`uid1`,`uid2`,`time`,`type`,`a`,`b`,`ma`,`mb`,`type_a`,`type_b`,`yrn`,`yrn_krit`,`tm1`,`tm2` ) VALUES ( - ' . $this->info['id'] . ', - ' . $id['uid1'] . ', - ' . $id['uid2'] . ', - ' . $id['time'] . ', - ' . $id['type'] . ', - ' . $id['a'] . ', - ' . $id['b'] . ', - ' . $id['ma'] . ', - ' . $id['mb'] . ', - ' . $id['type_a'] . ', - ' . $id['type_b'] . ', - ' . $id['yrn'] . ', - ' . $id['yrn_krit'] . ', - ' . $id['tm1'] . ', - ' . $id['tm2'] . ' - )'); - } - - // - public function addNewStat($stat) - { - if (isset($stat[1])) { - $this->addNewStatDb($stat[1]); - } - if (isset($stat[2])) { - $this->addNewStatDb($stat[2]); - } - } - - // - private function addlogRazmen($id, $at) - { - $this->hodID++; - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $dies = [ - 1 => 0, - 2 => 0, - ]; - - // - $stat = [ - 1 => [ - 'uid1' => 0, - 'uid2' => 0, - 'time' => time(), - 'type' => 0, - 'a' => '00000', - 'b' => '0', - 'type_a' => '', - 'type_b' => '0', - 'yrn' => 0, - 'yrn_krit' => 0, - 'ma' => 0, - 'mb' => 0, - 'tm1' => 0, - 'tm2' => 0, - ], - 2 => [ - 'uid1' => 0, - 'uid2' => 0, - 'time' => time(), - 'type' => 0, - 'a' => '00000', - 'b' => '0', - 'type_a' => '', - 'type_b' => '0', - 'yrn' => 0, - 'yrn_krit' => 0, - 'ma' => 0, - 'mb' => 0, - 'tm1' => 0, - 'tm2' => 0, - ], - ]; - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = $uid1; - $u2 = $uid2; - } else { - $a = 2; - $b = 1; - $u1 = $uid2; - $u2 = $uid1; - } - - if ($this->stats[$this->uids[$u2]]['yhod'] > 0) { - $u2 = $this->yhod_user($u1, $u2, $this->stats[$this->uids[$u2]]['yhod']); - } - - $s1 = $this->users[$this->uids[$u1]]['sex']; - $s2 = $this->users[$this->uids[$u2]]['sex']; - - $stat[$a]['uid1'] = $u1; - $stat[$a]['uid2'] = $u2; - $stat[$a]['ma'] = $this->stats[$this->uids[$u1]]['zona']; - $stat[$a]['mb'] = $this->stats[$this->uids[$u1]]['zonb']; - $stat[$a]['tm1'] = $this->users[$this->uids[$u1]]['team']; - $stat[$a]['tm2'] = $this->users[$this->uids[$u2]]['team']; - $stat[$a]['a'] = $this->atacks[$id]['a' . $a]; - $stat[$a]['b'] = $this->atacks[$id]['b' . $a]; - - $vLog = - 'at1=00000||at2=00000||zb1=' . $this->stats[$this->uids[$u1]]['zonb'] . - '||zb2=' . $this->stats[$this->uids[$u2]]['zonb'] . - '||bl1=' . $this->atacks[$id]['b' . $a] . - '||bl2=' . $this->atacks[$id]['b' . $b] . - '||time1=' . $this->atacks[$id]['time'] . - '||time2=' . $this->atacks[$id]['time2'] . - '||s' . $a . '=' . $s1 . - '||s' . $b . '=' . $s2 . - '||t2=' . $this->users[$this->uids[$u2]]['team'] . - '||t1=' . $this->users[$this->uids[$u1]]['team'] . - '||login1=' . $this->users[$this->uids[$u1]]['login2'] . - '||login2=' . $this->users[$this->uids[$u2]]['login2']; - - $mas = [ - 'text' => '', - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'vars' => $vLog, - 'type' => 1, - ]; - - if (!isset($at[$a]['atack'])) { // - if ($this->atacks[$id]['tpo' . $a] == 2) { - $mas['text'] .= '{u1} .'; - } else { - // - if ($this->info['razdel'] == 0 && $this->info['dn_id'] == 0 && $this->info['izlom'] == 0) { - mysql_query('INSERT INTO `battle_out` (`battle`,`uid1`,`uid2`,`time`,`out`) VALUES ( - ' . $this->info['id'] . ',' . $u1 . ',' . $u2 . ', unix_timestamp(), 1)'); - } - // - if (isset($u1)) { - $mas['text'] .= '{u1} .'; - // - mysql_query('update eff_users set `delete` = unix_timestamp() where `uid` = ' . $u1 . ' AND `delete` = 0 AND `v1` = "priem" AND v2 in (288, 287, 286, 273) LIMIT 1'); - } - } - $mas['text'] = '{tm1} ' . $mas['text']; - $this->add_log($mas); - } else { - $j = 0; - while ($j < count($at[$a]['atack']) && $j < 8) { - // - $mas['text'] = ''; - // - $wt = [ - 21 => 4, - 22 => 5, - 20 => 2, - 28 => 2, - 19 => 3, - 18 => 1, - 26 => 22, - ]; - $par = [ - 'zona' => '{zn2_' . $at[$a]['atack'][$j][0] . '} ', - 'kyda' => $this->lg_zon[$at[$a]['atack'][$j][0]][rand(0, - (count($this->lg_zon[$at[$a]['atack'][$j][0]]) - 1))], - 'chem' => $this->lg_itm[$wt[$at[$a]['atack'][$j]['wt']]][rand(0, - (count($this->lg_itm[$wt[$at[$a]['atack'][$j]['wt']]]) - 1))], - ]; - // - $this->atacks[$id]['uid_' . $u1 . '_t' . $at[$a]['atack'][$j][1]]++; - - // - if ($at[$a]['atack'][$j][1] == 1 || $at[$a]['atack'][$j][1] == 5) { - //u1 u2 - //u1 u2 - $mas['text'] .= - $par['zona'] . '{u2} ' . - $this->addlt($b, 1, $s2) . - $this->addlt($b, 2, $s2) . - $this->addlt($a, 3, $s1) . ' {u1} ' . - $this->addlt($a, 4, $s1) . - $this->addlt($a, 5, $s1) . - $this->addlt($a, 6, $s1) . ' ' . - $this->addlt(1, 7, $s1, $at[$a]['atack'][$j]['yron']['t']) . ' ' . - $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 2) { - //u2 u1 - $mas['text'] .= - $par['zona'] . '{u1} ' . - $this->addlt($a, 8, $s1) . - $this->addlt($a, 9, $s1) . ' {u2} ' . - $this->addlt($b, 11, $s2) . ' ' . - $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 3) { - //u2 u1 - $mas['text'] .= $par['zona'] . '{u1} ' . - $this->addlt($a, 8, $s1) . - $this->addlt($a, 9, $s1) . ' {u2} ' . - $this->addlt($b, 10, $s2) . ' ' . - $this->addlt(1, 7, $s1, $at[$a]['atack'][$j]['yron']['t']) . ' ' . - $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 4) { - //u1 u2 - if (isset($at[$a]['atack'][$j]['yron']['t'])) { - $mas['text'] .= - $par['zona'] . '{u2} ' . - $this->addlt($b, 1, $s2) . - $this->addlt($b, 2, $s2) . - $this->addlt($a, 3, $s1) . ' {u1} ' . - $this->addlt($a, 4, $s1) . - $this->addlt($a, 5, $s1) . ', , ' . - $this->addlt($a, 6, $s1) . ' ' . - $this->addlt(1, 7, $s1, $at[$a]['atack'][$j]['yron']['t']) . ' ' . - $par['chem'] . ' ' . $par['kyda'] . '. '; - } - } elseif ($at[$a]['atack'][$j][1] == 6) { - //u2 u1 - $mas['text'] .= - $par['zona'] . '{u1} ' . - $this->addlt($a, 8, $s1) . - $this->addlt($a, 9, $s1) . ' {u2} ' . - $this->addlt(1, 7, $s1, $at[$a]['atack'][$j]['yron']['t']) . ' ' . - $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 7) { - //u2 u1 - $mas['text'] .= - $par['zona'] . '{u1} ' . - $this->addlt($a, 8, $s1) . - $this->addlt($a, 9, $s1) . ' {u2}, , ' . - $this->addlt($b, 10, $s2) . ' ' . - $this->addlt(1, 7, $s1, $at[$a]['atack'][$j]['yron']['t']) . ' ' . - $par['chem'] . ' ' . $par['kyda'] . '. '; - } elseif ($at[$a]['atack'][$j][1] == 8) { - //u2 u1 - $mas['text'] .= - $par['zona'] . '{u1} ' . - $this->addlt($a, 8, $s1) . - $this->addlt($a, 9, $s1) . ' {u2} ' . - $this->addlt($b, 11, $s2) . ' ' . - $par['chem'] . ' ' . $par['kyda'] . ' . '; - } - - $stat[$a]['type_a'] .= '' . $at[$a]['atack'][$j][1]; - if ( - (!isset($this->stats[$this->uids[$u2]]['notravma']) || $this->stats[$this->uids[$u2]]['notravma'] == 0) && - isset($at[$a]['atack'][$j]['yron']['travma']) && - $at[$a]['atack'][$j]['yron']['travma'][0] > 0 && - floor($at[$a]['atack'][$j]['yron']['hp']) <= 0 - ) { - $tr_pl = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = ' . $u2 . ' AND `delete` = 0 ORDER BY `v1` DESC LIMIT 1')); - if (!isset($tr_pl['id']) || $tr_pl['v1'] < 3) { - //263 - if (isset($tr_pl['id'])) { - $at[$a]['atack'][$j]['yron']['travma'][0] = rand(($tr_pl['v1'] + 1), 3); - } - $tr_pl2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `uid` = ' . $u2 . ' AND `delete` = 0 AND `name` LIKE "% %" limit 1')); - if (!isset($tr_pl2['id']) && $at[$a]['atack'][$j]['yron']['travma'][0] <= 3) { - $mas['text'] = rtrim($mas['text'], '. '); - $mas['text'] .= ', '; - if ($at[$a]['atack'][$j]['yron']['travma'][0] == 1) { - $mas['text'] .= ''; - $this->addTravm($u2, 1, rand(3, 5)); - } elseif ($at[$a]['atack'][$j]['yron']['travma'][0] == 2) { - $mas['text'] .= ''; - $this->addTravm($u2, 2, rand(3, 5)); - } elseif ($at[$a]['atack'][$j]['yron']['travma'][0] == 3) { - $mas['text'] .= ''; - $this->addTravm($u2, 3, rand(3, 5)); - } - $mas['text'] .= ' . '; - } - } - unset($tr_pl); - } - if ($at[$a]['atack'][$j]['yron']['pb'] == 1 && isset($at[$a]['atack'][$j]['yron']['hp'])) { - $mas['text'] = rtrim($mas['text'], '. '); - $mas['text'] .= ' . '; - } - if ($at[$a]['atack'][$j][3] == 1) { - $mas['text'] .= '() '; - } - if (isset($at[$a]['atack'][$j]['yron'])) { - if ($at[$a]['atack'][$j]['yron']['w'] == 3) { - $mas['textWP'] = '( )'; - } elseif ($at[$a]['atack'][$j]['yron']['w'] == 14) { - $mas['textWP'] = '( )'; - } else { - $mas['textWP'] = '( )'; - } - if ( - ($at[$a]['atack'][$j][1] == 4 || $at[$a]['atack'][$j][1] == 5 || $at[$a]['atack'][$j][1] == 1) && - $at[$a]['atack'][$j]['yron']['y'] < 1 - ) { - $at[$a]['atack'][$j]['yron']['r'] = '--'; - } - if ($at[$a]['atack'][$j][1] == 4 || $at[$a]['atack'][$j][1] == 5) { - $stat[$a]['yrn_krit'] += -$at[$a]['atack'][$j]['yron']['r']; - $mas['text'] .= ' ' . $at[$a]['atack'][$j]['yron']['r'] . ''; - } else { - $mas['text'] .= ' ' . $at[$a]['atack'][$j]['yron']['r'] . ''; - } - $stat[$a]['yrn'] += -$at[$a]['atack'][$j]['yron']['r']; - } - if (isset($at[$a]['atack'][$j]['yron']['hp'])) { - if ($this->users[$this->uids[$u2]]['align'] == 9) { - $at[$a]['atack'][$j]['yron']['hp'] = $at[$a]['atack'][$j]['yron']['hp'] / ($at[$a]['atack'][$j]['yron']['hpAll'] / 100); - $at[$a]['atack'][$j]['yron']['hpAll'] = '100%'; - } - $mas['text'] .= ' [' . floor($at[$a]['atack'][$j]['yron']['hp']) . '/' . floor($at[$a]['atack'][$j]['yron']['hpAll']) . ']'; - } - // - if ($mas['text'] != '') { - $mas['text'] = '{tm1} ' . $mas['text']; - } - - if (count($at[$a]['atack'][$j]['yron']['plog']) > 0) { - $il = 0; - while ($il <= count($at[$a]['atack'][$j]['yron']['plog'])) { - if (isset($at[$a]['atack'][$j]['yron']['plog'][$il])) { - eval($at[$a]['atack'][$j]['yron']['plog'][$il]); - } - $il++; - } - } - $this->add_log($mas); - $j++; - } - } - $i++; - } - - // + _ - $this->addNewStat($stat); - - // - if (floor($this->stats[$this->uids[$u1]]['hpNow']) < 1) { - $dies[1] = 1; - } - if (floor($this->stats[$this->uids[$u2]]['hpNow']) < 1) { - $dies[2] = 1; - } - if ($dies[1] > 0 || $dies[2] > 0) { - $rtngwin = [1, 2, 3, 5, 10, 20, 40, 80, 160]; - $rtnglos = [0, 0, 0, -1, -2, -5, -10, -20, -40]; - - if ($this->info['typeBattle'] == 99) { - if ($btlstatus[0] == 0) { - // - $rtngwin = [2, 4, 6, 10, 20, 40, 80, 160, 320]; - if ($this->info['razdel'] == 5) { - // - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } else { - // - $rtnglos = [0, 0, 0, 0, 0, 0, 0, 0, 0]; - } - } elseif ($btlstatus[0] == 25) { - // - $rtngwin = [3, 6, 9, 15, 30, 60, 120, 240, 480]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 50) { - // - $rtngwin = [4, 8, 16, 32, 64, 128, 256, 512, 1024]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 75) { - // - $rtngwin = [5, 10, 20, 40, 80, 160, 320, 640, 1280]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 100) { - // - $rtngwin = [6, 12, 24, 48, 98, 196, 392, 784, 1568]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 150) { - // - $rtngwin = [7, 14, 28, 56, 112, 224, 448, 896, 1792]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } - } else { - if ($btlstatus[0] == 0) { - // - if ($this->info['razdel'] != 5) { - // - $rtnglos = [0, 0, 0, 0, 0, 0, 0, 0, 0]; - } - } elseif ($btlstatus[0] == 25) { - // - $rtngwin = [2, 4, 6, 10, 20, 40, 80, 160, 320]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 50) { - // - $rtngwin = [3, 6, 9, 15, 30, 60, 120, 240, 480]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 75) { - // - $rtngwin = [4, 8, 16, 32, 64, 128, 256, 512, 1024]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 100) { - // - $rtngwin = [5, 10, 20, 40, 80, 160, 320, 640, 1280]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } elseif ($btlstatus[0] == 150) { - // - $rtngwin = [7, 14, 28, 56, 112, 224, 448, 896, 1792]; - $rtnglos = [0, 0, 0, -2, -4, -10, -20, -40, -80]; - } - } - - if ($this->info['dn_id'] > 0 || $this->info['izlom'] != 0 || $this->info['turnir'] != 0) { - // , - $rtngwin = [0, 0, 0, 0, 0, 0, 0, 0, 0]; - $rtnglos = [0, 0, 0, 0, 0, 0, 0, 0, 0]; - } elseif ($this->info['clan1'] > 0 && $this->info['clan2'] > 0) { - // - $rtngwin = [3, 6, 9, 15, 30, 60, 120, 240, 480]; - $rtnglos = [-1, -2, -4, -8, -16, -32, -64, -128, -256]; - } - - if ($dies[1] == 1) { - if ($this->info['dn_id'] > 0) { - // - } else { - if ($this->users[$this->uids[$u1]]['level'] >= 4) { - $rtng1 += $rtnglos[$this->users[$this->uids[$u1]]['level'] - 4]; - $rtng2 += $rtngwin[$this->users[$this->uids[$u1]]['level'] - 4]; - } - } - // 1 2 - $this->spaCheck($this->users[$this->uids[$u1]]['id']); - } - if ($dies[2] == 1) { - if ($this->info['dn_id'] > 0) { - // - } else { - if ($this->users[$this->uids[$u1]]['level'] >= 4) { - $rtng1 += $rtnglos[$this->users[$this->uids[$u1]]['level'] - 4]; - $rtng2 += $rtngwin[$this->users[$this->uids[$u1]]['level'] - 4]; - } - } - // 2 1 - $this->spaCheck($this->stats[$this->uids[$u2]]['id']); - } - // - // - if ( - $this->info['type'] != 564 && - $this->stats[$this->uids[$u1]]['inTurnir'] == 0 && - $this->stats[$this->uids[$u2]]['inTurnir'] == 0 && - $this->info['dn_id'] == 0 && - $this->info['izlom'] == 0 - ) { - // - if ($this->users[$this->uids[$u2]]['bot'] == 0) { - mysql_query('INSERT INTO `users_reting` (`uid`,`time`,`val`,`align`,`clan`) VALUES ( - ' . $u1 . ', - unix_timestamp(), - ' . $rtng1 . ', - ' . $this->users[$this->uids[$u1]]['align'] . ', - ' . $this->users[$this->uids[$u1]]['clan'] . ') - '); - } - unset($rtng); - if ($this->users[$this->uids[$u1]]['bot'] == 0) { - mysql_query('INSERT INTO `users_reting` (`uid`,`time`,`val`,`align`,`clan`) VALUES ( - ' . $u2 . ', - unix_timestamp(), - ' . $rtng2 . ', - ' . $this->users[$this->uids[$u2]]['align'] . ', - ' . $this->users[$this->uids[$u2]]['clan'] . ') - '); - } - } - unset($rtng1, $rtng2); - } - } - - // - public function priemAddLog($id, $a, $b, $u1, $u2, $prm, $text, $hodID, $tm1 = 0, $tm2 = 0) - { - if ($tm1 === 0) { - if (isset($this->atacks[$id])) { - $tm1 = $this->atacks[$id]['time']; - } else { - $tm1 = time(); - } - } - if ($tm2 === 0) { - if (isset($this->atacks[$id])) { - $tm2 = $this->atacks[$id]['time2']; - } else { - $tm2 = time(); - } - } - $vLog = - 'prm=' . $prm . - '||at1=00000||at2=00000||zb1=' . $this->stats[$this->uids[$u1]]['zonb'] . - '||zb2=' . $this->stats[$this->uids[$u2]]['zonb'] . - '||bl1=' . $this->atacks[$id]['b' . $a] . - '||bl2=' . $this->atacks[$id]['b' . $b] . - '||time1=' . $tm1 . - '||time2=' . $tm2 . - '||s' . $a . '=' . $this->users[$this->uids[$u1]]['sex'] . - '||s' . $b . '=' . $this->users[$this->uids[$u2]]['sex'] . - '||t2=' . $this->users[$this->uids[$u2]]['team'] . - '||t1=' . $this->users[$this->uids[$u1]]['team'] . - '||login1=' . $this->users[$this->uids[$u1]]['login2'] . - '||login2=' . $this->users[$this->uids[$u2]]['login2']; - $mas = [ - 'text' => $text, - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $hodID, - 'vars' => $vLog, - 'type' => 1, - ]; - $this->add_log($mas); - } - - // ( ) - public function priemAddLogFast($u1, $u2, $prm, $text, $hodID, $tm) - { - $vLog = - 'prm=' . $prm . - '||time1=' . $tm . - '||time2=' . $tm . - '||s1=' . $this->users[$this->uids[$u1]]['sex'] . - '||s2=' . $this->users[$this->uids[$u2]]['sex'] . - '||t2=' . $this->users[$this->uids[$u2]]['team'] . - '||t1=' . $this->users[$this->uids[$u1]]['team'] . - '||login1=' . $this->users[$this->uids[$u1]]['login2'] . - '||login2=' . $this->users[$this->uids[$u2]]['login2']; - $mas = [ - 'text' => $text, - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => ($this->hodID + $hodID), - 'vars' => $vLog, - 'type' => 1, - ]; - $this->add_log($mas); - } - - // - private function contrRestart($id, $at, $v, $rjd = 0) - { - // - $at = $this->mf1Razmen($id, $at, $v, true, $rjd); - // - $at = $this->mf3Razmen($id, $at, $v, true, $rjd); - // - //$at = $this->mf5Razmen($id,$at,$v,true,$rjd); - // ( , ) - $at = $this->mf4Razmen($id, $at, $v, true, $rjd); - // - //$at = $this->yronRazmen($id,$at); - // - $at = $this->mf2Razmen($id, $at, $v, true, $rjd); - - return $this->yronRazmen($id, $at, true, $rjd); - } - - // . - public function yronGetrazmen($uid1, $uid2, $wp, $zona) - { - global $u; - $r = ['r' => '--',]; - // - /* - - - - - */ - $witm = 0; - $witm_type = 0; - - if ($wp > 0) { - $witm = $this->stats[$this->uids[$uid1]]['items'][$this->stats[$this->uids[$uid1]]['wp' . $wp . 'id']]; - $witm_data = $this->lookStats($witm['data']); - $witm_type = $this->weaponTx($witm); - } - - if ($witm_type == 0 || $witm_type == 12) { - $witm_type2 = ''; - } else { - $witm_type2 = $witm_type; - } - $r['t'] = $witm_type2; - // - /* - - - - - - */ - $bron = [ - 1 => [$this->stats[$this->uids[$uid2]]['mib1'], $this->stats[$this->uids[$uid2]]['mab1']], - 2 => [$this->stats[$this->uids[$uid2]]['mib2'], $this->stats[$this->uids[$uid2]]['mab2']], - 3 => [$this->stats[$this->uids[$uid2]]['mib2'], $this->stats[$this->uids[$uid2]]['mab2']], - 4 => [$this->stats[$this->uids[$uid2]]['mib3'], $this->stats[$this->uids[$uid2]]['mab3']], - 5 => [$this->stats[$this->uids[$uid2]]['mib4'], $this->stats[$this->uids[$uid2]]['mab4']], - ]; - // - // - //$witm_data - $iii = 1; - while ($iii <= 7) { - if (isset($witm_data['sv_a' . $iii]) && $witm_data['sv_a' . $iii] != 0) { - $this->stats[$this->uids[$uid1]]['a' . $iii] += $witm_data['sv_a' . $iii]; - } - if (isset($witm_data['sv_mg' . $iii]) && $witm_data['sv_mg' . $iii] != 0) { - $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_mg' . $iii]; - } - $iii++; - } - $iii = 1; - while ($iii <= 4) { - if (isset($witm_data['sv_aall']) && $witm_data['sv_aall'] != 0) { - $this->stats[$this->uids[$uid1]]['a' . $iii] += $witm_data['sv_aall']; - } - $iii++; - } - $iii = 1; - while ($iii <= 4) { - if (isset($witm_data['sv_mall']) && $witm_data['sv_mall'] != 0) { - $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_mall']; - } - $iii++; - } - $iii = 1; - while ($iii <= 7) { - if (isset($witm_data['sv_m2all']) && $witm_data['sv_m2all'] != 0) { - $this->stats[$this->uids[$uid1]]['mg' . $iii] += $witm_data['sv_m2all']; - } - $iii++; - } - - if (isset($witm_data['sv_m3']) && $witm_data['sv_m3'] != 0) { - $this->stats[$this->uids[$uid1]]['m3'] += $witm_data['sv_m3']; - } - - $iii = 1; - while ($iii <= 7) { - if (isset($witm_data['sv_pa' . $iii]) && $witm_data['sv_pa' . $iii] != 0) { - $this->stats[$this->uids[$uid1]]['pa' . $iii] += $witm_data['sv_pa' . $iii] + $witm_data['sv_m10']; - } - if (isset($witm_data['sv_pm' . $iii]) && $witm_data['sv_pm' . $iii] != 0) { - $this->stats[$this->uids[$uid1]]['pm' . $iii] += $witm_data['sv_pm' . $iii] + $witm_data['sv_m11a']; - if ($iii < 5) { - $this->stats[$this->uids[$uid1]]['pm' . $iii] += $witm_data['sv_m11']; - } - } - $iii++; - } - // + - $wAp = 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]; - $wAp -= $this->stats[$this->uids[$uid2]]['antpa' . $witm_type]; - } else { - $wAp += $this->stats[$this->uids[$uid1]]['m10'] + $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)]; - } - - // - $vladenie = 0; - - // - $proboi = 0; - $witm_data['m9'] = $this->stats[$this->uids[$uid1]]['m9']; - if (rand(1, 100) < floor($witm_data['m9'] / 2)) { - $proboi = floor($witm_data['m9'] / 2); - $r['pb'] = 1; - } - - $y = $this->yrn( - $this->stats[$this->uids[$uid1]], - $this->stats[$this->uids[$uid2]], - $this->users[$this->uids[$uid1]], - $this->users[$this->uids[$uid2]], - $this->users[$this->uids[$uid1]]['level'], - $this->users[$this->uids[$uid2]]['level'], - // - $witm_type, - $this->stats[$this->uids[$uid1]]['minAtack'], //. () - $this->stats[$this->uids[$uid1]]['maxAtack'], //. - $bron[$zona][0], // . - $bron[$zona][1], // - // - $vladenie, // - $wAp, // - (round($this->stats[$this->uids[$uid1]]['m3'])), // - (($this->stats[$this->uids[$uid2]]['za' . $witm_type2]) - $this->stats[$this->uids[$uid1]]['pza']), - // - $this->stats[$this->uids[$uid1]]['ozash'], // - $proboi, // - 0, // - ($witm_data['sv_yron_min'] + $this->stats[$this->uids[$uid1]]['yron_min']), - ($witm_data['sv_yron_max'] + $this->stats[$this->uids[$uid1]]['yron_max']), - $this->stats[$this->uids[$uid2]]['zaproc'], - $this->stats[$this->uids[$uid2]]['zmproc'], - (($this->stats[$this->uids[$uid2]]['zm' . ($witm_type2 - 4)]) - round($this->stats[$this->uids[$uid1]]['pzm'] * 0.8)), - // - $this->stats[$this->uids[$uid1]]['omzash'], // - $witm['type'], - $witm - ); - - $r['y'] = round(rand($y['min'] + $proboi, $y['max'] + round($proboi / 2))); - $r['k'] = round(rand($y['Kmin'] + round($proboi / 4), $y['Kmax'] + round($proboi / 8))); - $r['m_y'] = $y['max']; - $r['m_k'] = $y['Kmax']; - $r['bRND'] = $y['bRND']; - $r['w_type'] = $witm_type; - - - // - if ($witm['type'] == 18) { - $tp = 1; - } elseif ($witm['type'] == 19) { - $tp = 2; - } elseif ($witm['type'] == 20) { - $tp = 3; - } elseif ($witm['type'] == 21) { - $tp = 4; - } - - if ($tp != $witm_type && $wp > 0) // - { - $r['y'] = round($r['y'] / 3); - $r['r'] = round($r['r'] / 3); - $r['k'] = round($r['k'] / 3); - $r['m_k'] = round($r['m_k'] / 3); - $r['m_y'] = round($r['m_y'] / 3); - } - - if (isset($this->stats[$this->uids[$uid2]]['zaproc'])) { - $r['y'] = round($r['y'] - $r['y'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - $r['r'] = round($r['r'] - $r['r'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - $r['k'] = round($r['k'] - $r['k'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - $r['m_k'] = round($r['m_k'] - $r['m_k'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - $r['m_y'] = round($r['m_y'] - $r['m_y'] * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - if ($r['k'] < 1) { - $r['k'] = 2; - } - } - - if ($r['y'] < 1) { - $r['y'] = 1; - } - if ($r['r'] >= 0) { - $r['r'] = -1; - } - if ($r['k'] < 1) { - $r['k'] = 1; - } - if ($r['m_k'] < 1) { - $r['m_k'] = 1; - } - if ($r['m_y'] < 1) { - $r['m_y'] = 1; - } - return $r; - } - - // - private function yronRazmen($id, $at, $pat = false, $rjd = 0) - { - if ($pat) { - $pat = $at; - $at = $pat['p']; - } else { - unset($pat); - } - - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $yhod = [1 => 1, 2 => 0]; - } elseif ($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod'] > 0) { - $yhod = [1 => 0, 2 => 1]; - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $u1 = $uid1; - $u2 = $uid2; - } else { - $a = 2; - $u1 = $uid2; - $u2 = $uid1; - } - - // - - - // (u2) (u1) - $j = 0; - $k = 0; - if ($rjd > 0) { - $j = $rjd - 1; - } - // - - while ($j < count($at[$a]['atack']) && $j < 8) { - // , - if ($k == 0 && isset($this->stats[$this->uids[$u1]]['wp3id'])) { - // - $wp = 3; - $k = 1; - } else { - // - if ( - isset($this->stats[$this->uids[$u1]]['wp14id']) && - $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp14id']]['type'] != 13 - ) { - $wp = 14; - } else { - $wp = 3; - } - $k = 0; - } - $witm = $this->stats[$this->uids[$u1]]['items'][$this->stats[$this->uids[$u1]]['wp' . $wp . 'id']]; - $witm_type = $this->weaponTx($witm); - $at[$a]['atack'][$j]['wt'] = $witm['type']; - // - $at[$a]['atack'][$j]['yhod'] = $yhod[$a]; - - 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]); - - 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]); - - 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++; - } - - if ($pat) { - $pat['p'] = $at; - $at = $pat; - } - return $at; - } - - // - private function updateHealth($id, $at) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) { - $uid1 = $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) { - $uid2 = $this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod']); - } - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $a = 1; - $b = 2; - $u1 = $uid1; - $u2 = $uid2; - } else { - $a = 2; - $b = 1; - $u1 = $uid2; - $u2 = $uid1; - } - - // - if ($this->atacks[$id]['out' . $b] > 0) { - // ${'u'.$a} , - // - if (rand(0, 100) < min(floor($this->stats[$this->uids[$u1]]['m6'] / 5), 20) && - $this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic3']++; - } - // - if (rand(0, 100) < min(floor($this->stats[$this->uids[$u1]]['m8'] / 4), 20) && - $this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic4']++; - } - } - - // (u2) (u1) - $j = 0; - while ($j < count($at[$a]['atack']) && $j < 8) { - // - if ($at[$a]['atack'][$j][1] == 1) { - //u1 u2 - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic1']++; - } - // - if ( - $at[$a]['atack'][$j]['yron']['2h'] == 1 && - $this->stats[$this->uids[$u2]]['this_animal'] == 0 - ) { - $this->users[$this->uids[$u1]]['tactic1'] += 2; - } - } elseif ($at[$a]['atack'][$j][1] == 2) { - //u2 u1 - } elseif ($at[$a]['atack'][$j][1] == 3) { - //u2 u1 - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u2]]['tactic4']++; - } - } elseif ($at[$a]['atack'][$j][1] == 4) { - //u1 u2 - if ( - !isset($at[$a]['atack'][$j]['notactic2']) && - $this->stats[$this->uids[$u2]]['this_animal'] == 0 - ) { - $this->users[$this->uids[$u1]]['tactic2']++; - } - $this->users[$this->uids[$u2]]['tactic4']++; // - } elseif ($at[$a]['atack'][$j][1] == 5) { - //u1 u2 - if (!isset($at[$a]['atack'][$j]['notactic2'])) { - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic2'] += 2; - } - // - if ( - $at[$a]['atack'][$j]['yron']['2h'] == 1 && - $this->stats[$this->uids[$u2]]['this_animal'] == 0 - ) { - $this->users[$this->uids[$u1]]['tactic2'] += 1; - } - } - } elseif ($at[$a]['atack'][$j][1] == 6) { - //u2 u1 - if ( - !isset($at[$a]['atack'][$j]['notactic5']) && - $this->stats[$this->uids[$u1]]['this_animal'] == 0 - ) { - $this->users[$this->uids[$u2]]['tactic5']++; - } - } elseif ($at[$a]['atack'][$j][1] == 7) { - //u2 u1 // - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u2]]['tactic4']++; - } - } elseif ($at[$a]['atack'][$j][1] == 8) { - //u2 u1 - if ($this->stats[$this->uids[$u1]]['this_animal'] == 0) { - $this->users[$this->uids[$u2]]['tactic3']++; - } - } - // , - 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)) { - if ($this->stats[$this->uids[$u2]]['hpNow'] <= $at[$a]['atack'][$j]['yron']['y']) { - $at[$a]['atack'][$j]['yron']['y'] = $this->stats[$this->uids[$u2]]['hpNow']; - } - if ($this->stats[$this->uids[$u2]]['hpNow'] <= $at[$a]['atack'][$j]['yron']['k']) { - $at[$a]['atack'][$j]['yron']['k'] = $this->stats[$this->uids[$u2]]['hpNow']; - } - - if ($at[$a]['atack'][$j]['yron']['y'] < 0) { - $at[$a]['atack'][$j]['yron']['y'] = 1; - $at[$a]['atack'][$j]['yron']['r'] = -1; - $at[$a]['atack'][$j]['yron']['k'] = 1; - } - if ($this->stats[$this->uids[$u2]]['hpNow'] < 1) { - $at[$a]['atack'][$j]['yron']['y'] = 0; - $at[$a]['atack'][$j]['yron']['r'] = -1; - $at[$a]['atack'][$j]['yron']['k'] = 0; - } - - // - $this->takeExp($u1, $at[$a]['atack'][$j]['yron']['y'], $u1, $u2); - // - $this->stats[$this->uids[$u2]]['hpNow'] -= $at[$a]['atack'][$j]['yron']['y']; - $this->users[$this->uids[$u2]]['last_hp'] = -$at[$a]['atack'][$j]['yron']['y']; - - $at[$a]['atack'][$j]['yron']['hp'] = $this->stats[$this->uids[$u2]]['hpNow']; - if ($at[$a]['atack'][$j]['yron']['hp'] < 1) { - $at[$a]['atack'][$j]['yron']['hp'] = 0; - } - $at[$a]['atack'][$j]['yron']['hpAll'] = $this->stats[$this->uids[$u2]]['hpAll']; - if ($at[$a]['atack'][$j]['yron']['hp'] > $at[$a]['atack'][$j]['yron']['hpAll']) { - $at[$a]['atack'][$j]['yron']['hp'] = $at[$a]['atack'][$j]['yron']['hpAll']; - } - // - // - if ( - rand(0, 100) <= 50 && - ($at[$a]['atack'][$j][1] == 4 || $at[$a]['atack'][$j][1] == 5) && - !isset($at[$a]['atack'][$j]['yron']['travma']) && - rand(0, 1000) < 500 && - $this->users[$this->uids[$u2]]['level'] > 1 && - $this->stats[$this->uids[$u1]] > 1 - ) { - $trvm_chns = floor(rand(0, 200) / 10); - if ($trvm_chns > 3 || $trvm_chns < 1) { - $trvm_chns = 0; - } - $at[$a]['atack'][$j]['yron']['travma'] = [$trvm_chns, ' ']; - unset($trvm_chns); - } - } - $j++; - } - $i++; - } - return $at; - } - - // - private function addstatuser($id) - { - if (!$id && !is_numeric($id)) { - return; - } - - mysql_query('INSERT INTO `battle_users` - ( `battle`,`uid`,`time_enter`,`login`,`level`,`align`,`clan`,`hpAll`,`hp`,`hpStart`,`team` ) - VALUES - ( - ' . $this->info['id'] . ', - ' . $id . ', - unix_timestamp(), - ' . $this->users[$this->uids[$id]]['login'] . ', - ' . $this->users[$this->uids[$id]]['level'] . ', - ' . $this->users[$this->uids[$id]]['align'] . ', - ' . $this->users[$this->uids[$id]]['clan'] . ', - ' . $this->stats[$this->uids[$id]]['hpAll'] . ', - ' . $this->stats[$this->uids[$id]]['hp'] . ', - ' . $this->stats[$this->uids[$id]]['hpNow'] . ', - ' . $this->users[$this->uids[$id]]['team'] . ' - )'); - } - - // - public function priemsRazmen($id, $at) - { - if ($at == 'fast') { - $uid1 = $id[0]; - $uid2 = $id[1]; - } else { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - } - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $u1 = $uid1; - } else { - $u1 = $uid2; - } - - // - $eff = $this->stats[$this->uids[$u1]]['effects']; - $this->stats[$this->uids[$u1]]['u_priem'] = []; - $j = 0; - while ($j <= count($eff)) { - if (isset($eff[$j]) && $eff[$j]['id_eff'] == 22 && $eff[$j]['v1'] == 'priem' && $eff[$j]['v2'] > 0) { - $this->stats[$this->uids[$u1]]['u_priem'][] = [ - $j, - $eff[$j]['v2'], - $this->prm[$eff[$j]['v2']]['act'], - $eff[$j]['id'], - $this->prm[$eff[$j]['v2']]['type_of'], - $this->prm[$eff[$j]['v2']]['moment'], - $this->prm[$eff[$j]['v2']]['moment_end'], - $this->prm[$eff[$j]['v2']]['type_sec'], - ]; - } - $j++; - } - $i++; - } - } - - // - private function priemsRazmenMoment($id, $at) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $u1 = $uid1; - $u2 = $uid2; - } else { - $u1 = $uid2; - $u2 = $uid1; - } - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - // - - // - if (!isset($this->stats[$this->uids[$u2]]['nopryh']) || $this->stats[$this->uids[$u2]]['nopryh'] == 0) { - $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][5] == 1) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - $this->stats[$this->uids[$u2]]['nopryh']--; - } - } - $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][5] == 2) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $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][5] == 3) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - } - unset(${'fx_priem'}); - } - } - $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][5] == 4) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $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][5] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $j++; - } - $i++; - } - //return $at; - } - - // ( ) - private function priemsRazmenMomentEnd($id, $at) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $u1 = $uid1; - $u2 = $uid2; - } else { - $u1 = $uid2; - $u2 = $uid1; - } - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - // - - // - if (!isset($this->stats[$this->uids[$u2]]['nopryh']) || $this->stats[$this->uids[$u2]]['nopryh'] == 0) { - $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][6] == 1) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - $this->stats[$this->uids[$u2]]['nopryh']--; - } - } - $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][6] == 2) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $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][6] == 3) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - } - $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][6] == 4) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $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][6] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_used_this = $u1; - $pr_moment = true; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u1, $j); - unset(${'fx_priem'}); - } - } - $j++; - } - $i++; - } - //return $at; - } - - - // - private function priemsTestRazmen($id, $at) - { - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $u1 = $uid1; - $u2 = $uid2; - } else { - $u1 = $uid2; - $u2 = $uid1; - } - - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - - // - - $j = 0; - while ($j <= count($this->stats[$this->uids[$u1]]['u_priem'])) { - if ($this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 220 || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 237 - || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 286 || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 287 || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 288 - || $this->stats[$this->uids[$u1]]['u_priem'][$j][1] == 213) { - 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++; - } - - // - if (!isset($this->stats[$this->uids[$u2]]['nopryh']) || $this->stats[$this->uids[$u2]]['nopryh'] == 0) { - $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] == 1) { - 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'}); - $this->stats[$this->uids[$u2]]['nopryh']--; - } - } - $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] == 2) { - 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++; - } - - // - $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] == 3) { - 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'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - } - unset(${'fx_priem'}); - } - } - $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] == 4) { - 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'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - } - unset(${'fx_priem'}); - } - } - $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] == 5) { - 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'); - if (isset($fx_priem)) { - $at = $fx_priem($id, $at, $u1, $j); - } - unset(${'fx_priem'}); - } - } - $j++; - } - $i++; - } - - $i = 1; - while ($i <= 2) { - $u1 = $i == 1 ? $uid1 : $uid2; - - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - - // - $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++; - } - - // - $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] == 9) { - 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++; - } - - return $at; - } - - // - private function priemsRestartRazmen($id, $at) - { - if (isset($at['p'])) { - // - // - $uid1 = $this->atacks[$id]['uid1']; - $uid2 = $this->atacks[$id]['uid2']; - - /* - , , : - 1. - 2 1. - : - 1. - 2 1. - 3. - 4 3. - .. - */ - $i = 1; - while ($i <= 2) { - if ($i == 1) { - $u1 = $uid1; - $u2 = $uid2; - } else { - $u1 = $uid2; - $u2 = $uid1; - } - - if (!isset($at['p']['p_cast'])) { - $at['p'] = $at; - $at['p']['p_cast'] = true; - } - - // - if (!isset($this->stats[$this->uids[$u2]]['nopryh']) || $this->stats[$this->uids[$u2]]['nopryh'] == 0) { - $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] == 1) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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'}); - $this->stats[$this->uids[$u2]]['nopryh']--; - } - } - $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] == 2) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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++; - } - // - $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] == 4) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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++; - } - // - $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] == 3) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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++; - } - // - $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] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $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++; - } - // - $j = 0; - while ($j <= count($this->stats[$this->uids[$u2]]['u_priem'])) { - if ($this->stats[$this->uids[$u1]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 8) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_tested_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u2, $j); - unset(${'fx_priem'}); - } - } - $j++; - } - // - $j = 0; - while ($j <= count($this->stats[$this->uids[$u2]]['u_priem'])) { - if ($this->stats[$this->uids[$u1]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 9) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_tested_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - $at = $fx_priem($id, $at, $u2, $j); - unset(${'fx_priem'}); - } - } - $j++; - } - - $i++; - } - } - return $at['p']; - } - - // - public $um_priem = []; - - /** - * . - - * . - * @param $uid1 - * @param $uid2 - * @param $priem - * @param $yron - * @param $profil - * @param $stabil [deprecated] - * @param $test [deprecated] - * @param $inlog - * @return float|int|mixed - */ - public function testYronPriem($uid1, $uid2, $priem, $yron, $profil, $stabil, $test = false, $inlog = 0) - { - /* - profil = { - -1 - - -2 - - 0 - - 1-4 - - 5-12 - - } - stabil - . - */ - // - $u1 = $uid1; - $u2 = $uid2; - - // $u1 $u2 - // - if (!isset($this->stats[$this->uids[$u2]]['u_priem'])) { - $eff = $this->stats[$this->uids[$u2]]['effects']; - $j = 0; - while ($j <= count($eff)) { - if (isset($eff[$j]) && $eff[$j]['id_eff'] == 22 && $eff[$j]['v1'] == 'priem' && $eff[$j]['v2'] > 0) { - $this->stats[$this->uids[$u2]]['u_priem'][] = [ - $j, - $eff[$j]['v2'], - $this->prm[$eff[$j]['v2']]['act'], - $eff[$j]['id'], - $this->prm[$eff[$j]['v2']]['type_of'], - $this->prm[$eff[$j]['v2']]['moment'], - ]; - } - $j++; - } - unset($eff); - } - // - $j = 0; - while ($j <= count($this->stats[$this->uids[$u2]]['u_priem'])) { - if ($this->stats[$this->uids[$u2]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 4) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - $yron = $fx_moment($u2, $u1, $j, $yron, $profil); - unset(${'fx_moment'}); - } - } - $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] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this = $u1; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - if (isset($fx_moment)) { - $yron = $fx_moment($u1, $u2, $j, $yron, $profil, $inlog); - } - unset(${'fx_moment'}); - } - } - $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][7] == 5) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this_seven = $u1; - require('priem/' . $this->stats[$this->uids[$u1]]['u_priem'][$j][1] . '.php'); - if (isset($fx_moment_seven)) { - $yron = $fx_moment_seven($u1, $u2, $j, $yron, $profil, $inlog); - } - unset(${'fx_moment_seven'}); - } - } - $j++; - } - - // - $j = 0; - while ($j <= count($this->stats[$this->uids[$u2]]['u_priem'])) { - if ($this->stats[$this->uids[$u2]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 8) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - if (isset($fx_moment)) { - $yron = $fx_moment($u2, $u1, $j, $yron, $profil, $inlog); - } - unset(${'fx_moment'}); - } - } - if ($this->stats[$this->uids[$u2]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 9) { - if (file_exists('../../_incl_data/class/priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php')) { - $pr_momental_this = $u2; - require('priem/' . $this->stats[$this->uids[$u2]]['u_priem'][$j][1] . '.php'); - if (isset($fx_moment)) { - $yron = $fx_moment($u2, $u1, $j, $yron, $profil, $inlog); - } - unset(${'fx_moment'}); - } - } - $j++; - } - - if ($this->stats[$this->uids[$u2]]['zaproc'] > 0) { - $yron = round($yron - $yron * $this->stats[$this->uids[$uid2]]['zaproc'] / 100); - if ($yron < 1) { - $yron = 1; - } - } - - return $yron; - } - - // + \ - - /** - * @param $u1 - * @param $u2 - * @param $yron - * @param $type [deprecated] - * @return void - */ - public function priemYronSave($u1, $u2, $yron, $type = 0) - { - //$type 0 - , 1 - - - $this->testUserInfoBattle($u1); - $this->testUserInfoBattle($u2); - - if (isset($this->uids[$u1])) { - if ($this->stats[$this->uids[$u2]]['hpAll'] <= 1000) { - $adt6 = round(0.1 * (floor($yron) / $this->stats[$this->uids[$u2]]['hpAll'] * 100), 10); - } else { - $adt6 = round(0.1 * (floor($yron) / 1000 * 100), 10); - } - - if ($yron > $this->stats[$this->uids[$u2]]['hpNow']) { - $yron = $this->stats[$this->uids[$u2]]['hpNow']; - } - - if ($yron > 0) { - $this->users[$this->uids[$u1]]['battle_yron'] += $yron; - $this->users[$this->uids[$u1]]['battle_exp'] += round($this->testExp($yron, - $this->stats[$this->uids[$u1]], $this->stats[$this->uids[$u2]], $u1, $u2)); - if ($this->stats[$this->uids[$u2]]['this_animal'] == 0) { - $this->users[$this->uids[$u1]]['tactic6'] += $adt6; - $this->stats[$this->uids[$u1]]['tactic6'] += $adt6; - } else { - $this->users[$this->uids[$u1]]['tactic6'] += $adt6 / 3; - $this->stats[$this->uids[$u1]]['tactic6'] += $adt6 / 3; - } - } else { - $adt6 = 0; - } - // - $this->users[$this->uids[$u2]]['last_hp'] = -$yron; - // - mysql_query('UPDATE `stats` SET - `tactic6` = `tactic6` + ' . $adt6 . ', - `battle_yron` = `battle_yron` + ' . $yron . ', - `battle_exp` = `battle_exp` + ' . round($this->testExp($yron, $this->stats[$this->uids[$u1]], - $this->stats[$this->uids[$u2]], $u1, $u2)) . ' - WHERE `id` = ' . $u1); - // - mysql_query('UPDATE `stats` SET - `last_hp` = ' . $this->users[$this->uids[$u2]]['last_hp'] . ' - WHERE `id` = ' . $u2); - } - - $this->addNewStat([ - 1 => [ - 'battle' => $this->info['id'], - 'uid1' => $this->users[$this->uids[$u1]]['id'], - 'uid2' => $this->users[$this->uids[$u2]]['id'], - 'time' => time(), - 'type' => 0, - 'a' => '10000', - 'b' => 0, - 'type_a' => 1, - 'type_b' => 0, - 'ma' => 1, - 'mb' => 1, - 'yrn' => $yron, - 'yrn_krit' => 0, - 'tm1' => $this->users[$this->uids[$u1]]['team'], - 'tm2' => $this->users[$this->uids[$u2]]['team'], - ], - ]); - } - - // - - public function startAtack($id) - { - global $c, $u, $priem; - - if (!isset($this->atacks[$id]) || $this->atacks[$id]['lock'] != 0) { - return; - }// - $i = 1; - $j = 2; - $k = 0; - - while ($i <= 2) { - $untac = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `v1` = "priem" AND `v2` = 217 AND `uid` = ' . $this->atacks[$id]['uid' . $i] . ' AND `delete` = 0')); - - $agrs = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `v1` = "priem" AND `v2` = 211 AND `uid` = ' . $this->atacks[$id]['uid' . $j] . ' AND `delete` = 0')); - - if (isset($untac['id']) && !isset($agrs['id'])) { - // AND `a`.`v2` != 235 // AND `a`.`v2` != 273 AND `a`.`v2` != 286 AND `a`.`v2` != 287 AND `a`.`v2` != 288 - - $pvr['sp'] = mysql_query('SELECT * FROM `eff_users` WHERE - `uid` = ' . $this->atacks[$id]['uid' . $j] . ' - AND `delete` = 0 - AND `v1` = "priem" - and `v2` not in (222, 238, 228, 229, 139, 188, 226, 211, 49, 233, 227, 220, 191, 332, 333, - 334, 335, 236, 201, 261, 262, 206, 207, 208, 209, 210, 284, 263, 258, 29, 30, 31, 32, 526, 249, - 248, 187, 245, 175, 176, 177, 178, 179, 285, 36, 85, 86, 87, 88, 89, 90, 269, 276, 277, 270, - 174, 324, 217) - AND `name` NOT LIKE "%%" - LIMIT 30'); - while ($pvr['pl'] = mysql_fetch_array($pvr['sp'])) { - $pvr['pl']['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $pvr['pl']['v2'] . '" LIMIT 1')); - if (isset($pvr['pl']['priem']['id']) && $pvr['pl']['priem']['neg'] == 0) { - $this->delPriem($pvr['pl'], $this->users[$this->uids[$this->atacks[$id]['uid' . $j]]], 100); - } - } - // - $k++; - } - $j--; - $i++; - } - - // 1% - if ($this->atacks[$id]['out1'] == 0) { - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['s6'] / 4 < $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['level']) { - $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'] += floor($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['level'] + $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['hod_minmana']); - } else { - $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->users[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'] = $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['mpNow']; - } - // - if ($this->atacks[$id]['out2'] == 0) { - if ($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['s6'] / 4 < $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['level']) { - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'] += floor($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['level'] + $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['hod_minmana']); - } else { - $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]['uid2']]]['mpNow'] = $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['mpNow']; - } - - // - if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['antm3'] != 0) { - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['m3'] -= round($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['antm3']); - } - 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']); - } - - // - $this->testZonb($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2']); - - // - $this->magicItems($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], $id); - $this->magicItems($this->atacks[$id]['uid2'], $this->atacks[$id]['uid1'], $id); - - // - $this->priemsRazmen($id, $at); - $this->priemsRazmenMoment($id, $at); - $this->priemsRazmen($id, $at); - - $at = $this->newRazmen($id); - - // - // , , , , - // ( , ) - $at = $this->mf2Razmen($id, $at, $v); // - $at = $this->mf3Razmen($id, $at, $v); // - $at = $this->mf4Razmen($id, $at, $v); // - - $at = $this->mf1Razmen($id, $at, $v); // - $at = $this->mf5Razmen($id, $at, $v); // - - $at = $this->yronRazmen($id, $at); // - - // - // - $at = $this->priemsTestRazmen($id, $at); - // ( .) - $at = $this->priemsRestartRazmen($id, $at); // ( ) - // - - // - if (count($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['set_pog']) > 0) { - $this->testPogB($this->atacks[$id]['uid1'], 1, $id, 1); - } - if (count($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['set_pog']) > 0) { - $this->testPogB($this->atacks[$id]['uid2'], 1, $id, 1); - } - - // - $at = $this->updateHealth($id, $at); - - // + - $this->addlogRazmen($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); - - // - // - $this->restZonb($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2']); - // - $zd1 = explode('|', $this->users[$this->uids[$this->atacks[$id]['uid1']]]['priems_z']); - $zd2 = explode('|', $this->users[$this->uids[$this->atacks[$id]['uid2']]]['priems_z']); - // - $prmos = []; - // - $i5 = 0; - - while ($i5 < 51) { - if (isset($zd1[$i5]) && $zd1[$i5] > 0) { - // - $zd1[$i5] -= 1; - } else { - $zd1[$i5] = 0; - } - if (isset($zd2[$i5]) && $zd2[$i5] > 0) { - // - $zd2[$i5] -= 1; - } else { - $zd2[$i5] = 0; - } - $i5++; - } - unset($prmos); - - if ($this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy'] == $this->users[$this->uids[$this->atacks[$id]['uid2']]]['id']) { - $this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy'] = -$this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy']; - } - - if ($this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy'] == $this->users[$this->uids[$this->atacks[$id]['uid1']]]['id']) { - $this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy'] = -$this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy']; - } - - $this->users[$this->uids[$this->atacks[$id]['uid1']]]['priems_z'] = implode('|', $zd1); - $this->users[$this->uids[$this->atacks[$id]['uid2']]]['priems_z'] = implode('|', $zd2); - if ($this->atacks[$id]['uid1'] == $u->info['id']) { - $u->info['priems_z'] = implode('|', $zd1); - } elseif ($this->atacks[$id]['uid2'] == $u->info['id']) { - $u->info['priems_z'] = implode('|', $zd2); - } - // - // - $i = 1; - while ($i <= 6) { - if ($this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic' . $i] > 25) { - $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic' . $i] = 25; - } elseif ($this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic' . $i] <= 0) { - $this->users[$this->uids[$this->atacks[$id]['uid1']]]['tactic' . $i] = 0; - } - if ($this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic' . $i] > 25) { - $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic' . $i] = 25; - } elseif ($this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic' . $i] <= 0) { - $this->users[$this->uids[$this->atacks[$id]['uid2']]]['tactic' . $i] = 0; - } - $i++; - } - // - // - mysql_query('UPDATE `items_users` SET `btl_zd` = `btl_zd` - 1 WHERE (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '") AND `btl_zd` > 0 AND `inOdet` > 0 LIMIT 100'); - - mysql_query('UPDATE `users` SET `notrhod` = "-1" WHERE `id` = "' . $this->atacks[$id]['uid1'] . '" OR `id` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 2'); - - // - mysql_query('UPDATE `pirogi` SET `hod` = `hod` - 1 WHERE `btl` = "' . $this->info['id'] . '" AND (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '")'); - mysql_query('UPDATE `tactic` SET `hod` = `hod` - 1 WHERE `btl` = "' . $this->info['id'] . '" AND (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '")'); - - // - mysql_query('DELETE FROM `pirogi` WHERE `btl` = "' . $this->info['id'] . '" AND `hod` < 1'); - mysql_query('DELETE FROM `tactic` WHERE `btl` = "' . $this->info['id'] . '" AND `hod` < 1'); - - // - mysql_query('UPDATE `spells` SET `hod` = `hod` - 1 WHERE `btl` = "' . $this->info['id'] . '" AND (`uid` = "' . $this->atacks[$id]['uid1'] . '" OR `uid` = "' . $this->atacks[$id]['uid2'] . '")'); - mysql_query('DELETE FROM `spells` WHERE `btl` = "' . $this->info['id'] . '" AND `hod` < 1'); - - - // battle_users - mysql_query('UPDATE `battle_users` SET `hp` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['hpNow'] . '" - WHERE `battle` = "' . $this->info['id'] . '" AND `uid` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1'); - mysql_query('UPDATE `battle_users` SET `hp` = "' . $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['hpNow'] . '" - WHERE `battle` = "' . $this->info['id'] . '" AND `uid` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1'); - // 25% - - - 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) { - $this->save_stats($this->yhod_user($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], - $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod'])); - } - // - $this->save_stats($this->atacks[$id]['uid1']); - $this->save_stats($this->atacks[$id]['uid2']); - - $this->priemsRazmenMomentEnd($id, $at); - - // \ - $j = 1; - while ($j <= 2) { - $eff = $this->stats[$this->uids[$this->atacks[$id]['uid' . $j]]]['effects']; - $i = 0; - while ($i < count($eff)) { - if (isset($eff[$i])) { - if ($eff[$i]['timeUse'] == 77 && $eff[$i]['hod'] > -1) { - $eff[$i]['hod']--; - $eff[$i]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = ' . $eff[$i]['v2'])); - if (round($eff[$i]['priem']['minmana'] * $eff[$i]['x']) != 0) { - // - $priem->minMana($eff[$i]['user_use'], - round($eff[$i]['priem']['minmana'] * $eff[$i]['x'])); - if ($this->stats[$this->uids[$eff[$i]['user_use']]]['mpNow'] <= 0) { - $eff[$i]['hod'] = 0; - } - } - if (strripos($eff[$i]['data'], 'minprocmanahod')) { - $pvr = [ - 'x1' => 0, - 'x2' => 0, - 'd' => explode('|', $eff[$i]['data']), - 'i' => 0, - 'uid' => $eff[$i]['uid'], - 'color' => '', - 'color2' => '', - 'effx' => '', - 'x' => $eff[$i]['name'], - ]; - - while ($pvr['i'] < count($pvr['d'])) { - if (isset($pvr['d'][$pvr['i']])) { - $pvr['d1'] = explode('=', $pvr['d'][$pvr['i']]); - if ($pvr['d1'][0] == 'minprocmanahod') { - $pvr['d1'] = explode('x', $pvr['d1'][1]); - $pvr['x1'] = $pvr['d1'][0]; - $pvr['x2'] = $pvr['d1'][1]; - } - } - $pvr['i']++; - } - - $pvr['mp'] = round($this->stats[$this->uids[$pvr['uid']]]['mpAll'] / 100 * rand($pvr['x1'], - $pvr['x2'])); - $pvr['mpSee'] = 0; - $pvr['mpNow'] = floor($this->stats[$this->uids[$pvr['uid']]]['mpNow']); - $pvr['mpAll'] = $this->stats[$this->uids[$pvr['uid']]]['mpAll']; - $pvr['mpTr'] = $pvr['mpAll'] - $pvr['mpNow']; - - if ($pvr['mpTr'] > 0) { - // - if ($pvr['mpTr'] < $pvr['mp']) { - $pvr['mp'] = $pvr['mpTr']; - } - $pvr['mpSee'] = '+' . $pvr['mp']; - $pvr['mpNow'] += $pvr['mp']; - } - if ($pvr['mpNow'] > $pvr['mpAll']) { - $pvr['mpNow'] = $pvr['mpAll']; - } elseif ($pvr['mpNow'] < 0) { - $pvr['mpNow'] = 0; - } - if ($pvr['mpSee'] == 0) { - $pvr['mpSee'] = '--'; - } - - - $this->stats[$this->uids[$pvr['uid']]]['mpNow'] = $pvr['mpNow']; - $this->users[$this->uids[$pvr['uid']]]['mpNow'] = $pvr['mpNow']; - mysql_query('UPDATE `stats` SET `mpNow` = ' . $this->stats[$this->uids[$pvr['uid']]]['mpNow'] . ' WHERE `id` = ' . $pvr['uid']); - - $pvr['text'] = $this->addlt(1, 21, $this->users[$this->uids[$pvr['uid']]]['sex']); - $pvr['text2'] = '{tm1} ' . $pvr['text'] . ' ' . $pvr['mpSee'] . ' [' . $pvr['mpNow'] . '/' . $pvr['mpAll'] . '] ()'; - $this->priemAddLog($id, 1, 2, $pvr['uid'], 0, - '' . $pvr['x'] . '', - $pvr['text2'], - ($this->hodID) - ); - - unset($pvr); - } - - if (isset($this->rehodeff[$eff[$i]['id']])) { - $eff[$i]['hod'] = $this->rehodeff[$eff[$i]['id']]; - } - if ($eff[$i]['hod'] > 0) { - $this->stats[$this->uids[$this->atacks[$id]['uid' . $j]]]['effects']['hod'] = $eff[$i]['hod']; - mysql_query('UPDATE `eff_users` SET `hod` = "' . $eff[$i]['hod'] . '" WHERE `id` = "' . $eff[$i]['id'] . '" LIMIT 1'); - } else { - // - if ($eff[$i]['v2'] > 0) { - if ($j == 1) { - $jn = 2; - } else { - $jn = 1; - } - $this->delPriem($eff[$i], $this->users[$this->uids[$this->atacks[$id]['uid' . $j]]], - 3, $this->atacks[$id]['uid' . $jn]); - } - } - } elseif ($eff[$i]['timeUse'] == 77 && $eff[$i]['hod'] == -2) { - $eff[$i]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $eff[$i]['v2'] . '" LIMIT 1')); - $priem->hodUsePriem($eff[$i], $eff[$i]['priem']); - } else { - $eff[$i]['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $eff[$i]['v2'] . '" LIMIT 1')); - if (isset($eff[$i]['priem']['minmana']) && round($eff[$i]['priem']['minmana'] * $eff[$i]['x']) != 0) { - // - $priem->minMana($eff[$i]['user_use'], - round($eff[$i]['priem']['minmana'] * $eff[$i]['x'])); - if ($this->stats[$this->uids[$eff[$i]['user_use']]]['mpNow'] <= 0) { - $eff[$i]['hod'] = 0; - if (isset($this->rehodeff[$eff[$i]['id']])) { - $eff[$i]['hod'] = $this->rehodeff[$eff[$i]['id']]; - } - if ($eff[$i]['v2'] > 0) { - if ($j == 1) { - $jn = 2; - } else { - $jn = 1; - } - $this->delPriem($eff[$i], - $this->users[$this->uids[$this->atacks[$id]['uid' . $j]]], 3, - $this->atacks[$id]['uid' . $jn]); - } - } - } elseif ($eff[$i]['timeUse'] > 100 && $eff[$i]['hod'] > -1 && $c['effz'] > 0) { - $eff[$i]['hod']--; - if (isset($this->rehodeff[$eff[$i]['id']])) { - $eff[$i]['hod'] = $this->rehodeff[$eff[$i]['id']]; - } - if ($eff[$i]['hod'] > 0) { - $this->stats[$this->uids[$this->atacks[$id]['uid' . $j]]]['effects']['hod'] = $eff[$i]['hod']; - mysql_query('UPDATE `eff_users` SET `hod` = "' . $eff[$i]['hod'] . '" WHERE `id` = "' . $eff[$i]['id'] . '" LIMIT 1'); - } else { - // - if ($eff[$i]['v2'] > 0) { - if ($j == 1) { - $jn = 2; - } else { - $jn = 1; - } - $this->delPriem($eff[$i], - $this->users[$this->uids[$this->atacks[$id]['uid' . $j]]], 3, - $this->atacks[$id]['uid' . $jn]); - } - } - } - } - } - $i++; - } - $j++; - } - // - // - // - if ($c['propsk_die'] > 0 && $this->info['razdel'] == 0 && $this->info['dn_id'] == 0 && $this->info['izlom'] == 0) { - $cn1 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `battle_out` WHERE `battle` = "' . $this->info['id'] . '" AND `uid1` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1')); - $cn2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `battle_out` WHERE `battle` = "' . $this->info['id'] . '" AND `uid1` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1')); - if ($cn1[0] > 3) { - // - $pvr['text2'] = '{tm1} {u1} - .'; - $this->priemAddLog($id, 1, 2, $this->atacks[$id]['uid1'], 0, '', - $pvr['text2'], - ($this->hodID) - ); - unset($pvr); - mysql_query('UPDATE `stats` SET `hpNow` = 0 WHERE `id` = "' . $this->atacks[$id]['uid1'] . '" LIMIT 1'); - } - if ($cn2[0] > $c['propsk_die']) { - $pvr['text2'] = '{tm1} {u1} - .'; - $this->priemAddLog($id, 1, 2, $this->atacks[$id]['uid2'], 0, '', - $pvr['text2'], - ($this->hodID) - ); - unset($pvr); - mysql_query('UPDATE `stats` SET `hpNow` = 0 WHERE `id` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1'); - } - } - // - // - if ($u->info['id'] == $this->atacks[$id]['uid1']) { - $u->info['enemy'] = $this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy']; - } - if ($u->info['id'] == $this->atacks[$id]['uid2']) { - $u->info['enemy'] = $this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy']; - } - // // - 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'] . '" )'); - - 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); - // - - unset($old_s1, $old_s2); - // - } - - // - private function save_stats($uid) - { - mysql_query('UPDATE `stats` SET - `hpNow` = ' . $this->stats[$this->uids[$uid]]['hpNow'] . ', - `mpNow` = ' . $this->stats[$this->uids[$uid]]['mpNow'] . ', - `tactic1` = ' . $this->users[$this->uids[$uid]]['tactic1'] . ', - `tactic2` = ' . $this->users[$this->uids[$uid]]['tactic2'] . ', - `tactic3` = ' . $this->users[$this->uids[$uid]]['tactic3'] . ', - `tactic4` = ' . $this->users[$this->uids[$uid]]['tactic4'] . ', - `tactic5` = ' . $this->users[$this->uids[$uid]]['tactic5'] . ', - `tactic6` = ' . $this->users[$this->uids[$uid]]['tactic6'] . ', - `tactic7` = ' . $this->users[$this->uids[$uid]]['tactic7'] . ', - `enemy` = ' . $this->users[$this->uids[$uid]]['enemy'] . ', - `battle_yron` = ' . $this->users[$this->uids[$uid]]['battle_yron'] . ', - `last_hp` = ' . $this->users[$this->uids[$uid]]['last_hp'] . ', - `battle_exp` = ' . $this->users[$this->uids[$uid]]['battle_exp'] . ', - `priems_z` = ' . $this->users[$this->uids[$uid]]['priems_z'] . ' - WHERE `id` = ' . $uid); - } - - // - public function lookLog() - { - global $u; - $hodID = mysql_fetch_array(mysql_query('SELECT `id_hod` FROM `battle_logs` WHERE `battle` = ' . $this->info['id'] . ' ORDER BY `time`')); - if ($hodID['id_hod'] <= 1) { - $u->info['alog'] = 0; - } - - if ($_POST['idlog'] < 1) { - $_POST['idlog'] = 0; - } - $talog = mysql_fetch_array(mysql_query('SELECT `alog` FROM `stats` WHERE `id` = ' . $u->info['id'])); - $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_hod` >= ' . $talog['alog'] . ' ORDER BY `id` DESC'); - if (isset($sp) && $this->info['team_win'] != -1) { - $sp = mysql_query('SELECT - `id`,`type`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zona2`,`zonb1`,`zonb2` - FROM `battle_logs_save` - WHERE `battle` = ' . $this->info['id'] . ' AND `id_hod` >= ' . $talog['alog'] . ' ORDER BY `id` DESC'); - } - $jin = 0; - $forYou2 = 0; - $js = ''; - $pll = 0; - if ($_POST['idlog'] < 1) { - $_POST['idlog'] = 0; - } - $talog = mysql_fetch_array(mysql_query('SELECT `alog` FROM `stats` WHERE `id` = ' . $u->info['id'])); - $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_hod` >= ' . $talog['alog'] . ' ORDER BY `id` DESC'); - if (isset($sp) && $this->info['team_win'] != -1) { - $sp = mysql_query('SELECT - `id`,`type`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zona2`,`zonb1`,`zonb2` - FROM `battle_logs_save` - WHERE `battle` = ' . $this->info['id'] . ' AND `id_hod` >= ' . $talog['alog'] . ' ORDER BY `id` DESC'); - } - $jin = 0; - $forYou2 = 0; - while ($pl = mysql_fetch_array($sp)) { - if ($jin == 0) { - $u->info['alog'] = $pl['id_hod']; - } - $jin++; - - $rt = $pl['text']; - $pl['vars'] = str_replace('^^^^', 'rvnO', $pl['vars']); - $rt = str_replace('{tm1}', '' . date('H:i', $pl['time']) . '', $rt); - $rt = str_replace('{tm2}', '' . date('H:i', $pl['time']) . '', $rt); - $rt = str_replace('{tm3}', - '' . date('d.m.Y H:i', $pl['time']) . '', $rt); - $rt = str_replace('{tm4}', - '' . date('d.m.Y H:i', $pl['time']) . '', $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('"', - '"', $pl['vars']) . '");' . $js; - } - mysql_query('UPDATE `stats` SET `alog`=' . $u->info['alog'] . ' WHERE `id` =' . $u->info['id']); - $js .= 'id_log=' . $pll . ';'; - - return $js; - } - -// - public function lookmLog() - { - $u = user::start(); - $js = ''; - $pll = 0; - - if ($this->info['type'] != 9) { - $hodID = mysql_fetch_array(mysql_query('SELECT `id`,`id_hod` FROM `battle_logs` WHERE `battle` = "' . $this->info['id'] . '" ORDER BY `time` LIMIT 1')); - if ($hodID['id_hod'] <= 1) { - $u->info['mlog'] = 0; - } - if (isset($hodID['id']) && $this->info['team_win'] != -1) { - $hodID = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_logs_save` WHERE `battle` = "' . $this->info['id'] . '" ORDER BY `time` LIMIT 1')); - } - if (isset($hodID['id'])) { - $hodID = $hodID['id']; - } else { - $hodID = 0; - } - $tmlog = mysql_fetch_array(mysql_query('SELECT `mlog` FROM `stats` WHERE `id` = "' . $u->info['id'] . '" LIMIT 1')); - $spm = 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_hod` >= ' . $tmlog['mlog'] . ' AND `vars` LIKE "%' . $u->info['login'] . '%" ORDER BY `id` DESC'); - - if (isset($spm) && $this->info['team_win'] != -1) { - $spm = mysql_query('SELECT - `id`,`type`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zona2`,`zonb1`,`zonb2` - FROM `battle_logs_save` - WHERE `battle` = "' . $this->info['id'] . '" AND `id_hod` >= ' . $tmlog['mlog'] . ' AND `vars` LIKE "%' . $u->info['login'] . '%" ORDER BY `id` DESC'); - } - - $jin = 0; - $forYou2 = 0; - - while ($plm = mysql_fetch_array($spm)) { - if ($jin == 0) { - $u->info['mlog'] = $plm['id_hod']; - } - $jin++; - $rt = $plm['text']; - $plm['vars'] = str_replace('^^^^', 'rvnO', $plm['vars']); - $rt = str_replace('{tm1}', '' . date('H:i', $plm['time']) . '', $rt); - $rt = str_replace('{tm2}', '' . date('H:i', $plm['time']) . '', $rt); - $rt = str_replace('{tm3}', '' . date('d.m.Y H:i', $plm['time']) . '', - $rt); - $rt = str_replace('{tm4}', '' . date('d.m.Y H:i', $plm['time']) . '', - $rt); - $plm['text'] = $rt; - unset($rt); - if ($pll < $plm['id']) { - $pll = $plm['id']; - } - $js = 'add_mlog(' . $plm['id'] . ',' . $forYou2 . ',"' . $plm['text'] . '",' . $plm['id_hod'] . ',0,0,"' . str_replace('"', - '"', $plm['vars']) . '");' . $js; - } - $js .= 'id_mlog=' . $pll . ';'; - mysql_query('UPDATE `stats` SET `mlog`=' . $u->info['mlog'] . ' WHERE `id` =' . $u->info['id']); - } - return $js; - } -//====================== - - // - public function add_log($mass) - { - if ($mass['time'] != '' && $mass['text'] != '') { - mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`type`) VALUES (' . $mass['time'] . ',' . $mass['battle'] . ',' . $mass['id_hod'] . ',' . $mass['text'] . ',' . $mass['vars'] . ',' . $mass['type'] . ')'); - if (rand(2, 10) == 10) { - $this->get_comment(); - } - } - } - - /// - private function get_comment() - { - $boycom = [ - ' .', - ' , ?', - ' ?', - ', -, ? ! !', - ' .', - ' . ', - ' ...', - ' ...', - ' ?', - ' , !?', - ' ?', - ' -, :', - ' - ?', - ' , ', - ' ?!', - ' . ?', - ' ...', - ' !', - ' !', - ' , !', - ' .', - ' 5 , , 20- ...', - '. .', - ' , - ?', - ' , ?', - ' ... : ...', - ' , ?', - ' , ', - ' . ... , , ', - ' !', - ' ? , .', - ' ! !', - ' !', - ', , ` ` ', - ' ?!', - ' ! .', - ' . ? .', - ' !', - ', ... !.. , .', - ' , !', - ' -, ...', - ' - , :)', - ' .', - ' - !!!', - '! ! ! !', - ' !', - ' ? . , .', - ' . .', - ' ...', - ' ...', - ' !!!', - '!? ?!', - ' ?', - ', ...', - ' .', - ' !', - ' , - .', - ', , , .', - ' !', - ', - ???', - ' , .', - ' ? !', - ', !', - ' , ...', - ' . !', - '! ! ... , .', - ', , ?', - ', !', - ' !', - ' , ... , ... ?!', - ' ?', - ' . .', - ', ..? . , .', - '... .', - '!!!.... ...', - '! .', - '! , !', - ' ???', - ' ... - .', - ', ...', - ' !', - '-, - .', - ' , .', - ' , ?', - ' - .', - ', .', - ' !', - ' , .', - ' ... , !', - ' ...', - ' !', - ' !', - ' ', - ' , .', - ' , .', - ' - .', - ' !', - ' ', - ' ...', - ' , !', - '!! , ...', - ' ! .', - ', !', - ', , ?', - ', , .', - ' !', - ' !', - '-!', - ' ?! !', - ' , ', - ' - ...', - ' , ! !', - ' , .', - ' ', - ' `` ?', - ' - ...', - ' , - .', - ' . :)', - ' , , , . ? - ?!', - ' , ...', - '( ) ... !', - '< > < > < > < >', - '< > ', - ]; - if (rand(1, 12) !== 12) { - return; - } - shuffle($boycom); - $this->add_log([ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => '{tm1} : ' . current($boycom) . '', - 'vars' => 'time1=' . time(), - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]); - } - - // - public function weaponTx($item) - { - if (!isset($item['id'])) { - $i = 1; - while ($i <= 4) { - $itm['tya' . $i] = 1; - $i++; - } - } - $itm = $this->lookStats($item['data']); - $t[0]['z'] = 0; - $t[0]['t'] = 0; - // - $t[1]['z'] = round(0 + $itm['tya1']); - $t[1]['t'] = 1; - // - $t[2]['z'] = round(0 + $itm['tya2']); - $t[2]['t'] = 2; - // - $t[3]['z'] = round(0 + $itm['tya3']); - $t[3]['t'] = 3; - // - $t[4]['z'] = round(0 + $itm['tya4']); - $t[4]['t'] = 4; - // - $t[5]['z'] = round(0 + $itm['tym1']); - $t[5]['t'] = 5; - // - $t[6]['z'] = round(0 + $itm['tym2']); - $t[6]['t'] = 6; - // - $t[7]['z'] = round(0 + $itm['tym3']); - $t[7]['t'] = 7; - // - $t[8]['z'] = round(0 + $itm['tym4']); - $t[8]['t'] = 8; - // - $t[9]['z'] = round(0 + $itm['tym5']); - $t[9]['t'] = 9; - // - $t[10]['z'] = round(0 + $itm['tym6']); - $t[10]['t'] = 10; - // - $t[11]['z'] = round(0 + $itm['tym7']); - $t[11]['t'] = 11; - - - $tpt = $t[0]['z']; - $tpmin = $t[0]; - $tpmax = $t[0]; - $i = 1; - - while ($i <= 11) { - if ($t[$i]['z'] > $tpt) { - $tpt = $t[$i]['z']; - $tpmax = $t[$i]; - $ii = $i; - } - $i++; - } - $t[$ii]['z'] = 0; - - $tpt = $t[0]['z']; - $i = 1; - while ($i <= 11) { - if ($t[$i]['z'] > $tpt) { - $tpt = $t[$i]['z']; - $tpmin = $t[$i]; - } - $i++; - } - - $setclass = rand(1, 100); - - if ($setclass > $tpmax['z']) { - $tp = $tpmin['t']; - } else { - $tp = $tpmax['t']; - } - - return $tp; - } - - // - public function weaponAt22($item, $st = 0) - { - if (empty($item['data'])) { - return []; - } - $itm = $this->lookStats($item['data']); - // - $min = $itm['sv_yron_min'] + $itm['yron_min'] + $st['minAtack']; - $max = $itm['sv_yron_max'] + $itm['yron_max'] + $st['maxAtack']; - - return [$min, $max]; - } - - // - // - private function zago($v) - { - return round((1 - (pow(0.5, (max($v, 1700) / 399.51)))) * 100, 2); - } - - // () - public function zmgo($v) - { - return (1 - (pow(0.5, ($v / 250)))) * 100; - } - - - /** - * @param $st1 - * @param $st2 - * @param $u1 - * @param $u2 - * @param $level - * @param $level2 [not used?] - * @param $type - * @param $min_yron - * @param $max_yron - * @param $min_bron [not used?] - * @param $max_bron [not used?] - * @param $vladenie - * @param $power_yron - * @param $power_krit - * @param $zashita - * @param $ozashita [not used?] - * @param $proboi - * @param $weapom_damage [not used?] - * @param $weapom_min - * @param $weapom_max - * @param $za_proc [not used?] - * @param $zm_proc [not used?] - * @param $zashitam [not used?] - * @param $ozashitam [not used?] - * @param $wp_type - * @param $witm - * @return array - */ - public function yrn( - $st1, - $st2, - $u1, - $u2, - $level, - $level2 = null, - $type, - $min_yron, - $max_yron, - $min_bron = null, - $max_bron = null, - $vladenie, - $power_yron, - $power_krit, - $zashita, - $ozashita = null, - $proboi, - $weapom_damage = null, - $weapom_min, - $weapom_max, - $za_proc = null, - $zm_proc = null, - $zashitam = null, // pzm ! - $ozashitam = null, - $wp_type, - $witm - ) { - global $u; - - // - if ($zashita < 1) { - $zashita = 1; - } - - if ($min_yron < 1) { - $min_yron = 1; - } - - if ($max_yron < 1) { - $max_yron = 1; - } - - if (!isset($type) || $type == '') { - $type = 12; - } - - // - $p = [ - 'Y' => 0, - 'B' => [0 => 0, 1 => 0, 'rnd' => false], - 'L' => $level, - 'W' => [$weapom_min, $weapom_max, 'rnd' => false], // // - 'U' => $vladenie, // - 'M' => $power_yron, // - 'K' => $power_krit, // - 'S' => 0, // . - 'T' => 1, //. - 'iT' => 1, // . . - /* - (S) - - : S = * 0,3 + * 0,7 - : S = * 0,5 + * 0,25 + * 0,25 - : S = * 1 - : S = * 0,3 + * 0,7 - */ - ]; - - // 1.33 1.00 - - $witmdata = $this->lookStats($witm['data']); - - // - - if ($wp_type == 18) { - $r['type'] = 1; - } elseif ($wp_type == 19) { - $r['type'] = 2; - } elseif ($wp_type == 20) { - $r['type'] = 3; - } elseif ($wp_type == 21) { - $r['type'] = 4; - } else { - $r['type'] = 0; - } - // - // - if ($r['type'] == 1) { - $p['S'] = $st1['s1'] * 0.25 + $st1['s2'] * 0.75; - $p['U'] = $st1['a1'] * 1.00; // - // - } elseif ($r['type'] == 2) { - $p['S'] = $st1['s1'] * 1.20; - $p['U'] = $st1['a2'] * 1.00; // - // - } elseif ($r['type'] == 3) { - $p['S'] = $st1['s1'] * 0.5 + $st1['s4'] * 1.00; - $p['U'] = $st1['a3'] * 1.00; // - // - } elseif ($r['type'] == 4) { - $p['S'] = $st1['s3'] * 1.00; - $p['U'] = $st1['a4'] * 1.00; // - // - } elseif ($r['type'] >= 5 && $r['type'] < 12) { - $p['S'] = $st1['s1'] * 0.5 + $st1['s2'] * 0.5; - $p['U'] = $st1['mg' . ($r['type'] - 4)] * 1.00; // - $p['Mage'] = true; - } else { - $p['S'] = 0; - $p['U'] = 0; // ( - } - - $r['bron']['rnd'] = rand($r['bron'][0], $r['bron'][1]); - - // () - $p['B'][0] = 2 + $level + $st1['s1'] - round($st1['s1'] / 5); - $p['B'][1] = $p['B'][0] + 3; - - $p['B']['rnd'] = rand($p['B'][0], $p['B'][1]); - $p['W']['rnd'] = rand($p['W'][0], $p['W'][1]); - - // - if ($r['type'] == 12) { - $r['min'] = ($p['B'][0] + $weapom_min) * $p['T'] * (1 + $p['M'] / 100); - $r['max'] = ($p['B'][1] + $weapom_max) * $p['T'] * (1 + $p['M'] / 100); - } 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['bRND'] = $p['B']['rnd']; - - $r['Kmin'] = ceil((2 + ($p['K'] / 100)) * $r['min']); - $r['Kmax'] = ceil((2 + ($p['K'] / 100)) * $r['max']); - - // - // - 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['Kmin'] -= $r['bron']['rnd'] * 2; // 2 - $r['Kmax'] -= $r['bron']['rnd'] * 2; // 2 - - $r['min'] -= $r['bron']['rnd']; // . - $r['max'] -= $r['bron']['rnd']; // . - - } - - // ( 80%) - if ($r['type'] < 5 || $r['type'] == 12) { - $r['min'] = round($r['min'] / 100 * (100 - $this->zago($st2['za']))); - $r['max'] = round($r['max'] / 100 * (100 - $this->zago($st2['za']))); - $r['Kmin'] = round($r['Kmin'] / 100 * (100 - $this->zago($st2['za']))); - $r['Kmax'] = round($r['Kmax'] / 100 * (100 - $this->zago($st2['za']))); - } else { - $r['min'] = round($r['min'] / 100 * (100 - $this->zmgo($st2['zm']))); - $r['max'] = round($r['max'] / 100 * (100 - $this->zmgo($st2['zm']))); - $r['Kmin'] = round($r['Kmin'] / 100 * (100 - $this->zmgo($st2['zm']))); - $r['Kmax'] = round($r['Kmax'] / 100 * (100 - $this->zmgo($st2['zm']))); - } - - $r['min'] = round($r['min']); - $r['max'] = round($r['max']); - $r['Kmin'] = round($r['Kmin']); - $r['Kmax'] = round($r['Kmax']); - - $min_yrn = 0; //% - - if ($u1['clone'] > 0) { - $min_yrn = 75; - } - - $r['min'] -= floor($r['min'] / 100 * $min_yrn); - $r['max'] -= floor($r['max'] / 100 * $min_yrn); - $r['Kmin'] -= floor($r['Kmin'] / 100 * ($min_yrn)); - $r['Kmax'] -= floor($r['Kmax'] / 100 * ($min_yrn)); - $r['min_'] -= floor($r['min_'] / 100 * $min_yrn); - $r['max_'] -= floor($r['max_'] / 100 * $min_yrn); - $r['Kmin_'] -= floor($r['Kmin_'] / 100 * ($min_yrn)); - $r['Kmax_'] -= floor($r['Kmax_'] / 100 * ($min_yrn)); - - $defd = mysql_fetch_array(mysql_query('SELECT SUM(`vals`) FROM `battle_actions` WHERE `btl` = ' . $this->info['id'] . ' AND `vars` = "use_defteam' . $u2['team'] . '" LIMIT 1')); - if ($defd[0] > 100) { - $defd[0] = 100; - } - $defd = 0 + $defd[0]; - $powd = mysql_fetch_array(mysql_query('SELECT SUM(`vals`) FROM `battle_actions` WHERE `btl` = ' . $this->info['id'] . ' AND `vars` = "use_powteam' . $u1['team'] . '" LIMIT 1')); - if ($powd[0] > 100) { - $powd[0] = 100; - } - $powd = 0 + $powd[0]; - $defd = $defd - $powd; - - $r['min'] -= floor($defd); - $r['max'] -= floor($defd); - $r['Kmin'] -= floor($defd * 2); - $r['Kmax'] -= floor($defd * 2); - $r['min_'] -= floor($defd); - $r['max_'] -= floor($defd); - $r['Kmin_'] -= floor($defd * 2); - $r['Kmax_'] -= floor($defd * 2); - - $r['min'] += $st1['maxAtack']; - $r['max'] += $st1['maxAtack']; - $r['Kmin'] += $st1['maxAtack'] * 2; - $r['Kmin'] += $st1['maxAtack'] * 2; - - if ($r['min'] < 1) { - $r['min'] = 1; - } - if ($r['max'] < 1) { - $r['max'] = 1; - } - if ($r['Kmin'] < 2) { - $r['Kmin'] = 2; - } - if ($r['Kmax'] < 2) { - $r['Kmax'] = 2; - } - if ($r['Kmin_'] < 2) { - $r['Kmin_'] = 2; - } - if ($r['Kmin_'] < 2) { - $r['Kmax_'] = 2; - } - - $r['m_k'] = $r['Kmax']; - - return $r; - } - - // - // pl - // u1 - // t1 - // 99 = - // u2 - //$this->delPriem($pd[$k2][1][$k],${'p'.$k2},1,${'p'.$k2jn}); - public $del_val = []; - - public function delPriem( - $pl, - $u1, - $t = 1, - $u2 = false, - $rznm = ' ' - ) { - global $u; - if (isset($pl['priem']['id']) && !isset($this->del_val['eff'][$pl['priem']['id']])) { - if ($pl['x'] > 1) { - $pl['name'] = $pl['name'] . ' x' . $pl['x']; - } - if ($pl['timeUse'] == 77) { - // - mysql_query('DELETE FROM `eff_users` WHERE `id` = ' . $pl['id']); - } - $vLog = 'time1=' . time() . '||s1=' . $u1['sex'] . '||t1=' . $u1['team'] . '||login1=' . $u1['login']; - if (isset($u2['id'])) { - $vLog .= '||s2=' . $u2['sex'] . '||t2=' . $u2['team'] . '||login2=' . $u2['login']; - } - $mas1 = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'text' => '', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - if ($t == 4) { - $mas1['id_hod']++; - $t = 2; - } - if ($t == 1) { - $mas1['id_hod']++; - if ($pl['priem']['file'] != '0') { - if (file_exists('../../_incl_data/class/priems/' . $pl['priem']['file'] . '.php')) { - require('priems/' . $pl['priem']['file'] . '.php'); - } - } elseif ($pl['priem']['file3'] != '0') { - if (file_exists('../../_incl_data/class/priems/' . $pl['priem']['file3'] . '.php')) { - require('priems/' . $pl['priem']['file3'] . '.php'); - } - } else { - $mas1['text'] = '{tm1} {u1} {1x16x0} "' . $pl['name'] . '".'; - $this->del_val['eff'][$pl['priem']['id']] = true; - } - } elseif ($t == 2) { - $mas1['text'] = '{tm1} {u1} "' . $pl['name'] . '".'; - } elseif ($t == 99) { - $mas1['text'] = '{u1} "' . $pl['name'] . '" ' . $rznm . ' .'; - } else { - if ($t == 100) { - $mas1['id_hod']++; - } - $mas1['text'] = '{tm1} "' . $pl['name'] . '" {u1}.'; - } - if ($pl['priem']['id'] != 24) { - $this->add_log($mas1); - } - $this->stats[$this->uids[$pl['uid']]] = $u->getStats($pl['uid'], 0, 0, false, false, true); - } - } - - // - public function lookStats($m) - { - return json_decode(str_replace(['=', '|'], ['":', ',"'], '{"' . $m . '}'), true); - } - - // - - /** - * @param $type - * @param $mf - * @param $lvl1 [not used?] - * @param $lvl2 [not used?] - * @return int - */ - private function mfs($type, $mf, $lvl1 = null, $lvl2 = null) - { - $rval = 0; - switch ($type) { - case 1: - - // - - if ($mf['amf'] < 0) { - $mf['amf'] = 0; - } - if ($mf['mf'] < 0) { - $mf['mf'] = 0; - } - if ($mf['mf'] > $mf['smf']) { - $rval = 100 - floor(((($mf['smf']) / ($mf['mf'] + 1)) * 100)); - } - - if ($rval < 1) { - $rval = 0; - } - if ($rval > 75) { - $rval = 75; - } - if ($mf['amf'] >= 1) { - if ($mf['amf'] > 100) { - $mf['amf'] = 100; - } - if (($mf['amf'] * 100) >= mt_rand(1, 10000)) { - $rval = 100; - } - } - - break; - case 2: - - if ($mf['mf'] < 0) { - $mf['mf'] = 0; - } - if ($mf['amf'] < 0) { - $mf['amf'] = 0; - } - if ($mf['smf'] < 0) { - $mf['smf'] = 0; - } - if ($mf['asmf'] < 0) { - $mf['asmf'] = 0; - } - - if ($mf['mf'] > $mf['smf']) { - $rval = 100 - floor(((($mf['smf']) / ($mf['mf'] + 1)) * 100)); //2.5 - } - if ($rval < 1) { - $rval = 0; - } - if ($rval > 75) { - $rval = 75; - } - if ($mf['asmf'] >= 0) // - { - if ($mf['asmf'] > 100) { - $mf['asmf'] = 100; - } - if ($mf['asmf'] >= rand(1, 100)) { - $rval = 0; - } - } - if ($mf['amf'] >= 0) { - if ($mf['amf'] > 100) { - $mf['amf'] = 100; - } - if ($mf['amf'] >= rand(1, 100)) { - $rval = 100; - } - } - break; - case 3: - if ($mf[1] < 1) { - $mf[1] = 1; - } - if ($mf[2] < 1) { - $mf[2] = 1; - } - - // - $rval = $mf[1] - $mf[2] / 2; - if ($rval > 75) { - $rval = 75; - } - if ($rval < 1) { - $rval = 1; - } - - break; - case 4: - $mf = round($mf * 0.6); - if ($mf < 1) { - $mf = 0; - } - if ($mf > 100) { - $mf = 100; - } - $rval = min($mf, 100); // - break; - case 5: - if ($mf < 1) { - $mf = 0; - } - $rval = min($mf, 85); // - break; - case 6: - // - //$mf['a'] - //$mf['b'] - if ($mf['a'] > 0) { - if ($mf['b'] > 0) { - $rval = round($mf['a'] - ($mf['b'] / 2)); - } else { - $rval = $mf['a']; - } - } - - if ($rval < 1) { - $rval = 0; - } - if ($rval > 75) { - $rval = 75; - } - - break; - } - - return $this->get_chanse($rval) ? 1 : 0; - } - - public function get_chanse($percent) - { - if ($percent <= 0) { - return false; - } - return mt_rand(1, 100) <= max($percent, 100); - } - - // - public function smena($uid, $auto = false, $lastdie = false) - { - global $u; - if (($auto || $u->info['smena'] <= 0) && !$auto) { - 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) { - return ' !'; - } - if (ceil($this->stats[$this->uids[$uid]]['hpNow']) < 1) { - return ' , '; - }// - if (!$auto) { - $u->info['smena']--; - } - mysql_query('UPDATE `stats` SET `enemy` = ' . $uid . ',`smena` = ' . $u->info['smena'] . ' WHERE `id` = ' . $u->info['id']); - $u->info['enemy'] = $uid; - $this->users[$this->uids[$uid]]['smena'] = $u->info['smena']; - $this->users[$this->uids[$u->info['id']]]['enemy'] = $uid; - return 1; - } - - //- // - public function autoSmena() - { - global $u; - $ms = []; - $ms_all = []; - $ms_ansf = []; - $i = 0; - $j = 0; - $z = 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'] > 0 && -($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']; - } - if (isset($this->ga[$this->users[$i]['id']][$u->info['id']])) { - $ms_ansf[$z] = $this->users[$i]['id']; - $z++; - } - } - $i++; - } - $msh = []; - if ($j == 0 && $z == 0) { - $enemydie = 0; - - if (isset($this->stats[$this->uids[$u->info['enemy']]])) { - $u->info['enemy'] = 0; - $enemydie = 1; - } - - if ((!isset($this->uids[(-($u->info['enemy']))]) || $this->stats[$this->uids[(-($u->info['enemy']))]]['hpNow'] < 1) && ($u->info['enemy'] < 0 || $enemydie == 1)) { - $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']) { - $ms[$j] = $this->users[$i]['id']; - $msh[$ms[$j]] = true; - $j++; - } - $i++; - } - } - } - - $ms = $ms[rand(0, $j - 1)]; - $ms_ansf = $ms_ansf[rand(0, $z - 1)]; - if ($z > 0) { - $this->smena($ms_ansf, true); - } elseif ($j > 0) { - if (isset($msh[$ms])) { - $this->smena($ms, true, true); - } else { - $this->smena($ms, true); - } - } else { - if ($u->info['enemy'] < 0) { - $smnr5 = $this->smena(-($u->info['enemy']), true); - unset($smnr5); - } - } - } - - // () - private function botAtack($uid, $pl, $tp) - { - $test_atack = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_act` WHERE `battle` = "' . $this->info['id'] . '" AND (( - `uid1` = "' . $pl . '" AND `uid2` = "' . $uid . '" - ) OR ( - `uid2` = "' . $pl . '" AND `uid1` = "' . $uid . '" - )) LIMIT 1')); - - if ($tp == 1 && !isset($test_atack['id'])) { - $test_uid = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "' . $uid . '" AND `hpNow` >= 1 LIMIT 1')); - $test_pl = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "' . $pl . '" AND `hpNow` >= 1 LIMIT 1')); - if (isset($test_uid['id']) && isset($test_pl['id']) && $test_uid['id'] != $test_pl['id']) { - $a = rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - $b = rand(1, 5); - mysql_query('INSERT INTO `battle_act` (`battle`,`time`,`uid1`,`uid2`,`a1`,`b1`) VALUES ("' . $this->info['id'] . '","' . time() . '","' . $pl . '","' . $uid . '","' . $a . '","' . $b . '")'); - } - } elseif ($tp == 2) { - // - $test_uid = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "' . $uid . '" AND `hpNow` >= 1 LIMIT 1')); - $test_pl = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "' . $pl['uid2'] . '" AND `hpNow` >= 1 LIMIT 1')); - if (isset($test_uid['id']) && isset($test_pl['id']) && $test_uid['id'] != $test_pl['id']) { - $bot = $this->users[$this->uids[$pl['uid2']]]; - $na = ['id' => 0, 'a' => [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0], 'b' => 0]; - $a222 = rand(1, 5) . '_' . rand(1, 5) . '_' . rand(1, 5) . '_' . rand(1, 5) . '_' . rand(1, 5); - $a = explode('_', $a222); - $i = 1; - $na['id'] = time(); - while ($i <= 5) { - if (isset($a[$i - 1])) { - $a[$i - 1] = intval(round($a[$i - 1])); - if ($a[$i - 1] >= 1 && $a[$i - 1] <= 5) { - $na['a'][$i] = $a[$i - 1]; - } else { - $na['a'][$i] = 0; - } - } - $i++; - } - $na['b'] = rand(1, 5); - // - - $this->atacks[$pl['id']]['a2'] = $a222; - $this->atacks[$pl['id']]['b2'] = $na['b']; - $this->startAtack($pl['id']); - } - } - //unset($test_uid,$test_pl,$test_atack); - } - - // , , , - public function testActions() - { - // - $m = mysql_query('SELECT * FROM `battle_act` WHERE `battle` = "' . $this->info['id'] . '" ORDER BY `id`'); - $i = 0; - $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; - $this->ga[$pl['uid1']][$pl['uid2']] = $pl['id']; - $this->ag[$pl['uid2']][$pl['uid1']] = $pl['id']; - if (isset($this->iBots[$pl['uid1']])) { - // - $botA[$pl['uid1']] = $pl['id']; - } elseif (isset($this->iBots[$pl['uid2']])) { - // - $botR[$pl['uid2']] = $pl['id']; - if ($this->users[$this->uids[$pl['uid2']]]['timeGo'] < time()) { - $this->botAtack($pl['uid1'], $pl, 2); - } - } - } else { - // - $pl['time'] = time(); - if ($pl['a1'] == 0 && $pl['a2'] == 0) { - // 1 - $pl['out1'] = time(); - $pl['tout1'] = 1; - // 2 - $pl['out2'] = time(); - $pl['tout2'] = 1; - } elseif ($pl['a1'] == 0) { - // 1 - $pl['out1'] = time(); - $pl['tout1'] = 1; - } elseif ($pl['a2'] == 0) { - // 2 - $pl['out2'] = time(); - $pl['tout2'] = 1; - } - // - $this->atacks[$pl['id']] = $pl; - $this->startAtack($pl['id']); - mysql_query('DELETE FROM `battle_act` WHERE `id` = ' . $pl['id']); - } - } - } - // - if ($this->uAtc['id'] > 0 && $this->na == 1) { - if ($pl['out1'] == 0 && $pl['out2'] == 0) { - // - if ($pl['uid1'] == $u->info['id'] || $pl['uid2'] == $u->info['id']) { - $this->addNewAtack(); - } - } else { - $this->addNewAtack(); - } - } - // - - // - - //, - while ($i < count($this->bots)) { - $bot = $this->bots[$i]; - if (isset($bot) && $this->stats[$this->uids[$bot]]['hpNow'] >= 1 && $this->stats[$this->uids[$bot]]['pass'] != 'saintlucia') // saintlucia - { - $j = 0; - while ($j < count($this->users)) { - if ($this->info['razdel'] == 0) { - $tnbot = time() + rand(1, 1); - } else { - $tnbot = time() + rand(1, 2); - } - if ($this->users[$j]['hpNow'] >= 1 && $this->users[$this->uids[$bot]]['hpNow'] >= 1 && $this->users[$this->uids[$bot]]['team'] != $this->users[$j]['team']) { - if (isset($this->users[$j]) && $this->stats[$j]['hpNow'] >= 1 && $this->stats[$this->uids[$bot]]['hpNow'] >= 1 && !isset($this->ga[$bot][$this->users[$j]['id']]) && !isset($this->ag[$bot][$this->users[$j]['id']]) && $this->users[$j]['id'] != $bot && $this->users[$j]['team'] != $this->users[$this->uids[$bot]]['team']) { - if ($this->users[$j]['timeGo'] < time() && $this->users[$this->uids[$bot]]['timeGo'] < time()) { - $this->botAtack($this->users[$j]['id'], $bot, 1); - mysql_query('UPDATE `stats` SET `timeGo` = "' . $tnbot . '" WHERE `id` = "' . $this->users[$this->uids[$bot]]['id'] . '" LIMIT 1'); - } - } elseif (isset($this->users[$i]) && $this->users[$i]['bot'] > 0 && $this->stats[$i]['hpNow'] >= 1 && $this->stats[$this->uids[$bot]]['hpNow'] >= 1 && $this->users[$i]['id'] != $bot && $this->users[$i]['team'] != $this->users[$this->uids[$bot]]['team']) { - if ($this->users[$j]['timeGo'] < time() && $this->users[$this->uids[$bot]]['timeGo'] < time() && $this->botAct($bot)) { - if (!isset($this->ga[$bot][$this->users[$i]['id']]) && $this->users[$this->uids[$bot]]['timeGo'] < time() && !isset($this->ag[$bot][$this->users[$i]['id']])) { - $this->botAtack($this->users[$i]['id'], $bot, 1); - mysql_query('UPDATE `stats` SET `timeGo` = ' . $tnbot . ' WHERE `id` = ' . $this->users[$this->uids[$bot]]['id']); - } elseif (isset($this->ga[$bot][$this->users[$i]['id']]) && $this->users[$this->uids[$bot]]['timeGo'] < time()) { - $this->botAtack($bot, $this->users[$i]['id'], 1); - mysql_query('UPDATE `stats` SET `timeGo` = ' . $tnbot . ' WHERE `id` = ' . $this->users[$this->uids[$bot]]['id']); - } - } - } else { - // - // - if ($this->users[$j]['timeGo'] < time() && $this->users[$this->uids[$bot]]['timeGo'] < time() && $this->users[$j]['hpNow'] >= 1 && $this->users[$this->uids[$bot]]['hpNow'] >= 1) { - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a1'] = - rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5); - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['a2'] = - rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - $this->atacks[$this->ga[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a1'] = - rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b1'] = rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['a2'] = - rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5) . rand(1, 5); - $this->atacks[$this->ag[$bot][$this->users[$j]['id']]]['b2'] = rand(1, 5); - if (isset($this->ga[$bot][$this->users[$j]['id']]) && $this->users[$j]['bot'] > 0) { - if ($this->users[$j]['timeGo'] < time() && $this->users[$this->uids[$bot]]['timeGo'] < time()) { - $tnbot = time() + rand(3, 7); - if ($this->info['type'] == 329) { // - $tnbot = time() - 1; - } - $this->startAtack($this->ga[$bot][$this->users[$j]['id']]); - $this->users[$this->uids[$bot]]['timeGo'] = $tnbot; - mysql_query('UPDATE `stats` SET `timeGo` = ' . $tnbot . ' WHERE `id` = ' . $this->users[$this->uids[$bot]]['id']); - } - } elseif (isset($this->ag[$bot][$this->users[$j]['id']]) && $this->users[$j]['bot'] > 0) { - if ($this->users[$this->uids[$bot]]['timeGo'] < time() && $this->users[$j]['timeGo'] < time()) { - $this->startAtack($this->ag[$bot][$this->users[$j]['id']]); - $tnbot = time() + rand(3, 7); - if ($this->info['type'] == 329) { // - $tnbot = time() - 1; - } - $this->users[$this->uids[$bot]]['timeGo'] = $tnbot; - mysql_query('UPDATE `stats` SET `timeGo` = ' . $tnbot . ' WHERE `id` = ' . $this->users[$this->uids[$bot]]['id']); - } - } - } - } - } - $j++; - } - } - $i++; - } - } - - // - private function botAct($uid) - { - if ($this->users[$this->uids[$uid]]['bot'] > 0) { - if ($this->users[$this->uids[$uid]]['online'] < time() - 3) { - $this->users[$this->uids[$uid]]['online'] = time(); - mysql_query('UPDATE `users` SET `online` = unix_timestamp() WHERE `id` = ' . (int)$uid); - return true; - } elseif (rand(0, 2) == 1) { - return true; - } - } - return false; - } - - // - public function battleInfo($id) - { - $b = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . (int)$id)); - if (isset($b['id'])) { - $this->hodID = mysql_fetch_array(mysql_query('SELECT `id_hod` FROM `battle_logs` WHERE `battle` = ' . $b['id'] . ' ORDER BY `id` DESC LIMIT 1')); - if (isset($this->hodID['id_hod'])) { - $this->hodID = $this->hodID['id_hod']; - } else { - $this->hodID = 0; - } - return $b; - } else { - return false; - } - } - - // - public function addAtack() - { - global $js; - if (isset($_POST['atack'], $_POST['block'])) { - $na = [ - 'id' => time(), - 'a' => [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0], - 'b' => intval(round($_POST['block'])), - ]; - - $a = explode('_', $_POST['atack']); - $i = 1; - - while ($i <= 5) { - if (isset($a[$i - 1])) { - $a[$i - 1] = intval(round($a[$i - 1])); - if ($a[$i - 1] >= 1 && $a[$i - 1] <= 5) { - $na['a'][$i] = $a[$i - 1]; - } else { - $na['a'][$i] = 0; - } - } - $i++; - } - - if ($na['b'] < 1 || $na['b'] > 5) { - $na['b'] = 0; - } - - $this->uAtc = $na; - $js .= 'testClearZone();'; - } else { - $this->e = ' '; - } - } - - // - public function teamsTake() - { - global $u; - $rs = ''; - $ts = []; - $tsi = 0; - if ($this->info['id'] > 0) { - // - $nxtlg = []; - $t = mysql_query('SELECT `u`.`room`,`u`.`no_ip`,`u`.`twink`,`u`.`stopexp`,`u`.`id`,`u`.`notrhod`,`u`.`login`,`u`.`login2`,`u`.`sex`,`u`.`online`,`u`.`admin`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`,`u`.`level`,`u`.`battle`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`animal`,`st`.`stats`,`st`.`hpNow`,`st`.`mpNow`,`st`.`exp`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`battle_text`,`st`.`upLevel`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`bot`,`st`.`lider`,`st`.`btl_cof`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`id`,`st`.`last_hp`,`st`.`last_pr`,`u`.`sex`,`u`.`money`,`u`.`bot_id`,`u`.`money3`,`u`.`money2` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle` = "' . $this->info['id'] . '"'); - $i = 0; - $bi = 0; - $up = ''; - if ($this->info['start2'] == 0) { - $tststrt = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = ' . $this->info['id'] . ' AND `start2` = 0 LIMIT 1')); - if (isset($tststrt['id'])) { - mysql_query('UPDATE `battle` SET `start2` = unix_timestamp() WHERE `id` = ' . $this->info['id'] . ' LIMIT 1'); - } else { - $this->info['start2'] = time(); - } - } - while ($pl = mysql_fetch_array($t)) { - // - if ($pl['login2'] == '') { - $pl['login2'] = $pl['login']; - } - $this->users[$i] = $pl; - $this->uids[$pl['id']] = $i; - - if ($this->info['start2'] == 0) { - mysql_query('UPDATE `users` SET `notrhod` = -1 WHERE `id` = ' . $this->users[$i]['id'] . ' LIMIT 1'); - $this->users[$i]['notrhod'] = -1; - } - - if ($pl['bot'] > 0) { - $this->bots[$bi] = $pl['id']; - $this->iBots[$pl['id']] = $bi; - $bi++; - } - // - $this->stats[$i] = $u->getStats($pl, 0, 0, false, $this->cached, true); - // - if ($this->info['start2'] == 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]['s7']) / $this->stats[$i]['hpAll'] * $this->stats[$i]['hpNow']); - } - - if ($this->stats[$i]['s7'] > 49) { - mysql_query('UPDATE `eff_users` SET `delete`= unix_timestamp() WHERE `uid` = ' . $this->users[$i]['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, '" . $this->stats[$i]['id'] . "', '', 'add_spasenie=1', 101, 77, 0, '" . $this->stats[$i]['id'] . "', 0, 'priem', 324, 'preservation.gif', 1, -1, '', 0, 0, '', 0, 0, 0, 1, 0); - "); - } - - - ##### - // animal_bonus - 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')); - if (isset($a['id']) && $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` = "' . $this->users[$i]['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,"' . $this->users[$i]['id'] . '","' . $tpa3[$a['type']] . ' [' . $a['level'] . ']","' . $anl . '","100","77","priem","' . $this->users[$i]['id'] . '")'); - - // - if ($a['type'] == 7) { - if ($a['level'] == 10) { - $this->users[$i]['tactic7'] = floor((50 + $this->stats[$i]['s7']) / $this->stats[$i]['hpAll'] * $this->stats[$i]['hpNow']); - } elseif ($a['level'] == 11) { - $this->users[$i]['tactic7'] = floor((65 + $this->stats[$i]['s7']) / $this->stats[$i]['hpAll'] * $this->stats[$i]['hpNow']); - } elseif ($a['level'] == 12) { - $this->users[$i]['tactic7'] = floor((90 + $this->stats[$i]['s7']) / $this->stats[$i]['hpAll'] * $this->stats[$i]['hpNow']); - } - } - // - $anl = $this->lookStats($anl); - - $vLog = - 'time1=' . time() . - '||s1=' . $this->users[$i]['sex'] . - '||t1=' . $this->users[$i]['team'] . - '||login1=' . $this->users[$i]['login']; - $vLog .= - '||s2=1||t2=' . $this->users[$i]['team'] . - '||login2=' . $a['name'] . ' ( ' . $this->users[$i]['login'] . ')'; - - $mas1 = [ - 'time' => time(), - 'battle' => $this->info['id'], - 'id_hod' => 1, - '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]]) && $anl['add_' . $u->items['add'][$i6]] > 0) { - if ($u->items['add'][$i6] == 'mib1') { - $ba .= ' : +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } elseif ($u->items['add'][$i6] == 'mib2') { - $ba .= ' : +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } elseif ($u->items['add'][$i6] == 'mib3') { - $ba .= ' : +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } elseif ($u->items['add'][$i6] == 'mib4') { - $ba .= ' : +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } elseif ( - $u->items['add'][$i6] != 'mab1' && - $u->items['add'][$i6] != 'mab2' && - $u->items['add'][$i6] != 'mab3' && - $u->items['add'][$i6] != 'mab4' - ) { - $ba .= $u->is[$u->items['add'][$i6]] . ': +' . $anl['add_' . $u->items['add'][$i6]] . ', '; - } - } - $i6++; - } - $ba = trim($ba, ', '); - if ($ba == '') { - $ba = ' '; - } - - $mas1['text'] = '{tm1} {u2} , "' . $tpa3[$a['type']] . ' [' . $a['level'] . ']" {u1}. (' . $ba . ')'; - $nxtlg[] = $mas1; - mysql_query('UPDATE `users_animal` SET `eda` = `eda` - 1 WHERE `id` = "' . $a['id'] . '" LIMIT 1'); - $this->get_comment(); - } - } - - 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'])) { - // - $this->addstatuser($pl['id']); - } - $i++; - } - - $up = rtrim($up, ' OR'); - - // - - if ($this->info['start1'] == 0) { - $tststrt = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "' . $this->info['id'] . '" AND `start1` = "0" LIMIT 1')); - if (isset($tststrt['id'])) { - $upd = mysql_query('UPDATE `battle` SET `start1` = "' . time() . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - if ($upd) { - $i = 0; - $r = ''; - while ($i <= $tsi) { - if (isset($rs[$i]) && $rs[$i] != '') { - $r .= rtrim($rs[$i], ', ') . ' '; - } - $i++; - } - $r = rtrim($r, ' '); - $r = str_replace('"', '\\\\\"', $r); - $this->hodID++; - $time = time(); - $mass = [ - 'time' => $time, - 'battle' => $this->info['id'], - 'id_hod' => $this->hodID, - 'vars' => "time1=$time||", - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - $r = ' ' . date('d.m.Y H:i', - $this->info['time_start']) . ', ' . $r . ' .'; - mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . $mass['time'] . '","' . $mass['battle'] . '","' . $mass['id_hod'] . '","' . $r . '","' . $mass['vars'] . '","' . $mass['zona1'] . '","' . $mass['zonb1'] . '","' . $mass['zona2'] . '","' . $mass['zonb2'] . '","' . $mass['type'] . '")'); - - $this->info['start1'] = time(); - } - } - - if (!empty($nxtlg)) { - foreach ($nxtlg as $item) { - $this->add_log($item); - } - } - } - } - } - - // - private function restZonb($uid1, $uid2) - { - if ($this->stnZbVs[$uid1] > 0) { - $this->stats[$this->uids[$uid1]]['zonb'] = $this->stnZbVs[$uid1]; - } - if ($this->stnZbVs[$uid2] > 0) { - $this->stats[$this->uids[$uid1]]['zonb'] = $this->stnZbVs[$uid2]; - } - } - - // () - public function testZonbVis() - { - global $u; - if ($this->stnZbVs == 0) { - $zb = $this->stats[$this->uids[$u->info['id']]]['zonb']; - $this->stnZbVs = $zb; - } else { - $zb = $this->stnZb; - } - $eu = $this->users[$this->uids[$u->info['id']]]['enemy']; - if ($zb > 3) { - $zb = 3; - } - if ( - !empty($eu) && - ($this->stats[$this->uids[$eu]]['weapon1'] == 1 || $this->stats[$this->uids[$eu]]['weapon2'] == 1) && - $this->stats[$this->uids[$u->info['id']]]['weapon1'] != 1 && $this->stats[$this->uids[$u->info['id']]]['weapon2'] != 1 - ) { - $zb -= 1; - } - if ($zb < 1) { - $zb = 1; - } - return $zb; - } - - // - private function testZonb($uid, $uid2) - { - $zba = []; - - if ($this->stnZb[$uid] == 0) { - $zba[1] = $this->stats[$this->uids[$uid]]['zonb']; - $this->stnZb[$uid] = $zba[1]; - } else { - $zba[1] = $this->stnZb[$uid]; - } - - if ($this->stnZb[$uid2] == 0) { - $zba[2] = $this->stats[$this->uids[$uid2]]['zonb']; - $this->stnZb[$uid] = $zba[2]; - } else { - $zba[2] = $this->stnZb[$uid2]; - } - - if ($zba[1] > 3) { - $zba[1] = 3; - } - if ($zba[2] > 3) { - $zba[2] = 3; - } - - // 1 - if ( - ($this->stats[$this->uids[$uid2]]['weapon1'] == 1 || $this->stats[$this->uids[$uid2]]['weapon2'] == 1) && - $this->stats[$this->uids[$uid]]['weapon1'] != 1 && $this->stats[$this->uids[$uid]]['weapon2'] != 1 - ) { - $zba[1] -= 1; - } - - // 2 - if ( - ($this->stats[$this->uids[$uid]]['weapon1'] == 1 || $this->stats[$this->uids[$uid]]['weapon2'] == 1) && - $this->stats[$this->uids[$uid2]]['weapon1'] != 1 && $this->stats[$this->uids[$uid2]]['weapon2'] != 1 - ) { - $zba[2] -= 1; - } - - if ($zba[1] < 1) { - $zba[1] = 1; - } - if ($zba[2] < 1) { - $zba[2] = 1; - } - - $this->stats[$this->uids[$uid]]['zonb'] = $zba[1]; - $this->stats[$this->uids[$uid2]]['zonb'] = $zba[2]; - if ( - $this->stats[$this->uids[$uid]]['min_zonb'] > 0 && - $this->stats[$this->uids[$uid]]['zonb'] < $this->stats[$this->uids[$uid]]['min_zonb'] - ) { - $this->stats[$this->uids[$uid]]['zonb'] = $this->stats[$this->uids[$uid]]['min_zonb']; - } - if ( - $this->stats[$this->uids[$uid2]]['min_zonb'] > 0 && - $this->stats[$this->uids[$uid2]]['zonb'] < $this->stats[$this->uids[$uid2]]['min_zonb'] - ) { - $this->stats[$this->uids[$uid2]]['zonb'] = $this->stats[$this->uids[$uid2]]['min_zonb']; - } - } - - // - public function genTeams($you) - { - $ret = ''; - $teams = []; - // - $i = 0; - $j = 1; - $tms = []; - - $teams[$this->users[$this->uids[$you]]['team']] = ''; - $tms[0] = $this->users[$this->uids[$you]]['team']; - - while ($i < count($this->uids)) { - if ($this->stats[$i]['hpNow'] > 0) { - if (!isset($teams[$this->users[$i]['team']])) { - $tms[$j] = $this->users[$i]['team']; - $j++; - } - if ($this->stats[$i]['hpNow'] < 0) { - $this->stats[$i]['hpNow'] = 0; - } - if ($this->stats[$i]['hpAll'] < $this->stats[$i]['hpNow']) { - $this->stats[$i]['hpNow'] = $this->stats[$i]['hpAll']; - } - $a1ms = ''; - if ($this->ga[$this->users[$i]['id']][$you]) { - $a1mc = ''; - $ac = mysql_fetch_array(mysql_query('SELECT * FROM `battle_act` WHERE `id` = "' . $this->ga[$this->users[$i]['id']][$you] . '" LIMIT 1')); - if (isset($ac) && $ac['time'] + $this->info['timeout'] - 15 < time()) { - $a1mc = 'color:red;'; - } - $a1ms = 'style=\"text-decoration: underline; ' . $a1mc . '\"'; - } elseif ($this->ag[$this->users[$i]['id']][$you]) { - $a1mc = ''; - $ac = mysql_fetch_array(mysql_query('SELECT * FROM `battle_act` WHERE `id` = "' . $this->ag[$this->users[$i]['id']][$you] . '" LIMIT 1')); - if (isset($ac) && $ac['time'] + $this->info['timeout'] - 15 < time()) { - $a1mc = 'color:green;'; - } - $a1ms = 'style=\"text-decoration: overline; ' . $a1mc . '\"'; - } - if ($this->users[$i]['login2'] == '') { - $this->users[$i]['login2'] = $this->users[$i]['login']; - } - if ($this->users[$i]['align'] == 9) { - $this->stats[$i]['hpNow'] = $this->stats[$i]['hpNow'] / ($this->stats[$i]['hpAll'] / 100); - $this->stats[$i]['hpAll'] = '100%'; - } - $ldr = ''; - if ($this->users[$i]['lider'] == $this->info['id']) { - $ldr = 'users[$i]['team'] . '.gif \>'; - } - $teams[$this->users[$i]['team']] .= ', ' . $ldr . 'users[$i]['team'] . '\" onClick=\"top.chat.addto(\'' . $this->users[$i]['login2'] . '\',\'to\'); return false;\" oncontextmenu=\"top.infoMenu(\'' . $this->users[$i]['login2'] . '\',event,\'main\'); return false;\">' . $this->users[$i]['login2'] . ' [' . floor($this->stats[$i]['hpNow']) . '/' . $this->stats[$i]['hpAll'] . ']'; - } - $i++; - } - - // - $i = 0; - while ($i < count($tms)) { - $teams[$tms[$i]] = ltrim($teams[$tms[$i]], ', '); - if ($teams[$tms[$i]] != '') { - $teams[$tms[$i]] = ' ' . $teams[$tms[$i]]; - $ret .= $teams[$tms[$i]]; - if (count($tms) > $i + 1) { - $ret .= '     '; - } - } - $i++; - } - return "genteam($ret);"; - } - - public function addTravm($uid, $type, $lvl) - { - $timeEnd = 0; - if ($type == 1) { - $name = ' '; - $stat = rand(1, 3); // - $timeEnd = rand(1, 3);// 1.30 6 - $data = 'add_s' . $stat . '=-' . $lvl; - $img = 'eff_travma1.gif'; - $v1 = 1; - } elseif ($type == 2) { - $name = ' '; - $stat = rand(1, 3); // - $timeEnd = rand(3, 5);// 6 12 - $data = 'add_s' . $stat . '=-' . ($lvl * 2); - $v1 = 2; - $img = 'eff_travma2.gif'; - } elseif ($type == 3) { - $name = ' '; - $stat = rand(1, 3); // - $timeEnd = rand(5, 7);// 12 6 - $data = 'add_s' . $stat . '=-' . ($lvl * 3); - $v1 = 3; - $img = 'eff_travma3.gif'; - } elseif ($type == 4) { - $name = ' '; - $stat = rand(1, 3); // - $timeEnd = 24;// 24 - $data = 'add_s' . $stat . '=-' . ($lvl * 50); - $v1 = 4; - $img = 'eff_travma4.gif'; - } - $timeEnd *= 3600; - - mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (0,unix_timestamp(), -1, ' . $name . ',' . $data . ',' . $uid . ', 4, ' . $img . ',' . $timeEnd . ', ' . $v1 . ')'); - mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (0,unix_timestamp(), -1, ": ","add_notravma=1",' . $uid . ', 263, "cure1.gif",21600, "")'); - } - - public function testUserInfoBattle($uid) - { - global $u; - if (!isset($this->uids[$uid])) { - // ( ) - if (!isset($this->uids[$uid])) { - $this->uids[$uid] = count($this->users); - } - $this->users[$this->uids[$uid]] = mysql_fetch_array(mysql_query('SELECT - - `u`.`id`,`u`.`login`,`u`.`login2`,`u`.`online`,`u`.`admin`,`u`.`city`,`u`.`cityreg`,`u`.`align`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`clan`, - `u`.`level`,`u`.`money`,`u`.`money3`,`u`.`money2`,`u`.`money4`,`u`.`battle`,`u`.`sex`,`u`.`obraz`,`u`.`win`,`u`.`win_t`, - `u`.`lose`,`u`.`lose_t`,`u`.`nich`,`u`.`timeMain`,`u`.`invis`,`u`.`bot_id`,`u`.`animal`,`u`.`type_pers`, - `u`.`notrhod`,`u`.`bot_room`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`activ`,`u`.`stopexp`,`u`.`real`, - - `st`.* - - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id` = "' . $uid . '" LIMIT 1')); - $this->stats[$this->uids[$uid]] = $u->getStats($this->users[$this->uids[$uid]], 0, 0, false, false, true); - } - } - - ///---- - public function spaCheck($u1) - { - if ($this->stats[$this->uids[$u1]]['hpNow'] < 1) { - mysql_query('DELETE FROM `battle_act` WHERE `uid1` = "' . $u1 . '" OR `uid2` = "' . $u1 . '"'); - if ($this->stats[$this->uids[$u1]]['spasenie'] > 0 && $this->users[$this->uids[$u1]]['tactic7'] >= 25) // - { - // - // - if ($this->stats[$this->uids[$u1]]['s7'] > 49 && $this->stats[$this->uids[$u1]]['s7'] < 75) { - // - 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, '" . $u1 . "', ' ', 'add_zmproc=75|add_zaproc=75', 0, 77, 0, '" . $u1 . "', 0, 'priem', 141, 'spirit_block25.gif', 1, 1, '0', 0, 0, '', 0, 0, 0, 0, 0);"); - $this->stats[$this->uids[$u1]]['hpNow'] = floor($this->stats[$this->uids[$u1]]['hpAll'] * 0.5); - $this->stats[$this->uids[$u1]]['mpNow'] = floor($this->stats[$this->uids[$u1]]['mpAll'] * 0.5); - } elseif ($this->stats[$this->uids[$u1]]['s7'] > 74 && $this->stats[$this->uids[$u1]]['s7'] < 100) { - // - 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, '" . $u1 . "', ' ', 'add_zmproc=100|add_zaproc=100', 0, 77, 0, '" . $u1 . "', 0, 'priem', 358, 'block_absolute.gif', 1, 1, '0', 0, 0, '', 0, 0, 0, 0, 0);"); - $this->stats[$this->uids[$u1]]['hpNow'] = floor($this->stats[$this->uids[$u1]]['hpAll'] * 0.75); - $this->stats[$this->uids[$u1]]['mpNow'] = floor($this->stats[$this->uids[$u1]]['mpAll'] * 0.75); - } elseif ($this->stats[$this->uids[$u1]]['s7'] > 99) { - // x2 - 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, '" . $u1 . "', ' ', 'add_zmproc=100|add_zaproc=100', 0, 77, 0, '" . $u1 . "', 0, 'priem', 358, 'wis_white_shield.gif', 1, 2, '0', 0, 0, '', 0, 0, 0, 0, 0);"); - $this->stats[$this->uids[$u1]]['hpNow'] = floor($this->stats[$this->uids[$u1]]['hpAll']); - $this->stats[$this->uids[$u1]]['mpNow'] = floor($this->stats[$this->uids[$u1]]['mpAll']); - } - - if ($this->stats[$this->uids[$u1]]['hpNow'] < 1) { - $this->stats[$this->uids[$u1]]['hpNow'] = 1; - } - if ($this->stats[$this->uids[$u1]]['mpNow'] < 1) { - $this->stats[$this->uids[$u1]]['mpNow'] = 1; - } - if ($this->stats[$this->uids[$u1]]['hpNow'] > $this->stats[$this->uids[$u1]]['hpAll']) { - $this->stats[$this->uids[$u1]]['hpNow'] = floor($this->stats[$this->uids[$u1]]['hpAll']); - } - if ($this->stats[$this->uids[$u1]]['mpNow'] > $this->stats[$this->uids[$u1]]['mpAll']) { - $this->stats[$this->uids[$u1]]['mpNow'] = floor($this->stats[$this->uids[$u1]]['mpAll']); - } - - mysql_query('DELETE FROM `eff_users` WHERE `uid` = ' . $u1 . ' AND `id_eff` = 22 AND `v1` = "priem" AND `v2` = 324'); - mysql_query('UPDATE `stats` SET `hpNow` = ' . $this->stats[$this->uids[$u1]]['hpNow'] . ',`mpNow` = ' . $this->stats[$this->uids[$u1]]['mpNow'] . ', `tactic7` = `tactic7` - 25 WHERE `id` = ' . $u1 . ' LIMIT 1'); - $mas['text'] = '{tm1} ' . $this->stats[$this->uids[$u1]]['login'] . ' ...' . $this->stats[$this->uids[$u1]]['login'] . ' . '; - $this->priemAddLog($id, 1, 2, $u->info['id'], $u1, - ' ', - $mas['text'], - ($this->hodID + 0) - ); - - - } else { - if (isset($this->stats[$this->uids[$u1]]['login'])) { - mysql_query('UPDATE `stats` SET `hpNow` = 0,`mpNow` = 0 WHERE `id` = ' . $u1 . ' LIMIT 1'); - $this->stats[$this->uids[$u1]]['hpNow'] = 0; - $this->users[$this->uids[$u1]]['hpNow'] = 0; - $mas['text'] = '{tm1} ' . $this->stats[$this->uids[$u1]]['login'] . ' .'; - $this->priemAddLog($id, 1, 2, $u->info['id'], $u1, - ' ', - $mas['text'], - ($this->hodID + 1) - // // - ); - mysql_query('DELETE FROM `battle_act` WHERE `uid1` = ' . $this->stats[$this->uids[$u1]]['id'] . ' OR `uid2` = ' . $this->stats[$this->uids[$u1]]['id'] . ' OR `uid2` = -' . $this->stats[$this->uids[$u1]]['id']); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = ' . $this->stats[$this->uids[$u1]]['id'] . ' AND `v1` = "priem" AND `delete` = 0'); - // v1 priem - } - } - } - } - // - - -} - -if (!defined('GAME')) { - die(); -} -ignore_user_abort(true); -ini_set('memory_limit', '512M'); - -$btl = new battleClass(new Db()); diff --git a/_incl_data/class/__chat_class.php b/_incl_data/class/__chat_class.php deleted file mode 100644 index 571470a1..00000000 --- a/_incl_data/class/__chat_class.php +++ /dev/null @@ -1,189 +0,0 @@ - array(0 => '',1 => ' [*%l*]'), - 'fingal' => array(0 => ' ',1 => ' [*%l*]'), - 'eek' => array(0 => '',1 => ' [*%l*]'), - 'smoke' => array(0 => '',1 => ' [*%l*] '), - 'hi' => array(0 => ' ',1 => ' [*%l*]'), - 'bye' => array(0 => ' ',1 => ' [*%l*]'), - 'king' => array(0 => ' :-)',1 => ' [*%l*] !'), - 'king2' => array(0 => ' :-)',1 => ' [*%l*] !'), - 'boks2' => array(0 => ' ',1 => ' [*%l*] '), - 'boks' => array(0 => ' , !',1 => ' [*%l*] '), - 'gent' => array(0 => ' ',1 => ' [*%l*] '), - 'lady' => array(0 => ' ',1 => ', [*%l*] '), - 'tongue' => array(0 => ' ',1 => ' [*%l*]'), - 'smil' => array(0 => ' ',1 => ', [*%l*] !'), - 'ponder' => array(0 => '- ',1 => ' [*%l*]'), - 'bow' => array(0 => ' , ',1 => ' [*%l*]'), - 'angel' => array(0 => ' ',1 => ' [*%l*] '), - 'angel2' => array(0 => ' ',1 => ' [*%l*] '), - 'hello' => array(0 => ' ',1 => ' [*%l*]'), - 'dont' => array(0 => ' ',1 => ' [*%l*] '), - 'idea' => array(0 => ' !',1 => ' [*%l*] '), - 'mol' => array(0 => ' ',1 => ' [*%l*]'), - 'super' => array(0 => ', , - , - !',1 => ' [*%l*]'), - 'beer' => array(0 => ' ...',1 => ' [*%l*] !'), - 'drink' => array(0 => ', ',1 => ' [*%l*] '), - 'baby' => array(0 => ' ',1 => ' , [*%l*] '), - 'tongue2' => array(0 => ' ',1 => ' [*%l*] , '), - 'sword' => array(0 => ' ',1 => ' [*%l*] !'), - 'agree' => array(0 => ' ',1 => ' [*%l*]'), - 'loveya' => array(0 => ' ',1 => ' [*%l*]'), - 'kiss' => array(0 => ' ',1 => ' [*%l*]'), - 'kiss2' => array(0 => ' -...',1 => ' [*%l*]'), - 'kiss3' => array(0 => '- ...',1 => ' [*%l*]'), - 'kiss4' => array(0 => '- ...',1 => ' [*%l*] ...'), - 'rose' => array(0 => ' - , ...',1 => ' [*%l*] ...'), - 'love' => array(0 => ' ...',1 => ', [loginfrom] + [*%l*]= !'), - 'love2' => array(0 => ' ...',1 => ' [*%l*]'), - 'confused' => array(0 => ' ...',1 => ' [*%l*]'), - 'yes' => array(0 => ' ',1 => ' [*%l*] '), - 'no' => array(0 => ' ',1 => ' [*%l*] '), - 'shuffle' => array(0 => ' ',1 => ' [*%l*]'), - 'nono' => array(0 => ' !',1 => ' [*%l*]'), - 'maniac' => array(0 => ' - - ...',1 => ', [*%l*] ...'), - 'privet' => array(0 => ' ',1 => ' [*%l*]'), - 'ok' => array(0 => ', ',1 => ', [*%l*] '), - 'ninja' => array(0 => ' !',1 => ' [*%l*] '), - 'pif' => array(0 => ' ',1 => ', [*%l*]'), - 'smash' => array(0 => ' ',1 => ' - [*%l*]'), - 'alien' => array(0 => ', !',1 => ' , [*%l*] !'), - 'pirate' => array(0 => ', !...',1 => ', [*%l*], !'), - 'gun' => array(0 => ' - ... :gun:',1 => ', [*%l*] ! :gun:'), - 'trup' => array(0 => ' ',1 => ', [*%l*], , !'), - 'mdr' => array(0 => ', ... :mdr:',1 => ' [*%l*] :mdr:'), - 'sneeze' => array(0 => ' ',1 => ' [*%l*], !'), - 'mad' => array(0 => ' !!!',1 => ' [*%l*]!!!'), - 'friday' => array(0 => ' ...',1 => ' [*%l*] '), - 'cry' => array(0 => ' ',1 => ' [*%l*]'), - 'grust' => array(0 => '...',1 => ' [*%l*]'), - 'rupor' => array(0 => ' ',1 => ' [*%l*]'), - 'fie' => array(0 => ': , !!!',1 => ' [*%l*] !'), - 'nnn' => array(0 => ' , , ...',1 => ' , [*%l*]'), - 'row' => array(0 => ' ...',1 => ' [*%l*]'), - 'red' => array(0 => ' ...',1 => ' [*%l*]'), - 'lick' => array(0 => ', ',1 => ' [*%l*]'), - 'help' => array(0 => ' !',1 => ' [*%l*]'), - 'wink' => array(0 => ' ',1 => ' [*%l*]'), - 'jeer' => array(0 => ' ...',1 => ' [*%l*]'), - 'tease' => array(0 => '',1 => ' [*%l*]'), - 'nunu' => array(0 => ' ...',1 => ' [*%l*]'), - 'inv' => array(0 => ' ...',1 => ' [*%l*] ...'), - 'duel' => array(0 => ' -...',1 => ' [*%l*] !'), - 'susel' => array(0 => ': " , .." ...',1 => ' [*%l*] !'), - 'nun' => array(0 => ' ',1 => ' [*%l*] '), - 'kruger' => array(0 => ' :kruger:',1 => ' [*%l*] '), - 'flowers' => array(0 => ' -21 - ',1 => ' [*%l*] '), - 'horse' => array(0 => ' ',1 => ' [*%l*] ! :horse:'), - 'hug' => array(0 => ' !',1 => ' [*%l*]'), - 'str' => array(0 => ' !',1 => ' [*%l*]'), - 'alch' => array(0 => ' :alch:',1 => ' [*%l*] :alch:'), - 'pal' => array(0 => ' , , - ! :-)',1 => ' [*%l*] !'), - 'mag' => array(0 => ' . . .',1 => ' [*%l*]'), - 'sniper' => array(0 => ' ',1 => ' [*%l*] '), - 'fuck' => array(0 => ' ',1 => ' [*%l*] '), - 'rotate' => array(0 => ' ',1 => ' [*%l*]') - ); - - public function expworld($txt,$vl) - { - $words = explode(' ',$txt); $j = 0; $i = -1; - while($i < count($words)) - { - $i++; - if(isset($words[$i])) - { - if(strlen($words[$i]) > $vl){ $words[$i] = substr($words[$i],0,$vl).' '.substr($words[$i],$vl); $i = 0; $j++; $txt = implode(' ', $words); $words = explode(' ',$txt); } - } - } - $txt = implode(' ',$words); - return $txt; - } - - public function str_count($str,$col) - { - if (strlen($str) > $col) - { - $str = substr($str,0,$col); - } - return ($str); - } - - public function smileText($text,$tol,$room,$city) - { - $retxt = ''; $j = 0; - $txt = str_replace('/','⁄',$text).' '; - - if(preg_match("/⁄(.*?) /", $txt, $retxt)) - { - if(isset($this->smilesWorld[$retxt[1]])) - { - if($tol == '') - { - $tol = str_replace('⁄'.$retxt[1].' ','',$txt); - $tol = trim($tol,' '); - } - if($tol == '') - { - $txt = ''.$this->smilesWorld[$retxt[1]][0].''; - }else{ - $mbl = mysql_fetch_array(mysql_query('SELECT `online`,`id`,`login`,`room`,`city` FROM `users` WHERE `room`="'.$room.'" AND `online` > '.(time()-520).' AND `city` = "'.$city.'" AND `login`="'.mysql_real_escape_string($tol).'" LIMIT 1')); - if(isset($mbl['id'])) - { - $txt = ''.$this->smilesWorld[$retxt[1]][1].''; - $txt = str_replace('[*%l*]','[login:'.$tol.']',$txt); - }else{ - $txt = 'USER IS FALSE'; - } - } - $j = 1; - } - } - - if($j == 1) - { - $text = $txt; - }else{ - $text = false; - } - - return $text; - } - - public function send($color,$room,$city,$from,$to,$text,$time,$type,$toChat,$spam,$sound,$new = 0) - { - //mysql_query('LOCK TABLES chat WRITE'); - - mysql_query("INSERT INTO `chat` (`new`,`sound`,`color`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`spam`) VALUES ('".$new."','".$sound."','".$color."','".$city."','".$room."','".$from."','".$to."','".$text."','".$time."','".$type."','".$toChat."','".$spam."')"); - - //mysql_query('UNLOCK TABLES'); - - $msg_id = mysql_insert_id(); - return $msg_id; - } - - public function jsmsg($id,$time,$to,$from,$type,$ch,$e,$see,$js = 0,$cl = '#000000',$typeTime = NULL) - { - $tm = date('H:i',$time); - if($typeTime==1) - { - $tm = date('d.m.Y H:i',$time); - } - $rt = 'top.addMessage(\''.$id.'\',\''.$tm.'\',\''.$to.' \',\''.$from.'\',\''.$type.'\',\''.$ch.'\'," '.$e.' ",\''.$see.'\',\''.$cl.'\');'; - if($js==1) - { - $rt = ''; - } - return $rt; - } -} -$chat = new Chat(); -?> \ No newline at end of file diff --git a/_incl_data/class/__db_connect.php b/_incl_data/class/__db_connect.php index cfdf0366..fc8860b8 100644 --- a/_incl_data/class/__db_connect.php +++ b/_incl_data/class/__db_connect.php @@ -1,28 +1,20 @@ 'localhost', // server + 'd' => 'newcom1_abk', // database + 'u' => 'newcom1_abk', // user + 'p' => '4nWYsIM[c?}P' // password +]; +$dsn = 'mysql:host=' . $db['s'] . ';dbname=' . $db['d']; -$dbgo = mysql_pconnect('localhost','newcom1_abk','4nWYsIM[c?}P'); -mysql_select_db('newcom1_abk',$dbgo); +include './_incl_data/mysql_override.php'; + +$dbgo = mysql_connect($db['s'], $db['u'], $db['p']); +mysql_select_db($db['d'], $dbgo); mysql_query('SET NAMES cp1251'); -if(!function_exists('GetRealIp')) { - function GetRealIpTest(){ - 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']; - } - $ipban = GetRealIpTest(); -}else{ - $ipban = GetRealIp(); -} - -$pdo = new PDO('mysql:host=localhost;dbname=newcom1_abk', 'newcom1_abk', '4nWYsIM[c?}P'); \ No newline at end of file +$pdo = new PDO($dsn, $db['u'], $db['p'], [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES cp1251"]); diff --git a/_incl_data/class/__dungeon.php b/_incl_data/class/__dungeon.php deleted file mode 100644 index 87d254dc..00000000 --- a/_incl_data/class/__dungeon.php +++ /dev/null @@ -1,1956 +0,0 @@ - array() // - ) ,$id_dng,$cord = array('x' => 0),$sg = array(1 => array(1=>1,2=>2,3=>3,4=>4),2 => array(1=>2,2=>3,3=>4,4=>1),3 => array(1=>3,2=>4,3=>1,4=>2),4 => array(1=>4,2=>1,3=>2,4=>3)); - public function start() - { - global $u,$c,$code; - $this->info = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_now` WHERE `id` = "'.$u->info['dnow'].'" LIMIT 1')); - $this->id_dng = $this->info['id2']; - $this->gs = $u->info['s']; - if($this->gs<1 || $this->gs>4) - { - $this->gs = 1; - } - - - if($this->info['bsid']>0) - { - $this->bs = mysql_fetch_assoc(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "'.$u->info['city'].'" AND `id` = "'.$this->info['bsid'].'" AND `time_start` = "'.$this->info['time_start'].'" LIMIT 1')); - if(isset($this->bs['id'])) - { - // - /*if($this->bs['users']-$this->bs['users_finish'] < 2) - { - $u->bsfinish($this->bs,false,NULL); - }*/ - } - } - - - - if(isset($_GET['itm_luck']) && $this->info['bsid'] == 0) { - $this->itm_luck((int)$_GET['itm_luck']); - }elseif(isset($_GET['itm_unluck']) && $this->info['bsid'] == 0) { - $this->itm_unluck((int)$_GET['itm_unluck']); - }elseif(isset($_GET['atack'])){ - $this->atack((int)$_GET['atack']); - }elseif(isset($_GET['take'])){ - $this->takeinv((int)$_GET['take']); - }elseif(isset($_GET['take_obj'])){ - $this->takeit((int)$_GET['take_obj']); - }elseif(isset($_GET['look'])){ - if((int)$_GET['look']==1){ - if($this->gs==1) - { - $this->gs = 2; - }elseif($this->gs==2) - { - $this->gs = 3; - }elseif($this->gs==3) - { - $this->gs = 4; - }elseif($this->gs==4) - { - $this->gs = 1; - } - }elseif((int)$_GET['look']==2) - { - if($this->gs==1) - { - $this->gs = 4; - }elseif($this->gs==2) - { - $this->gs = 1; - }elseif($this->gs==3) - { - $this->gs = 2; - }elseif($this->gs==4) - { - $this->gs = 3; - } - } - mysql_query('UPDATE `stats` SET `s` = "'.((int)$this->gs).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['s'] = $this->gs; - }elseif(isset($_GET['go'])) - { - // - $this->testGo((int)$_GET['go']); - } - - /* ( ) - $this->gs = 1; // - 2; // - 3; // - 4; // - ( ( ( `y` >= '.$u->info['y'].' && `y` <= '.($u->info['y']+4).' ) && ( `x` >= '.($u->info['x']-1).' && `x` <= '.($u->info['x']+1).' ) ) || ( (`x` = '.($u->info['x']+2).' || `x` = '.($u->info['x']-2).') && ( `y` = '.($u->info['y']+3).' || `y` = '.($u->info['y']+4).' ) ) ) - */ - - $whr = array( - 1 => ' ((`x` <= '.($u->info['x']+2).' && `x` >= '.($u->info['x']-2).') && (`y` >= '.$u->info['y'].' && `y` <= '.($u->info['y']+4).')) ', // - 3 => ' ((`x` <= '.($u->info['x']+2).' && `x` >= '.($u->info['x']-2).') && (`y` <= '.$u->info['y'].' && `y` >= '.($u->info['y']-4).')) ', // - 2 => ' ((`x` <= '.$u->info['x'].' && `x` >= '.($u->info['x']-4).') && (`y` <= '.($u->info['y']+2).' && `y` >= '.($u->info['y']-2).')) ', // - 4 => ' ((`x` >= '.$u->info['x'].' && `x` <= '.($u->info['x']+4).') && (`y` <= '.($u->info['y']+2).' && `y` >= '.($u->info['y']-2).')) ' // - ); - - $i = 1; - $sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.$this->id_dng.'" AND '.$whr[$this->gs].' ORDER BY `y` ASC , `x` ASC LIMIT 25'); - while($pl = mysql_fetch_assoc($sp)) - { - $this->map[0][$pl['y'].'_'.$pl['x']] = $pl; - $i++; - } - $this->map['good'] = $i; // - $this->map[1] = $this->genMatix(); - $this->lookDungeon(); - } - - public function pickitem($obj,$itm,$for, $data = '',$dn_delete = false, $chat = 0) { - global $u; - $itm = mysql_fetch_assoc(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$itm.'" LIMIT 1')); - if( isset($itm['id']) ) { - $tou = 0; // - /* */ - $itmnm = mysql_fetch_assoc(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$itmz[0].'" LIMIT 1')); - $itmnm = $itmnm['name']; - $asex = ''; - if( $u->info['sex'] == 1 ) { - $asex = ''; - } - - if($for > 0 ) { - $tou = $for; - $rtxt = ''.$u->info['login'].' '.$asex.' "'.$itm['name'].'" "'.$obj['name'].'"'; - }else{ - $rtxt = ''.$u->info['login'].' '.$asex.' "'.$itm['name'].'" "'.$obj['name'].'", '; - } - if($dn_delete == true) { $dn_delete = 1; } else { $dn_delete = 0; } - if($chat == 0) { - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$u->info['dnow']."','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1','1')"); - } - $ins = mysql_query('INSERT INTO `dungeon_items` (`dn_delete`,`data`,`dn`,`user`,`item_id`,`time`,`x`,`y`) VALUES ( - "'.$dn_delete.'", - "'.mysql_real_escape_string($data).'", - "'.$u->info['dnow'].'", - "'.$tou.'", - "'.$itm['id'].'", - "'.time().'", - "'.$u->info['x'].'", - "'.$u->info['y'].'")'); - return $ins; - } - } -public function n_lead($who, $lead) { - global $u, $c, $code; - - $to = mysql_fetch_assoc(mysql_query('SELECT `u`.`id`, `u`.`login`, `st`.`id`, `st`.`dnow` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`login` = "'.mysql_real_escape_string($who).'" LIMIT 1')); - - if($this->info['uid'] != $lead) { - $this->error = ' ...'; - } elseif(!isset($to['id'])) { - $this->error = ' ...'; - } elseif($to['id'] == $this->info['uid']) { - $this->error = ' ...'; - } elseif($to['dnow'] != $this->info['id']) { - $this->error = ' ...'; - } else { - mysql_query('UPDATE `dungeon_now` SET `uid` = "'.$to['id'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if($u->info['sex'] == 0) { - $this->sys_chat(''.$u->info['login'].' '.$to['login'].''); - } else { - $this->sys_chat(''.$u->info['login'].' '.$to['login'].''); - } - //header('Location: main.php'); - die(''); - } - } - - public function go_to_hell($who, $lead) { - global $u, $c, $code; - - $to = mysql_fetch_assoc(mysql_query('SELECT `u`.`id`, `u`.`login`, `st`.`id`, `st`.`dnow` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`login` = "'.mysql_real_escape_string($who).'" LIMIT 1')); - - if($this->info['uid'] != $lead) { - $this->error = ' ...'; - } elseif(!isset($to['id'])) { - $this->error = ' ...'; - } elseif($to['id'] == $this->info['uid']) { - $this->error = ' ...'; - } elseif($to['dnow'] != $this->info['id']) { - $this->error = ' ...'; - } else { - - $rb = 321; // - if($u->info['room']==304){ - $rb = 209; // - }elseif($u->info['room']==396){ - $rb = 395; // () - }elseif($u->info['room']==398){ - $rb = 321; // - }elseif($d->info['id2']==3){ - $rb = 293; // - }elseif($d->info['id2']==1){ - $rb = 188; // - }elseif($d->info['id2']==13){ - $rb = 275; // - }elseif($d->info['id2']==12){ - $rb = 372; // - }elseif($d->info['id2']==444){ - $rb = 321; // - }elseif($d->info['id2']==31){ - $rb = 321; // - }elseif($d->info['id2']==101){ - $rb = 321; // - - } - - $sp = mysql_query('SELECT * FROM `dungeon_now` WHERE `time_finish` = "0" LIMIT 50'); - while($pl = mysql_fetch_assoc($sp)) { - $cn = mysql_fetch_assoc(mysql_query('SELECT `id` FROM `stats` WHERE `dnow` = "'.$pl['id'].'" LIMIT 1')); - if(!isset($cn['id'])) { - mysql_query('DELETE FROM `dungeon_bots` WHERE `dn` = "'.$pl['id'].'" AND `for_dn` = "0"'); - mysql_query('DELETE FROM `dungeon_obj` WHERE `dn` = "'.$pl['id'].'" AND `for_dn` = "0"'); - mysql_query('DELETE FROM `dungeon_items` WHERE `dn` = "'.$pl['id'].'" AND `for_dn` = "0"'); - mysql_query('DELETE FROM `dungeon_bots` WHERE `dn` = "'.$pl['id'].'" AND `for_dn` = "0"'); - mysql_query('DELETE FROM `dungeon_actions` WHERE `dn` = "'.$pl['id'].'"'); - mysql_query('UPDATE `dungeon_now` SET `time_finish` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - - $city = mysql_fetch_assoc(mysql_query('SELECT `id`, `city` FROM `room` WHERE `id` = "'.$rb.'" LIMIT 1')); - mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `room` = "'.$rb.'", `city`="'.$city['city'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `dn_delete` = "1" LIMIT 1000'); - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "1189" OR `item_id` = "4447" OR `item_id` = "1174") LIMIT 1000'); - - if($u->info['sex'] == 0) { - $this->sys_chat(''.$u->info['login'].' '.$to['login'].''); - } else { - $this->sys_chat(''.$u->info['login'].' '.$to['login'].''); - } - header('Location: /main.php'); - } - } - public function usersDng($laba = false) - { - global $u,$c; - $r = ''; - $stt = array(); - if( $laba == false ) { - $sp = mysql_query('SELECT `u`.`id`,`st`.`id` FROM `stats` AS `u` LEFT JOIN `users` AS `st` ON (`st`.`id` = `u`.`id`) WHERE `u`.`dnow` = "'.$this->info['id'].'" LIMIT 10'); - }else{ - $sp = mysql_query('SELECT `u`.`id` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`st`.`id` = `u`.`id`) WHERE `u`.`room` = 370 AND `st`.`dnow` = "'.$laba.'" AND `st`.`bot` = 0 LIMIT 6'); - } - while($pl = mysql_fetch_assoc($sp)) - { - $stt = $u->getStats($pl['id'],0); - if($stt['mpAll']>0) - { - $pm = $stt['mpNow']/$stt['mpAll']*100; - } - $ph = $stt['hpNow']/$stt['hpAll']*100; - $r .= ' - -
  '.$u->microLogin($pl['id'],1).'   '.floor($stt['hpNow']).'/'.$stt['hpAll'].' -
-
-
-'; -if($stt['mpAll']>0) -{ - $r .= '
'.floor($stt['mpNow']).'/'.$stt['mpAll'].'
-
-
-
'; -} -$r .= '
'; -if( $this->info['uid'] == $pl['id'] ) { - $r .= ''; -} -if($this->info['uid'] == $u->info['id'] && $pl['id'] == $u->info['id'] && $d->info['id2'] != 15) { - $r .= ' '; - $r .= ' '; - } -$r .= '

'; -$r .= ''; - } - unset($stt,$ph,$pm); - return $r; - } - - public function atack($id) { - global $u,$c,$code; - $bot = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_bots` WHERE `id2` = "'.$id.'" AND `for_dn` = "0" AND `dn` = "'.$this->info['id'].'" AND `delete` = "0" LIMIT 1')); - if(isset($bot['id2'])){ - if( ($u->info['x'] != $bot['x'] || $bot['y'] != $u->info['y']) && $this->testLike($u->info['x'],$u->info['y'],$bot['x'],$bot['y']) == 1 ){ - // - $tbtl = mysql_fetch_assoc(mysql_query('SELECT * FROM `battle` WHERE `dn_id` = "'.$this->info['id'].'" AND `team_win` = "-1" AND `x` = "'.$bot['x'].'" AND `y` = "'.$bot['y'].'" LIMIT 1')); - if(isset($tbtl['id'])) { - // - mysql_query('UPDATE `users` SET `battle` = "'.$tbtl['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - /*#$this->error = ' ... '; // */ - //header('location: main.php'); - die(''); - } else { - $btl_id = 0; - //$expB = -77.77; - $expB = 0; - $btl = array( - 'players'=>'', - 'timeout'=>120, - '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 ( - "'.$this->info['id2'].'", - "'.$this->info['id'].'", - "'.$bot['x'].'", - "'.$bot['y'].'", - "'.$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(); - - if($btl_id>0) { - // - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "0" AND `dn` = "'.$this->info['id'].'" AND `x` = "'.$bot['x'].'" AND `y` = "'.$bot['y'].'" AND `delete` = "0" LIMIT 1001'); - $j = 0; $logins_bot = array(); - while($pl = mysql_fetch_assoc($sp)){ - $jui = 1; - mysql_query('UPDATE `dungeon_bots` SET `inBattle` = "'.$btl_id.'" WHERE `id2` = "'.$pl['id2'].'" LIMIT 1'); - while($jui<=$pl['colvo']){ - $k = $u->addNewbot($pl['id_bot'],NULL,NULL,$logins_bot); - $logins_bot = $k['logins_bot']; - if($k!=false){ - $upd = mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$k['id'].'" LIMIT 1'); - if($upd){ - $upd = mysql_query('UPDATE `stats` SET `x`="'.$bot['x'].'",`y`="'.$bot['y'].'",`team` = "2" WHERE `id` = "'.$k['id'].'" LIMIT 1'); - if($upd){ - $j++; - } - } - } - $jui++; - } - } - unset($logins_bot); - if($j>0){ - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - /*#$this->error = ' ...';// */ - // - //header('location: main.php'); - die(''); - }else{ - $this->error = ' , ...'; - } - }else{ - $this->error = ' ...'; - } - } - }else{ - $this->error = ' ...'; - } - } else { - if(isset($this->bs['id']) || $this->info['id2'] == 15) { - $bot = mysql_fetch_assoc(mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id` = "'.mysql_real_escape_string($id).'" LIMIT 1')); - if(($u->info['x']!=$bot['x'] || $bot['y']!=$u->info['y']) && $this->testLike($u->info['x'],$u->info['y'],$bot['x'],$bot['y'])==1){ - // - $tbtl = mysql_fetch_assoc(mysql_query('SELECT * FROM `battle` WHERE `dn_id` = "'.$this->info['id'].'" AND `team_win` = "-1" AND `x` = "'.$bot['x'].'" AND `y` = "'.$bot['y'].'" LIMIT 1')); - //die(' . ['.$tbtl['id'].'] 5-10 .'); - if(isset($tbtl['id'])){ - // - $lstm = mysql_fetch_assoc(mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle`="'.$tbtl['id'].'" ORDER BY `st`.`team` DESC LIMIT 1')); - mysql_query('UPDATE `users` SET `battle` = "'.$tbtl['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $nextteam = $lstm['team']+1; - mysql_query('UPDATE `stats` SET `team` = "'.$nextteam.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `x` = "'.$bot['x'].'", `y` = "'.$bot['y'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - if( $this->info['bsid'] > 0 ) { - - $me_real = mysql_fetch_assoc(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "'.$u->info['id'].'" AND `login` = "'.$u->info['login'].'" LIMIT 1')); - $usr_real = mysql_fetch_assoc(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "'.$bot['id'].'" AND `login` = "'.$bot['login'].'" LIMIT 1')); - mysql_query('UPDATE `stats` SET `tactic7`= 20.000 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - if( $u->info['sex'] == 0 ) { - $text = '{u1} {u2} '; - }else{ - $text = '{u1} {u2} '; - } - if( isset($usr_real['id'])) { - $usrreal = ''; - if( $usr_real['align'] > 0 ) { - $usrreal .= ''; - } - if( $usr_real['clan'] > 0 ) { - $usrreal .= ''; - } - $usrreal .= ''.$usr_real['login'].'['.$usr_real['level'].']'; - }else{ - $mereal = '[??]'; - } - if( isset($me_real['id']) ) { - $mereal = ''; - if( $me_real['align'] > 0 ) { - $mereal .= ''; - } - if( $me_real['clan'] > 0 ) { - $mereal .= ''; - } - $mereal .= ''.$me_real['login'].'['.$me_real['level'].']'; - }else{ - $mereal = '[??]'; - } - $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().'", "'.$this->bs['id'].'", "'.$this->bs['count'].'", "'.$this->bs['city'].'", - "'.round($this->bs['money']*0.85,2).'","'.$i.'" - )'); - // - } - // - $this->error = ' ... '; - }else{ - $btl_id = 0; - //$expB = -77.77; - if($this->info['id2'] == 1) { - $expB = 200; - } - $btl = array( - 'players'=>'', - 'timeout'=>40, - 'type'=>0, - 'invis'=>0, - 'noinc'=>0, - 'travmChance'=>0, - 'typeBattle'=>0, - 'addExp'=>$expB, - 'money'=>0, - 'inTurnir' => 0 - ); - - if( $this->info['bsid'] > 0 ) { - $btl['inTurnir'] = $this->info['bsid']; - } - - $ins = mysql_query('INSERT INTO `battle` (`inTurnir`,`dungeon`,`dn_id`,`x`,`y`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES ( - "'.$btl['inTurnir'].'", - "'.$this->info['id2'].'", - "'.$this->info['id'].'", - "'.$bot['x'].'", - "'.$bot['y'].'", - "'.$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 `stats` SET `x` = "'.$bot['x'].'", `y` = "'.$bot['y'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `x` = "'.$bot['x'].'", `y` = "'.$bot['y'].'" WHERE `id` = "'.$bot['id'].'" LIMIT 1'); - - if($btl_id>0) - { - // - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - - 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'); - - if($u->stats['hpNow'] < 1) { - $u->stats['hpNow'] = 1; - mysql_query('UPDATE `stats` SET `hpNow` = "1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `lose` = `lose` + 1 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - - if($bot['hpNow'] < 1) { - $bot['hpNow'] = 1; - mysql_query('UPDATE `stats` SET `hpNow` = "1" WHERE `id` = "'.$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `lose` = `lose` + 1 WHERE `id` = "'.$bot['id'].'" LIMIT 1'); - } - - if( $this->info['bsid'] > 0 ) { - - $me_real = mysql_fetch_assoc(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "'.$u->info['id'].'" AND `login` = "'.$u->info['login'].'" LIMIT 1')); - $usr_real = mysql_fetch_assoc(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "'.$bot['id'].'" AND `login` = "'.$bot['login'].'" LIMIT 1')); - - // - if( $u->info['sex'] == 0 ) { - $text = '{u1} {u2} '; - }else{ - $text = '{u1} {u2} '; - } - if( isset($usr_real['id'])) { - $usrreal = ''; - if( $usr_real['align'] > 0 ) { - $usrreal .= ''; - } - if( $usr_real['clan'] > 0 ) { - $usrreal .= ''; - } - $usrreal .= ''.$usr_real['login'].'['.$usr_real['level'].']'; - }else{ - $mereal = '[??]'; - } - if( isset($me_real['id']) ) { - $mereal = ''; - if( $me_real['align'] > 0 ) { - $mereal .= ''; - } - if( $me_real['clan'] > 0 ) { - $mereal .= ''; - } - $mereal .= ''.$me_real['login'].'['.$me_real['level'].']'; - }else{ - $mereal = '[??]'; - } - $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().'", "'.$this->bs['id'].'", "'.$this->bs['count'].'", "'.$this->bs['city'].'", - "'.round($this->bs['money']*0.85,2).'","'.$i.'" - )'); - // - } - - $this->error = ' ... '; - }else{ - $this->error = ' ...'; - } - } - }else{ - $this->error = ' ...'; - } - }else{ - $this->error = ' , (id'.$id.') ...'; - } - } - } - - public function testDie() { - global $u,$c,$code; - $dies = mysql_fetch_assoc(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$u->info['dnow'].'" AND `vars` = "die" LIMIT 1')); - $dies = $dies[0]; - - - if( $u->stats['hpNow'] < 1 || $dies > 2 ) { - if( $dies < 2 ) { - mysql_query('INSERT INTO `dungeon_actions` (`dn`,`uid`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( - "'.$u->info['dnow'].'","'.$u->info['id'].'","'.$u->info['x'].'","'.$u->info['y'].'","'.time().'","die","" - )'); - //21:50 " 2 - " - $dnow = mysql_fetch_assoc(mysql_query('SELECT id2 FROM `dungeon_now` WHERE `id` = "'.$u->info['dnow'].'" LIMIT 1')); - $room = mysql_fetch_assoc(mysql_query('SELECT name FROM `dungeon_map_info` WHERE `x` = "'.$u->info['res_x'].'" AND `y` = "'.$u->info['res_y'].'" AND `id_dng` = "'.$dnow['id2'].'" LIMIT 1')); - - if( $u->info['sex'] == 0 ) { - $this->sys_chat(''.$u->info['login'].' "'.$room['name'].'"'); - }else{ - $this->sys_chat(''.$u->info['login'].' "'.$room['name'].'"'); - } - mysql_query('UPDATE `stats` SET `hpNow` = "1",`x` = "'.$u->info['res_x'].'",`y` = "'.$u->info['res_y'].'",`s` = "'.$u->info['res_s'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - //header('location: main.php'); - die(''); - }else{ - mysql_query('INSERT INTO `dungeon_actions` (`dn`,`uid`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( - "'.$u->info['dnow'].'","'.$u->info['id'].'","'.$u->info['x'].'","'.$u->info['y'].'","'.time().'","die","" - )'); - //21:50 " 2 - " - if( $u->info['sex'] == 0 ) { - $this->sys_chat(''.$u->info['login'].' '); - }else{ - $this->sys_chat(''.$u->info['login'].' '); - } - $_GET['exitd'] = true; - } - } - } - - // - public $itbs = array( - 0 => 558, - 1 => 722, - 2 => 718, - 3 => 700, - 4 => 291, - 5 => 545, - 6 => 533, - 7 => 536, - 8 => 628, - 9 => 710, - 10 => 654, - 11 => 684, - 12 => 689, - 13 => 552, - 14 => 552, - 15 => 716, - 16 => 320, - 17 => 290, - 18 => 543, - 19 => 528, - 20 => 540, - 21 => 627, - 22 => 709, - 23 => 653, - 24 => 681, - 25 => 687, - 26 => 523, - 27 => 523, - 28 => 712, - 29 => 1151, - 30 => 544, - 31 => 541, - 32 => 525, - 33 => 539, - 34 => 633, - 35 => 707, - 36 => 647, - 37 => 680, - 38 => 685, - 39 => 567, - 40 => 717, - 41 => 706, - 42 => 527, - 43 => 537, - 44 => 626, - 45 => 708, - 46 => 723, - 47 => 651, - 48 => 683, - 49 => 686, - 50 => 2862, - 51 => 2863, - 52 => 2864 - ); - public function sys_chat($rtxt) { - global $u; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$u->info['dnow']."','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1','1')"); - } - - public function takeit($id) { - global $u,$c,$code,$magic; - $obj = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_obj` WHERE `id` = "'.$id.'" AND `for_dn` = "0" AND `dn` = "'.$this->info['id'].'" LIMIT 1')); - if(isset($obj['id'])) { - $tbot = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_bots` WHERE `x` = "'.$obj['x'].'" AND `y` = "'.$obj['y'].'" AND `dn` = "'.$this->info['id'].'" AND `for_dn` = "0" AND `delete` = "0" LIMIT 1')); - - - $i = 0; - # { $act_sl['save_pos'] = "save_pos" } { $act_sl['port'] = "10:20" } - $act_sl = array(); - $act_sm = explode('|',$obj['action']); - while( $i < count($act_sm) ) { - $s = explode(':',$act_sm[$i]); - if(isset($s[1]) && $s[1] !='' ){ - $act_sl[$s[0]] = $s[1]; - } else { - $act_sl[$s[0]] = $s[0]; - } - $i++; - } - - if( isset($tbot['id2']) ) { - $this->error = ' , - - ...'; - } elseif($this->testLike($u->info['x'],$u->info['y'],$obj['x'],$obj['y'])!=1) { - $this->error = ' , ...!'; - } else { - $a = explode('|',$obj['action']); - $r = ''; - $i = 0; - while( $i < count($a) ) { - $s = explode(':',$a[$i]); - - if( $s[0] == 'kill_bot' ) { - // - $t = explode(',',$s[1]); - $tr_gd = 0; - - // - - $j = 1; $jn = 0; - while($j < count($t)) { - $itm = explode('.',$t[$j]); - //[0] - x , [1] - y - $bot_itm = mysql_fetch_assoc(mysql_query('SELECT `u`.`id2`,`st`.`login` FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE `u`.`dn` = "'.$u->info['dnow'].'" AND `u`.`x` = "'.$itm[0].'" AND `u`.`y` = "'.$itm[1].'" AND `u`.`delete` = "0" LIMIT 10')); - if(isset($bot_itm['id2'])){ - $jn++; - } - $j++; - } - - if($jn == 0) { - $tr_gd = 1; - } - - unset($itm,$bot_itm,$jn); - if($tr_gd == 0) { - if($t[0]=='0'){ - $r .= ' , - - ...'; - }else{ - $r .= $t[0]; - } - $i = count($a); - } - }elseif($s[0]=='kill_bot_d') { - // ( , - ) - $t = explode(',',$s[1]); - $tr_gd = 0; - - // - - $j = 1; $jn = 0; - $tuz = mysql_fetch_assoc(mysql_query('SELECT `x`,`y`,`id`,`hpNow` FROM `stats` WHERE `dnow` = "'.$this->info['id'].'" AND ( (`x` = '.($pl['x']+1).' AND `y` = '.($pl['y']).') OR (`x` = '.($pl['x']-1).' AND `y` = '.($pl['y']).') OR (`x` = '.($pl['x']).' AND `y` = '.($pl['y']+1).') OR (`x` = '.($pl['x']).' AND `y` = '.($pl['y']-1).') ) LIMIT 1')); - while($j < count($t)) { - $itm = explode('.',$t[$j]); - //[0] - x , [1] - y - $bot_itm_sp = mysql_query('SELECT `u`.*,`st`.* FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE `u`.`dn` = "'.$u->info['dnow'].'" AND `u`.`x` = "'.$itm[0].'" AND `u`.`y` = "'.$itm[1].'" AND `u`.`delete` = "0" LIMIT 50'); - while( $bot_itm = mysql_fetch_assoc($bot_itm_sp) ) { - $jn++; - $this->botAtack($bot_itm,$u->info,1); - } - $j++; - } - - if($jn == 0) { - $tr_gd = 1; - } - - unset($itm,$bot_itm,$jn); - if($tr_gd == 0) { - if($t[0]=='0'){ - $r .= ' , - - ...'; - }else{ - $r .= $t[0]; - } - $r .= ' !'; - $i = count($a); - } - }elseif($s[0]=='ditm') { - // - $j = 0; - $t = explode(',',$s[1]); - $tr_gd = 1; - while($j" (x'.$itm[1].') ...
'; - $j++; - } - }elseif($s[0]=='tritm') { - // - $j = 0; - $t = explode(',',$s[1]); - $j = 0; - $tr_gd = 1; - while($j" (x'.$itm[1].')
'; - } - $j++; - } - if(rand(0,10000)>$itm[2]*100) { - $tr_gd = 0; - $r .= ', ...
'; - } - if($tr_gd == 1) { - // - }else{ - $i = count($a); - } - } elseif($s[0] == 'repl_ptp') { - require_once('dnaction/_dungeon_replace.php'); - die(); - //header('Location: ../../modules_data/location/_dungeon_replace.php'); - }elseif($s[0]=='add_eff') { - // - $t = explode(',',$s[1]); - $j = 0; - while($jtestAction('`vars` = "add_eff_'.$this->info['id'].'_'.$obj['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT '.(1+(int)$itm[2]).'',2); //- - $ch = $ch[0]; - $ch2 = $u->testAction(' `vars` = "add_eff_'.$this->info['id'].'_'.$obj['id'].'" LIMIT '.(1+(int)$itm[4]).'',2); //- ( ) - $ch2 = $ch2[0]; - if(($ch2 < $itm[4] || $itm[4]==0) && $ch < $itm[2]) { - if($itm[1]*100 >= rand(0,10000)) { - // - $eff_d = mysql_fetch_assoc(mysql_query('SELECT `id2`,`mname` FROM `eff_main` WHERE `id2` = "'.$itm[0].'" LIMIT 1')); - if(isset($eff_d['id2'])) { - // - $us = $magic->add_eff($u->info['id'],$itm[0],1); - if($us[0]==1) { - $r .= '
"'.$eff_d['mname'].'".
'; - }else{ - $r .= '
- ... - ...
'; - } - }else{ - $r .= '
- ... - ...
'; - } - unset($eff_d,$us); - }else{ - // - $r .= '
...
'; - } - $u->addAction(time(),'add_eff_'.$this->info['id'].'_'.$obj['id'],$u->info['city']); - }else{ - // - $r .= '
- ...
'; - } - - unset($ch,$ch2); - $j++; - } - }elseif($s[0]=='mfast') { - // // - $j = 0; - $t = explode(',',$s[1]); - while($jtestAction('`vars` = "bafit_'.$this->info['id'].'_'.$obj['id'].'" LIMIT '.(1+(int)$itm[2]).'',2); //- - $ch = $ch[0]; - if($ch<$itm[3]) - { - if($itm[2]*1000>=rand(1,100000)) - { - if($itm[0] == 'hpNow') { - $mm = explode('r',$itm[1]); - if($mm[1]!=0) { - $itm[1] = rand($mm[0],$mm[1]); - } - if($itm[1]<0) { - $r .= '
... : '.$itm[1].' HP
'; - }elseif($itm[1]>0){ - $r .= '
... : +'.$itm[1].' HP
'; - } - $u->info['hpNow'] += $itm[1]; - if($u->info['hpNow']<1) { - $r .= '
...
'; - mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->info['hpNow'].'",`x` = "'.$u->info['res_x'].'",`y` = "'.$u->info['res_y'].'",`s` = "'.$u->info['res_s'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - }else{ - mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->info['hpNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - } - $u->addAction(time(),'bafit_'.$this->info['id'].'_'.$obj['id'],$u->info['city']); - } - // - $j++; - } - }elseif($s[0]=='save_pos') { - if( isset($act_sl['port']) ) { - $itm = explode('=',$act_sl['port']); - $obj['x'] = $itm[0]; - $obj['y'] = $itm[1]; - } - #$r .= ' . .'; - mysql_query('UPDATE `stats` SET `res_x` = "'.$obj['x'].'",`res_y` = "'.$obj['y'].'",`res_s` = "'.$u->info['s'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - }elseif($s[0]=='look_text') { - $itm = explode('=',$s[1]); - $r .= $itm[rand(0,count($itm)-1)]; - }elseif($s[0]=='save_pos_xy'){ - $itm = explode('=',$s[1]); - $u->info['res_x'] = $itm[0]; - $u->info['res_y'] = $itm[1]; - $upd = mysql_query('UPDATE `stats` SET `res_x` = "'.$u->info['x'].'",`res_y` = "'.$u->info['y'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($upd){ - $r .= ' - ... ...
'; - }else{ - $r .= '- ...'; - } - }elseif($s[0]=='port'){ - // - $itm = explode('=',$s[1]); - $u->info['x'] = $itm[0]; - $u->info['y'] = $itm[1]; - $upd = mysql_query('UPDATE `stats` SET - `x` = "'.$u->info['x'].'",`y` = "'.$u->info['y'].'" - WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($upd) - { - $r .= ' - ... ...
'; - }else{ - $r .= '- ...'; - } - } elseif($s[0] == 'save_port') { - $itm = explode('=', $s[1]); - $u->info['res_x'] = $itm[0]; - $u->info['res_y'] = $itm[1]; - $upd = mysql_query('UPDATE `stats` SET `res_x` = "'.$u->info['res_x'].'", `res_y` = "'.$u->info['res_y'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } elseif($s[0]=='itm') - { - // - $j = 0; - $t = explode(',',$s[1]); - while($jtestAction('`uid` = "'.$u->info['id'].'" AND `vars` = "takeit_'.$this->info['id'].'_'.$obj['id'].'" LIMIT '.(1+(int)$itm[2]).'',2); //- - $ch = $ch[0]; - if($ch>=$itm[2]) - { - // - $r = ' ...
'; - }else{ - if($itm[1]*1000>=rand(1,100000)) - { - - // ( ) - if($itm[0] == 'random1') { - $itm[0] = $this->itbs[rand(0,count($this->itbs))]; - } - - // - $it = mysql_fetch_assoc(mysql_query('SELECT * FROM `items_main` WHERE `id`="'.((int)$itm[0]).'" LIMIT 1')); - if(isset($it['id'])) - { - $r .= ' "'.$it['name'].'".
'; - $this->addItem(array('uid'=>$u->info['id'],'iid'=>$it['id'],'time'=>time(),'x'=>$u->info['x'],'y'=>$u->info['y'],'bid'=>0,'del'=>(int)$itm[4])); - } - }else{ - // - $r .= ' ...
'; - } - $u->addAction(time(),'takeit_'.$this->info['id'].'_'.$obj['id'],$u->info['city']); - } - // - $j++; - } - }elseif($s[0]=='itm1') - { - // , 1 - $nj = 0; - $t = explode(',',$s[1]); - $j = rand(0,count($t)); - if($nj == 0) { - $itm = explode('=',$t[$j]); - $ch = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "takeit_'.$this->info['id'].'_'.$obj['id'].'" LIMIT '.(1+(int)$itm[2]).'',2); //- - $ch = $ch[0]; - if($ch>=$itm[2]) - { - // - $r .= ', ...
'; - }else{ - if($itm[1]*1000>=rand(1,100000)) - { - - // ( ) - if($itm[0] == 'random1') { - $itm[0] = $this->itbs[rand(0,count($this->itbs))]; - } - - // - $it = mysql_fetch_assoc(mysql_query('SELECT * FROM `items_main` WHERE `id`="'.((int)$itm[0]).'" LIMIT 1')); - if(isset($it['id'])) - { - $r .= ' "'.$it['name'].'".
'; - $u->addAction(time(),'takeit_'.$this->info['id'].'_'.$obj['id'],$u->info['city']); - $this->addItem(array('uid'=>$u->info['id'],'iid'=>$it['id'],'time'=>time(),'x'=>$u->info['x'],'y'=>$u->info['y'],'bid'=>0,'del'=>(int)$itm[4])); - $nj++; - } - }else{ - // - $u->addAction(time(),'takeit_'.$this->info['id'].'_'.$obj['id'],$u->info['city']); - $r .= ' ...
'; - } - } - } - }elseif($s[0]=='itm2') - { - // , 1 1 - $nj = 0; - $t = explode(',',$s[1]); - $j = rand(0,count($t)-1); - if($nj == 0) { - $itm = explode('=',$t[$j]); - $ch = $u->testAction('`vars` = "takeit_'.$this->info['id'].'_'.$obj['id'].'" LIMIT '.(1+(int)$itm[2]).'',2); //- - $ch = $ch[0]; - if($ch>=$itm[2]) - { - // - $r .= ' ...
'; - }else{ - if($itm[1]*1000>=rand(1,100000)) - { - - // ( ) - if($itm[0] == 'random1') { - $itm[0] = $this->itbs[rand(0,count($this->itbs))]; - } - - // - $it = mysql_fetch_assoc(mysql_query('SELECT * FROM `items_main` WHERE `id`="'.((int)$itm[0]).'" LIMIT 1')); - if(isset($it['id'])) - { - $r .= ' "'.$it['name'].'".
'; - $u->addAction(time(),'takeit_'.$this->info['id'].'_'.$obj['id'],$u->info['city']); - $this->addItem(array('uid'=>$u->info['id'],'iid'=>$it['id'],'time'=>time(),'x'=>$u->info['x'],'y'=>$u->info['y'],'bid'=>0,'del'=>(int)$itm[4])); - $nj++; - } - }else{ - // - $u->addAction(time(),'takeit_'.$this->info['id'].'_'.$obj['id'],$u->info['city']); - $r .= ' ...
'; - } - } - } - }elseif($s[0]=='fileact') { - require('dnaction/'.$s[1].'.php'); - } - $i++; - } - $r = rtrim($r,'\'); - if($r=='') - { - $r = ' - '; - } - $this->error = $r; - } - }else{ - $this->error = ' ...'; - } - } - - public function addItem($i) - { - // ( ) - $ins = mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`bot`,`del`) VALUES ("'.$this->info['id'].'","'.$i['uid'].'","'.$i['iid'].'","'.$i['time'].'","'.$i['x'].'","'.$i['y'].'","'.$i['bid'].'","'.((int)$i['del']).'")'); - return $ins; - } - - public function takeinv($id) - { - global $u,$c,$code; - $obj = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_items` WHERE `id` = "'.$id.'" AND `for_dn` = "0" AND `dn` = "'.$this->info['id'].'" LIMIT 1')); - if(isset($obj['id'])) - { - $this->test_luck($id); - $fxv = array( - 'luck_count' => mysql_fetch_assoc(mysql_query('SELECT COUNT(*) FROM `dungeon_actions` WHERE `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($id).'" LIMIT 1')), - 'user_count' => mysql_fetch_assoc(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dnow` = "'.$this->info['id'].'" LIMIT 1')) - ); - if($obj['user'] == 0 && $fxv['user_count'][0] > $fxv['luck_count'][0] && $fxv['user_count'][0] > 1 && $this->info['bsid'] == 0 ) { - $this->error = ' , . '.$u->timeOut($obj['time']-time()+300); - }elseif($u->info['x']!=$obj['x'] || $obj['y']!=$u->info['y']) - { - $this->error = ' ...'; - }else{ - if($obj['take']>0) - { - $this->error = '- ...'; - }else{ - if($obj['user']>0 && $obj['user']!=$u->info['id'] && $obj['time']>time()-300) - { - $uo = mysql_fetch_assoc(mysql_query('SELECT `id`,`login`,`sex` FROM `users` WHERE `id` = "'.$obj['user'].'" LIMIT 1')); - } - if(isset($uo['id'])) - { - $this->error = ' "'.$uo['login'].'". , '; - if($uo['sex']==1) - { - $this->error .= ' '; - }else{ - $this->error .= ' '; - } - $this->error .= ' '.ceil(5-(time()-$obj['time'])/60).' .'; - unset($uo); - }else{ - $upd = mysql_query('UPDATE `dungeon_items` SET `take` = "'.$u->info['id'].'" WHERE `id` = "'.$obj['id'].'" LIMIT 1'); - if($upd){ - $it = mysql_fetch_assoc(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$obj['item_id'].'" LIMIT 1')); - if(isset($it['id'])){ - $data = '|noremont=1|frompisher='.$this->info['id2']; - if($it['ts']!=0){ - $data .= '|sudba='.$u->info['login']; - } - if($obj['data'] != '') { - $data .= $obj['data']; - } - $data = str_replace('|sudba=-1','|sudba='.$u->info['login'].'',$data); - - $idl = $u->addItem($obj['item_id'],$u->info['id'],$data,$obj); - if( $obj['del'] > 0 ) { - mysql_query('UPDATE `items_users` SET `dn_delete` = 1 WHERE `id` = "'.$idl.'" LIMIT 1'); - } - unset($idl); - - if($this->info['bsid'] == 0) { - $rtxt = ''.$u->info['login'].' "'.$it['name'].'"'; - if( $obj['quest'] > 0 ) { - $rtxt .= ' ()'; - } - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$u->info['dnow']."','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1','1')"); - } - - $this->error = ' "'.$it['name'].'"'; - }else{ - $this->error = ' ...'; - } - }else{ - $this->error = ' ...'; - } - } - } - } - } - } - - - // - public function test_luck($id) { - global $u; - $fxv = array( - 'itm' => mysql_fetch_assoc(mysql_query('SELECT `im`.*,`ish`.* FROM `dungeon_items` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`dn` = "'.$this->info['id'].'" AND `ish`.`id` = "'.mysql_real_escape_string($id).'" AND `ish`.`take` = "0" AND `ish`.`delete` = "0" AND `ish`.`x` = "'.$u->info['x'].'" AND `ish`.`y` = "'.$u->info['y'].'" LIMIT 1')), - 'luck_count' => mysql_fetch_assoc(mysql_query('SELECT COUNT(*) FROM `dungeon_actions` WHERE `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($id).'" LIMIT 1')), - 'user_count' => mysql_fetch_assoc(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dnow` = "'.$this->info['id'].'" LIMIT 1')) - ); - $fxv['luck_count'] = $fxv['luck_count'][0]; - $fxv['user_count'] = $fxv['user_count'][0]; - - if( $fxv['itm']['user'] > 0 ) { - - }elseif( $fxv['luck_count'] >= $fxv['user_count'] || $fxv['itm']['time']+300 < time() ) { - $fxv['sp'] = mysql_query('SELECT * FROM `dungeon_actions` WHERE `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($id).'" ORDER BY `vals` DESC LIMIT '.$fxv['luck_count'].''); - $fxv['winner'] = array(); - $fxv['win_val'] = 0; - unset($fxv['pl'],$fxv['sp']); - if( count($fxv['winner']) > 1 ) { - // - $this->error .= '
!
'; - }elseif(count($fxv['winner']) == 1) { - $fxv['user_win'] = mysql_fetch_assoc(mysql_query('SELECT `id`,`login`,`sex` FROM `users` WHERE `id` = "'.$fxv['winner'][0].'" LIMIT 1')); - $fxv['text'] = ''.$fxv['user_win']['login'].' "'.$fxv['itm']['name'].'"'; - $this->sys_chat($fxv['text']); - mysql_query('UPDATE `dungeon_items` SET `time` = "'.time().'",`user` = "'.$fxv['user_win']['id'].'" WHERE `id` = "'.$fxv['itm']['id'].'" LIMIT 1'); - $this->error .= '
! '.$fxv['user_win']['login'].'!
'; - } - }else{ - $this->error .= '
'.$u->timeOut($fxv['itm']['time']+300-time()).' .
'; - } - unset($fxv); - } - - public function itm_luck($id) { - global $u; - $fxv = array( - 'itm' => mysql_fetch_assoc(mysql_query('SELECT `im`.*,`ish`.* FROM `dungeon_items` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`dn` = "'.$this->info['id'].'" AND `ish`.`id` = "'.mysql_real_escape_string($id).'" AND `ish`.`take` = "0" AND `ish`.`delete` = "0" AND `ish`.`x` = "'.$u->info['x'].'" AND `ish`.`y` = "'.$u->info['y'].'" LIMIT 1')), - 'luck' => mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($id).'" LIMIT 1')), - 'luck2' => mysql_fetch_assoc(mysql_query('SELECT COUNT(*) FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($id).'" LIMIT 1')) - ); - if( $u->stats['silver'] >= 3 ) { // - $fxv['luck2'][0]--; - } - if( $fxv['itm']['user'] > 0 ) { - $this->error = ' ...'; - }elseif( !isset($fxv['itm']['id']) ) { - $this->error .= '
'; - }elseif( $fxv['luck2'][0] > 0 ) { - $this->error .= '
"'.$fxv['itm']['name'].'", '.$u->timeOut($fxv['itm']['time']-time()+300).'
'; - }else{ - $luck_users = mysql_fetch_assoc(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($id).'" LIMIT 1')); - $luck_users = $luck_users[0]; - if( $luck_users < 1 ) { - mysql_query('UPDATE `dungeon_items` SET `time` = "'.time().'" WHERE `id` = "'.$fxv['itm']['id'].'" LIMIT 1'); - } - $rndl = rand(1,100); - mysql_query('INSERT INTO `dungeon_actions` (`uid`,`dn`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( - "'.$u->info['id'].'","'.$u->info['dnow'].'","'.$u->info['x'].'","'.$u->info['y'].'","'.time().'", - "luck_itm'.mysql_real_escape_string($id).'","'.$rndl.'" - )'); - if( $u->info['sex'] == 0 ) { - $fxv['text'] = ''.$u->info['login'].' *'.$rndl.'* "'.$fxv['itm']['name'].'"'; - }else{ - $fxv['text'] = ''.$u->info['login'].' *'.$rndl.'* "'.$fxv['itm']['name'].'"'; - } - $this->sys_chat($fxv['text']); - $this->error .= '
'.$rndl.' "'.$fxv['itm']['name'].'"
'; - } - $this->test_luck($id); - unset($fxv); - } - - public function itm_unluck($id) { - global $u; - $fxv = array( - 'itm' => mysql_fetch_assoc(mysql_query('SELECT `im`.*,`ish`.* FROM `dungeon_items` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`dn` = "'.$this->info['id'].'" AND `ish`.`id` = "'.mysql_real_escape_string($id).'" AND `ish`.`take` = "0" AND `ish`.`delete` = "0" AND `ish`.`x` = "'.$u->info['x'].'" AND `ish`.`y` = "'.$u->info['y'].'" LIMIT 1')), - 'luck' => mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($id).'" LIMIT 1')) - ); - if( $fxv['itm']['user'] > 0 ) { - $this->error = ' ...'; - }elseif( !isset($fxv['itm']['id']) ) { - $this->error .= '
'; - }elseif( isset($fxv['luck']['id']) ) { - if( $fxv['luck']['vals'] == 0 ) { - $this->error .= '
"'.$fxv['itm']['name'].'"
'; - }else{ - $this->error .= '
"'.$fxv['itm']['name'].'", '.$u->timeOut($fxv['itm']['time']-time()+300).'
'; - } - }else{ - $luck_users = mysql_fetch_assoc(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($id).'" LIMIT 1')); - $luck_users = $luck_users[0]; - if( $luck_users < 1 ) { - mysql_query('UPDATE `dungeon_items` SET `time` = "'.time().'" WHERE `id` = "'.$fxv['itm']['id'].'" LIMIT 1'); - } - if( $u->info['sex'] == 0 ) { - $fxv['text'] = ''.$u->info['login'].' "'.$fxv['itm']['name'].'"'; - }else{ - $fxv['text'] = ''.$u->info['login'].' "'.$fxv['itm']['name'].'"'; - } - $this->sys_chat($fxv['text']); - mysql_query('INSERT INTO `dungeon_actions` (`uid`,`dn`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( - "'.$u->info['id'].'","'.$u->info['dnow'].'","'.$u->info['x'].'","'.$u->info['y'].'","'.time().'", - "luck_itm'.mysql_real_escape_string($id).'","0" - )'); - $this->error .= '
"'.$fxv['itm']['name'].'"
'; - } - unset($fxv); - } - - public function itemsMap() - { - global $u,$c,$code; - $r = ''; - $live_users = mysql_fetch_assoc(mysql_query('SELECT COUNT(`id`) FROM `stats` WHERE `dnow` = "'.$this->info['id'].'" LIMIT 1')); - $live_users = $live_users[0]; - $sp = mysql_query('SELECT `im`.*,`ish`.* FROM `dungeon_items` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`dn` = "'.$this->info['id'].'" AND `ish`.`take` = "0" AND `ish`.`delete` = "0" AND ( `ish`.`onlyfor` = "0" OR `ish`.`onlyfor` = "'.$u->info['id'].'" ) AND `ish`.`x` = "'.$u->info['x'].'" AND `ish`.`y` = "'.$u->info['y'].'" LIMIT 100'); - while($pl = mysql_fetch_assoc($sp)) - { - $action = 'main.php?take='.$pl['id'].''; $tk = 0; - $luck_users = mysql_fetch_assoc(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($pl['id']).'" LIMIT 1')); - $luck_users = $luck_users[0]; - if( $pl['user'] == 0 && $live_users > 1 && ( $pl['time']+300 > time() || $luck_users < 1 ) ) { - $fxv = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$this->info['id'].'" AND `vars` = "luck_itm'.$pl['id'].'" LIMIT 1')); - if( !isset($fxv['id']) ) { - // - if( $this->info['bsid'] == 0 ) { - $action = 'javascript: top.fartgame(\''.$pl['id'].'\',\''.$pl['img'].'\',\''.$pl['name'].'\',1,\'\');'; - $tk = 1; - } - }else{ - //$action = 'javascript:alert(\' \');'; - } - } - //href="'.$action.'" - if($tk == 0) { - $r .= ''; - } elseif($tk == 1) { - $r .= ''; - } - } - if($r!='') - { - $r = '

:

'.$r; //

- } - return $r; - } - - public function testLike($x1,$y1,$x2,$y2) - { - // $x1,$y1 $x2,$y2 - //- - $r = 0; - $c1 = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$x1.'" AND `y` = "'.$y1.'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - $c2 = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$x2.'" AND `y` = "'.$y2.'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - if(isset($c1['id']) && isset($c2['id'])) - { - if($x1==$x2 && $y1==$y2) - { - $r = 1; - }elseif($x1==$x2-1 && $c1['go_1']==1) // - { - $r = 1; - }elseif($x1==$x2+1 && $c1['go_2']==1) // - { - $r = 1; - }elseif($y1==$y2-1 && $c1['go_3']==1) // - { - $r = 1; - }elseif($y1==$y2+1 && $c1['go_4']==1) // - { - $r = 1; - } - } - return $r; - } - - public function genObjects() { - global $u,$c,$code; - ////i:{id,name,mapPoint,action,img,type}, - //'count':1,0:{0:1234,1:'',2:5,3:'',4:'test.gif',5:0,6:position,7:width,8:heigh,9:left,10:top}, - //psition 0 - , 1- , 2- , 3- , 4- - $r = ''; - $whr = array( - 1 => ' (((`u`.`x` <= '.($u->info['x']+2).' && `u`.`x` >= '.($u->info['x']-2).') && (`u`.`y` >= '.($u->info['y']+1).' && `u`.`y` <= '.($u->info['y']+4).')) OR (`u`.`y` = '.$u->info['y'].' && `u`.`x` = '.$u->info['x'].')) ', // - 3 => ' (((`u`.`x` <= '.($u->info['x']+2).' && `u`.`x` >= '.($u->info['x']-2).') && (`u`.`y` <= '.($u->info['y']-1).' && `u`.`y` >= '.($u->info['y']-4).')) OR (`u`.`y` = '.$u->info['y'].' && `u`.`x` = '.$u->info['x'].')) ', // - 2 => ' (((`u`.`x` <= '.($u->info['x']-1).' && `u`.`x` >= '.($u->info['x']-4).') && (`u`.`y` <= '.($u->info['y']+2).' && `u`.`y` >= '.($u->info['y']-2).'))OR (`u`.`y` = '.$u->info['y'].' && `u`.`x` = '.$u->info['x'].')) ', // - 4 => ' (((`u`.`x` >= '.($u->info['x']+1).' && `u`.`x` <= '.($u->info['x']+4).') && (`u`.`y` <= '.($u->info['y']+2).' && `u`.`y` >= '.($u->info['y']-2).')) OR (`u`.`y` = '.$u->info['y'].' && `u`.`x` = '.$u->info['x'].')) ' // - ); - $sp = mysql_query('SELECT `u`.* FROM `dungeon_obj` AS `u` WHERE `u`.`dn` = "'.$u->info['dnow'].'" AND `u`.`for_dn` = "0" AND ((`u`.`s` = "0" OR `u`.`s` = "'.$this->gs.'") OR `u`.`s2` = "'.$this->gs.'") AND '.$whr[$this->gs].' LIMIT 150'); - $i = 0; $pos = array(); - while( $pl = mysql_fetch_assoc($sp) ) { - if($pl['fix_x_y'] == 0 || - ($pl['fix_x_y'] == 1 && $pl['x'] == $u->info['x']) || - ($pl['fix_x_y'] == 2 && $pl['y'] == $u->info['y']) || - ($pl['fix_x_y'] == 3 && $pl['x'] == $u->info['x'] && $pl['y'] == $u->info['y'])) { - if(($pl['os1']==0 && $pl['os2']==0 && $pl['os3']==0 && $pl['os4']==0) || ($this->cord[$pl['y'].'_'.$pl['x']] == $pl['os1'] || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os2'] || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os3'] || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os4'])) { - $i++; if(!isset($pos[$this->cord[$pl['y'].'_'.$pl['x']]])){ $pos[$this->cord[$pl['y'].'_'.$pl['x']]] = 0; } $pos[$this->cord[$pl['y'].'_'.$pl['x']]]++; - $r .= ','.($i-1).':{0:'.$pl['id'].',1:\''.$pl['name'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:\'action\',4:\''.$pl['img'].'\',5:'.$pl['type'].',6:0,7:'.$pl['w'].',8:'.$pl['h'].',9:'.$pl['left'].',10:'.$pl['top'].',11:'.$pl['date'].'}'; - }elseif( $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os1']-1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os2']-1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os3']-1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os4']-1 ) { - $dt2 = explode(',',ltrim(rtrim($pl['date'],'\}'),'\{')); - $da = array(); - $is = 0; - while($is < count($dt2)) { - $dt2[$is] = explode(':',$dt2[$is]); - $da[$dt2[$is][0]] = $dt2[$is][1]; - $is++; - } - if(isset($da['use'])) unset($da['use']); // - if(isset($da['rl2']))$da['rl2'] = -round((int)$da['rl2'] * 1.55); // - if(isset($da['rl3']))$da['rl3'] = round((int)$da['rl3'] +160); - if(isset($da['rl4']))$da['rl4'] = round((int)$da['rl4'] -120); - $pl['date'] = str_replace('"', '', json_encode($da)); - - - $i++; if(!isset($pos[$this->cord[$pl['y'].'_'.$pl['x']]])){ $pos[$this->cord[$pl['y'].'_'.$pl['x']]] = 0; } $pos[$this->cord[$pl['y'].'_'.$pl['x']]]++; - $r .= ','.($i-1).':{0:'.$pl['id'].',1:\''.$pl['name'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:\'\',4:\''.$pl['img'].'\',5:'.$pl['type'].',6:0,7:'.$pl['w'].',8:'.$pl['h'].',9:'.$pl['left'].',10:'.$pl['top'].',11:'.$pl['date'].'}'; - } else if( $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os1']+1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os2']+1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os3']+1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os4']+1 ) { - - $dt2 = explode(',',ltrim(rtrim($pl['date'],'\}'),'\{')); - $da = array(); - $is = 0; - while($is < count($dt2)) { - $dt2[$is] = explode(':',$dt2[$is]); - $da[$dt2[$is][0]] = $dt2[$is][1]; - $is++; - } - if(isset($da['use'])) unset($da['use']); // - if(isset($da['rl2']))$da['rl2'] = 355-round((int)$da['rl2'] * 0.30); // - if(isset($da['rl3']))$da['rl3'] = round((int)$da['rl3'] -160); - if(isset($da['rl4']))$da['rl4'] = round((int)$da['rl4'] +120); - $pl['date'] = str_replace('"', '', json_encode($da)); - $i++; if(!isset($pos[$this->cord[$pl['y'].'_'.$pl['x']]])){ $pos[$this->cord[$pl['y'].'_'.$pl['x']]] = 0; } $pos[$this->cord[$pl['y'].'_'.$pl['x']]]++; - $r .= ','.($i-1).':{0:'.$pl['id'].',1:\''.$pl['name'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:\'\',4:\''.$pl['img'].'\',5:'.$pl['type'].',6:0,7:'.$pl['w'].',8:'.$pl['h'].',9:'.$pl['left'].',10:'.$pl['top'].',11:'.$pl['date'].'}'; - } - } - } - $r = 'count:'.$i.$r; - return $r; - } - - public function botAtack($bot,$uid,$bs) { - global $u,$c,$code; - $user = mysql_fetch_assoc(mysql_query('SELECT `id`,`battle` FROM `users` WHERE `id` = "'.$uid['id'].'" LIMIT 1')); - - if($user['battle']>0){ - $btli = mysql_fetch_assoc(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" AND `team_win` = "-1" LIMIT 1')); - } - - if( !isset($btli['id']) ) { // - $btl_id = 0; - $expB = 0; - $btl = array('players'=>'', 'timeout'=>120, '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 ("'.$this->info['id2'].'", "'.$this->info['id'].'", "'.$bot['x'].'", "'.$bot['y'].'", "'.$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(); - - if( $btl_id > 0 ) { // - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "0" AND `delete` = "0" AND `dn` = "'.$this->info['id'].'" AND `id2` = "'.$bot['id2'].'" LIMIT 1'); // , ? - $j = 0; - $logins_bot = array(); - while($pl = mysql_fetch_assoc($sp)) { - mysql_query('UPDATE `dungeon_bots` SET `inBattle` = "'.$btl_id.'" WHERE `id2` = "'.$bot['id2'].'" LIMIT 1'); - $jui = 1; - while($jui<=$pl['colvo']) { - $k = $u->addNewbot($pl['id_bot'],NULL,NULL,$logins_bot); - $logins_bot = $k['logins_bot']; - if( $k!=false ) { - $upd = mysql_query('UPDATE `users` SET `battle` = "'.$btl_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++; - } - } - } - $jui++; - } - } - unset($logins_bot); - if( $j>0 ) { - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - } - } - } else { - $btl_id = $btli['id']; - // - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "0" AND `delete` = "0" AND `dn` = "'.$this->info['id'].'" AND `id2` = "'.$bot['id2'].'" LIMIT 1'); - $j = 0; $logins_bot = array(); - $logins_bot_text =array(); - $logins_bot_vars =array('time1='.time().''); - while( $pl = mysql_fetch_assoc($sp) ) { - mysql_query('UPDATE `dungeon_bots` SET `inBattle` = "'.$btl_id.'" WHERE `id2` = "'.$bot['id2'].'" LIMIT 1'); - $jui = 1; - while($jui<=$pl['colvo']){ - $k = $u->addNewbot($pl['id_bot'],NULL,NULL,$logins_bot); - $logins_bot = $k['logins_bot']; - $logins_bot_text[] = ' '.$k['login'].''; - if($k!=false){ - $upd = mysql_query('UPDATE `users` SET `battle` = "'.$btl_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++; - } - } - } - $jui++; - } - if( $j>0 ){ - $logins_bot_text = '{tm1} : '.implode(', ',$logins_bot_text).'.'; - $logins_bot_vars = implode('||',$logins_bot_vars); - $battle_log = mysql_fetch_assoc(mysql_query('SELECT * FROM `battle_logs` WHERE `battle`='.$btl_id.' ORDER BY `id_hod` DESC LIMIT 1')); - if($battle_log['id_hod']>0){ - mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$btl_id.'","'.($battle_log['id_hod']+1).'","'.$logins_bot_text.'","'.$logins_bot_vars.'","","","","",1)'); - } - } - } - unset($logins_bot); - if( $j > 0 ) { - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - } - } - } - - public function genUsers() { - global $u,$c,$code; - ////i:{id,login,mapPoint,sex,obraz,type,users_p}, - //'count':1,0:{0:1015,1:'Test1',2:5,3:0,4:'1',5:'user',6:1}, - $r = ''; - $whr = array( - 1 => ' ((`u`.`x` <= '.($u->info['x']+2).' && `u`.`x` >= '.($u->info['x']-2).') && (`u`.`y` >= '.$u->info['y'].' && `u`.`y` <= '.($u->info['y']+4).')) ', // - 3 => ' ((`u`.`x` <= '.($u->info['x']+2).' && `u`.`x` >= '.($u->info['x']-2).') && (`u`.`y` <= '.$u->info['y'].' && `u`.`y` >= '.($u->info['y']-4).')) ', // - 2 => ' ((`u`.`x` <= '.$u->info['x'].' && `u`.`x` >= '.($u->info['x']-4).') && (`u`.`y` <= '.($u->info['y']+2).' && `u`.`y` >= '.($u->info['y']-2).')) ', // - 4 => ' ((`u`.`x` >= '.$u->info['x'].' && `u`.`x` <= '.($u->info['x']+4).') && (`u`.`y` <= '.($u->info['y']+2).' && `u`.`y` >= '.($u->info['y']-2).')) ' // - ); - // - $tmsu = mysql_fetch_assoc(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "'.$u->info['id'].'" LIMIT 1')); - // - $sp = mysql_query('SELECT `u`.*,`st`.* FROM `stats` AS `u` LEFT JOIN `users` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`dnow` = "'.$u->info['dnow'].'" AND '.$whr[$this->gs].' AND `u`.`id` != "'.$u->info['id'].'" LIMIT 100'); - $i = 0; $pos = array(); - while($pl = mysql_fetch_assoc($sp)){ - $i++; if(!isset($pos[$this->cord[$pl['y'].'_'.$pl['x']]])){ $pos[$this->cord[$pl['y'].'_'.$pl['x']]] = 0; } $pos[$this->cord[$pl['y'].'_'.$pl['x']]]++; - $noat = 0; - if( $this->info['bsid'] > 0 ) { - $noat = 1; - } - if( $this->info['id2'] == 15 ) { - // - $r .= ','.($i-1).':{8:'.$noat.',0:'.$pl['id'].',1:\''.$pl['login'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:'.$pl['sex'].',4:\''.str_replace('.gif','',$pl['obraz']).'\',5:\'user\',6:'.$pos[$this->cord[$pl['y'].'_'.$pl['x']]].''; - // - $tms = mysql_fetch_assoc(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "'.$pl['id'].'" LIMIT 1')); - if($tms['team'] == $tmsu['team']) { - $r .= ',9:1'; - }else{ - $r .= ',9:2'; - } - $r .= ''; - // - $r .= '}'; - }else{ - $r .= ','.($i-1).':{9:0,8:'.$noat.',0:'.$pl['id'].',1:\''.$pl['login'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:'.$pl['sex'].',4:\''.str_replace('.gif','',$pl['obraz']).'\',5:\'user\',6:'.$pos[$this->cord[$pl['y'].'_'.$pl['x']]].'}'; - } - } - - // - // - //$sp = mysql_query('SELECT `u`.*,`st`.* FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE `u`.`dn` = "'.$u->info['dnow'].'" AND `u`.`atack` = "0" AND `u`.`delete` = "0" AND `u`.`inBattle` = "0" AND `u`.`go_bot` > 0 ORDER BY `u`.`go_bot` ASC LIMIT 35'); - - // , , , -\+30 X -\+35 Y ( , ). - - $sp = mysql_query('SELECT `db`.*, `tb`.* FROM `dungeon_bots` AS `db` LEFT JOIN `test_bot` AS `tb` ON (`db`.`id_bot` = `tb`.`id`) LEFT JOIN `stats` as `st` ON (`st`.`dnow` = `db`.`dn`) WHERE `db`.`dn` = "'.$u->info['dnow'].'" AND `db`.`x` > `st`.`x`-30 AND `db`.`x` < `st`.`x`+30 AND `db`.`y` > `st`.`y`-35 AND `db`.`y` < `st`.`y`+35 AND `db`.`atack` = "0" AND `db`.`delete` = "0" AND `db`.`inBattle` = "0" AND `db`.`go_bot` > 0 GROUP BY `db`.`id2` ORDER BY `db`.`go_bot` ASC LIMIT 100'); - while($pl = mysql_fetch_assoc($sp)){ - // , 3-10 . - if( $pl['go_bot'] > 0 && $pl['go_bot'] <= time() ) { - $tgx = rand(-1,1); - $tgy = rand(-1,1); - if($tgx!=0 && $tgy!=0) { - if(rand(0,1)==1){ - $tgy = 0; - }else{ - $tgx = 0; - } - } - $vlb = $this->testLike($pl['x'],$pl['y'],$pl['x']+$tgx,$pl['y']+$tgy); - //- - $tuz = mysql_fetch_assoc(mysql_query('SELECT `x`,`y`,`id`,`hpNow` FROM `stats` WHERE `dnow` = "'.$this->info['id'].'" AND ( (`x` = '.($pl['x']+1).' AND `y` = '.($pl['y']).') OR (`x` = '.($pl['x']-1).' AND `y` = '.($pl['y']).') OR (`x` = '.($pl['x']).' AND `y` = '.($pl['y']+1).') OR (`x` = '.($pl['x']).' AND `y` = '.($pl['y']-1).') ) LIMIT 1')); - - if(isset($tuz['id']) && $this->testLike($pl['x'],$pl['y'],$tuz['x'],$tuz['y'])==1){ - $tuz['x']=$pl['x']; - $tuz['y']=$pl['y']; - mysql_query('UPDATE `stats` SET `x` = "'.$tuz['x'].'" , `y` = "'.$tuz['y'].'" WHERE `id` = "'.$tuz['id'].'" LIMIT 1'); - $this->botAtack($pl,$tuz,1);// - $sps = mysql_query('SELECT `db`.*, `tb`.* FROM `dungeon_bots` AS `db` LEFT JOIN `test_bot` AS `tb` ON (`db`.`id_bot` = `tb`.`id`) LEFT JOIN `stats` as `st` ON (`st`.`dnow` = `db`.`dn`) WHERE `db`.`dn` = "'.$u->info['dnow'].'" AND `db`.`x` ="'.$tuz['x'].'" AND `db`.`y` ="'.$tuz['y'].'" AND `db`.`atack` = "0" AND `db`.`delete` = "0" AND `db`.`inBattle` = "0" GROUP BY `db`.`id2` ORDER BY `db`.`go_bot` ASC LIMIT 50'); - while($pll = mysql_fetch_assoc($sps)){ - $this->botAtack($pll,$tuz,1); - } - - }elseif($vlb == 1){ // . - $pl['go_bot'] = time()+10+rand(1,5); - $pl['x'] += $tgx; - $pl['y'] += $tgy; - mysql_query('UPDATE `dungeon_bots` SET `x` = "'.$pl['x'].'",`y` = "'.$pl['y'].'",`go_bot` = "'.$pl['go_bot'].'" WHERE `id2` = "'.$pl['id2'].'" LIMIT 1'); - } - unset($tgx,$tgy,$vlb,$tuz); - } - } - - $sp = mysql_query('SELECT `u`.*,`st`.* FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE `u`.`dn` = "'.$u->info['dnow'].'" AND '.$whr[$this->gs].' AND `u`.`delete` = "0" LIMIT 50'); - while($pl = mysql_fetch_assoc($sp)){ - $i++; if(!isset($pos[$this->cord[$pl['y'].'_'.$pl['x']]])){ $pos[$this->cord[$pl['y'].'_'.$pl['x']]] = 0; } $pos[$this->cord[$pl['y'].'_'.$pl['x']]]++; - $dlg = 0; - if($pl['dialog']>0){ - $dlg = $pl['dialog']; - } - $noat = 1; - if( $pl['noatack'] == 1 && $this->info['bsid'] == 0 ) { - $noat = 0; - } - $r .= ','.($i-1).':{9:0,0:'.$pl['id2'].',1:\''.$pl['login'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:'.$pl['sex'].',4:\''.str_replace('.gif','',$pl['obraz']).'\',5:\'bot\',6:'.$pos[$this->cord[$pl['y'].'_'.$pl['x']]].',7:'.$dlg.',8:'.$noat.'}'; - } - - $r = 'count:'.$i.$r; - //$wd = $this->cord['2_0']; - return $r; - } - - public function testGo($id) - { - global $u,$c,$code; - $go = 0; - if($id==1) - { - // - $go = $this->sg[$this->gs][1]; - }elseif($id==2) - { - // - $go = $this->sg[$this->gs][3]; - }elseif($id==3) - { - // - $go = $this->sg[$this->gs][4]; - }elseif($id==4) - { - // - $go = $this->sg[$this->gs][2]; - } - $thp = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$u->info['x'].'" AND `y` = "'.$u->info['y'].'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - $ng = array( - 4=>1, - 2=>2, - 1=>3, - 3=>4 - ); - if(isset($thp['id']) && $thp['go_'.$ng[$go]]==0) - { - $go = 0; - } - $tgo = array(0=>0,1=>0); - if($go==1) - { - $tgo[1] += 1; - }elseif($go==2) - { - $tgo[0] -= 1; - }elseif($go==3) - { - $tgo[1] -= 1; - }elseif($go==4) - { - $tgo[0] += 1; - } - - $tbot = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_bots` WHERE `x` = "'.($u->info['x']+(int)$tgo[0]).'" AND `y` = "'.($u->info['y']+(int)$tgo[1]).'" AND `dn` = "'.$this->info['id'].'" AND `for_dn` = "0" AND `delete` = "0" LIMIT 1')); - if(isset($tbot['id2']) && $u->info['admin']==0) - { - $go = 0; - } - - $tmap = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$u->info['x'].'" AND `y` = "'.$u->info['y'].'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - // - if($tmap['tr_items']!='') - { - $ti = explode(',',$tmap['tr_items']); - $i = 0; $trnit = ''; - while($i0 && $ti2[1]>0) - { - $num_rows = mysql_num_rows(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "0" AND `item_id` = "'.((int)$ti2[0]).'" LIMIT '.((int)$ti2[1]).'')); - if($num_rows < (int)$ti2[1]) - { - $tgo = $ti2[2]; - if($tgo!='0000') - { - if($tgo[$ng[$go]-1]==1) - { - $go = 0; - $trm = mysql_fetch_assoc(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.((int)$ti2[0]).'" LIMIT 1')); - $trnit .= '"'.$trm['name'].'", '; - } - } - } - } - $i++; - } - if($trnit!='') - { - $trnit = rtrim($trnit,', '); - $this->error = ' . '.$trnit; - } - } - - $tmGo = $u->info['timeGo']-time(); // - if($tmGo>0) - { - $go = 0; - $this->error = ' ...'; - } - - if($u->aves['now']>=$u->aves['max']) - { - $go = 0; - $this->error = ' , ...'; - } - - if($go>0) - { - if($go==1) - { - $u->info['y'] += 1; - }elseif($go==2) - { - $u->info['x'] -= 1; - }elseif($go==3) - { - $u->info['y'] -= 1; - }elseif($go==4) - { - $u->info['x'] += 1; - } - if( $u->stats['speed_dungeon'] > 0 ) { - $tmap['timeGO'] = round($tmap['timeGO']/100*(100-$u->stats['speed_dungeon'])); - if( $tmap['timeGO'] < 2 ) { - $tmap['timeGO'] = 1; - } - } - $u->info['timeGo'] = time()+$tmap['timeGO']; - $u->info['timeGoL'] = time(); - $tmap0 = mysql_fetch_assoc(mysql_query('SELECT `id`,`teleport` FROM `dungeon_map` WHERE `id_dng` = "'.$tmap['id_dng'].'" AND `x` = "'.$u->info['x'].'" AND `y` = "'.$u->info['y'].'" LIMIT 1')); - if( $tmap0['teleport'] > 0 ){ - $tmap1 = mysql_fetch_assoc(mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id` = "'.$tmap0['teleport'].'" LIMIT 1')); - if( isset($tmap1['id']) ) { - $u->info['x'] = $tmap1['x']; - $u->info['y'] = $tmap1['y']; - $this->error = ' ...'; - } - } - $upd = mysql_query('UPDATE `stats` SET `x` = "'.$u->info['x'].'",`y` = "'.$u->info['y'].'",`timeGo` = "'.$u->info['timeGo'].'",`timeGoL` = "'.$u->info['timeGoL'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - unset($id); - } - } - - public function testGone($id) - { - global $u,$c,$code; - $go = 0; - if($id==1) - { - // - $go = $this->sg[$this->gs][1]; - }elseif($id==2) - { - // - $go = $this->sg[$this->gs][3]; - }elseif($id==3) - { - // - $go = $this->sg[$this->gs][4]; - }elseif($id==4) - { - // - $go = $this->sg[$this->gs][2]; - } - $thp = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$u->info['x'].'" AND `y` = "'.$u->info['y'].'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - $ng = array( - 4=>1, - 2=>2, - 1=>3, - 3=>4 - ); - if(isset($thp['id']) && $thp['go_'.$ng[$go]]==0) - { - $go = 0; - } - $tgo = array(0=>0,1=>0); - if($go==1) - { - $tgo[1] += 1; - }elseif($go==2) - { - $tgo[0] -= 1; - }elseif($go==3) - { - $tgo[1] -= 1; - }elseif($go==4) - { - $tgo[0] += 1; - } - - $tbot = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_bots` WHERE `x` = "'.($u->info['x']+(int)$tgo[0]).'" AND `y` = "'.($u->info['y']+(int)$tgo[1]).'" AND `dn` = "'.$this->info['id'].'" AND `for_dn` = "0" AND `delete` = "0" LIMIT 1')); - if(isset($tbot['id2']) && $u->info['admin']==0) - { - $go = 0; - } - - $tmap = mysql_fetch_assoc(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$u->info['x'].'" AND `y` = "'.$u->info['y'].'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - // - /* - if($tmap['tr_items']!='') - { - $ti = explode(',',$tmap['tr_items']); - $i = 0; $trnit = ''; - while($i0 && $ti2[1]>0) - { - $num_rows = mysql_num_rows(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "0" AND `item_id` = "'.((int)$ti2[0]).'" LIMIT '.((int)$ti2[1]).'')); - if($num_rows < (int)$ti2[1]) - { - $tgo = $ti2[2]; - if($tgo!='0000') - { - if($tgo[$ng[$go]-1]==1) - { - $go = 0; - } - } - } - } - $i++; - } - } - */ - - return $go; - } - - public function testSt($id,$s) - { - $r = 0; - // - $s = $this->sg[$this->gs][$s]; - if(isset($this->map[1][$id]['id'])) - { - $r = $this->map[1][$id]['st'][($s-1)]; - } - return $r; - } - - public function lookDungeon() - { - global $u,$c,$code,$pd; - /* */ - /* LEVEL 1 */ - - // 29/10/2014 D5, 2 , . . 22/11/2014 . , . - if($this->testSt(2,4)>0 /* || $this->testSt(3,2)>0 */){ $pd[28] = 1; } - if(/*$this->testSt(1,4)>0 ||*/ $this->testSt(2,2)>0){ $pd[27] = 1; } - if($this->testSt(2,1)>0 /*|| $this->testSt(5,3)>0*/){ $pd[26] = 1; } - if($this->testSt(3,1)>0/* || $this->testSt(6,3)>0*/){ $pd[25] = 1; } - if($this->testSt(1,1)>0 /*|| $this->testSt(4,3)>0*/){ $pd[24] = 1; } - /* LEVEL 2 */ - if($this->testSt(5,4)>0 /*|| $this->testSt(6,2)>0*/){ $pd[23] = 1; } - if(/*$this->testSt(4,4)>0 || */$this->testSt(5,2)>0){ $pd[22] = 1; } - if($this->testSt(5,1)>0 /*|| $this->testSt(8,3)>0*/){ $pd[21] = 1; } - if($this->testSt(6,1)>0 /*|| $this->testSt(7,3)>0*/){ $pd[20] = 1; } - if($this->testSt(4,1)>0/* || $this->testSt(9,3)>0*/){ $pd[19] = 1; } - - /* LEVEL 3 */ - if($this->testSt(8,4)>0 /*|| $this->testSt(7,2)>0*/){ $pd[18] = 1; } - if(/*$this->testSt(9,4)>0 || */$this->testSt(8,2)>0){ $pd[17] = 1; } - if($this->testSt(8,1)>0 /* || $this->testSt(12,3)>0*/){ $pd[16] = 1; } - if($this->testSt(7,1)>0 /* || $this->testSt(13,3)>0*/){ $pd[15] = 1; } - if($this->testSt(9,1)>0 /*|| $this->testSt(11,3)>0*/){ $pd[14] = 1; } - - /* LEVEL 4 */ - - if($this->testSt(12,4)>0 || $this->testSt(13,2)>0){ $pd[13] = 1; } - if($this->testSt(12,2)>0 || $this->testSt(11,4)>0){ $pd[12] = 1; } - if($this->testSt(13,1)>0 || $this->testSt(17,3)>0){ $pd[11] = 1; } //8 - if($this->testSt(11,1)>0 || $this->testSt(16,3)>0){ $pd[10] = 1; } //7 - if($this->testSt(12,1)>0/* || $this->testSt(15,3)>0*/){ $pd[9] = 1; } - if($this->testSt(14,1)>0 || $this->testSt(18,3)>0){ $pd[6] = 1; } //2 - if($this->testSt(10,1)>0 || $this->testSt(19,3)>0){ $pd[5] = 1; } //1 - if($this->testSt(16,4)>0 || $this->testSt(15,2)>0){ $pd[4] = 1; } - if($this->testSt(15,4)>0 || $this->testSt(17,2)>0){ $pd[3] = 1; } - - /* */ - - /* */ - - } - - public function getMatrix($y,$x) - { - global $u; - $this->cord['x']++; - $this->cord[($u->info['y']+$y).'_'.($u->info['x']+$x)] = $this->cord['x']; - return $this->map[0][($u->info['y']+$y).'_'.($u->info['x']+$x)]; - } - - public function genMatix() - { - $r = array(); - if($this->gs == 1) - { - //1; // - $r[1] = $this->getMatrix(0,-1); # - $r[2] = $this->getMatrix(0,0); # - $r[3] = $this->getMatrix(0,1); # - $r[4] = $this->getMatrix(1,-1); # +1 - $r[5] = $this->getMatrix(1,0); # +1 - $r[6] = $this->getMatrix(1,1); # +1 - $r[7] = $this->getMatrix(2,1); # +2 - $r[8] = $this->getMatrix(2,0); # +2 - $r[9] = $this->getMatrix(2,-1); # +2 - $r[10] = $this->getMatrix(3,-2); # , +3 - $r[11] = $this->getMatrix(3,-1); # +3 - $r[12] = $this->getMatrix(3,0); # +3 - $r[13] = $this->getMatrix(3,1); # +3 - $r[14] = $this->getMatrix(3,2); # , +3 - $r[15] = $this->getMatrix(4,0); # +4 - $r[16] = $this->getMatrix(4,-1); # +4 - $r[17] = $this->getMatrix(4,1); # +4 - $r[18] = $this->getMatrix(4,2); # , +4 - $r[19] = $this->getMatrix(4,-2); # , +4 - - }elseif($this->gs == 2) - { - //2; // - $r[1] = $this->getMatrix(-1,0); - $r[2] = $this->getMatrix(0,0); - $r[3] = $this->getMatrix(1,0); - $r[4] = $this->getMatrix(-1,-1); - $r[5] = $this->getMatrix(0,-1); - $r[6] = $this->getMatrix(1,-1); - $r[7] = $this->getMatrix(1,-2); - $r[8] = $this->getMatrix(0,-2); - $r[9] = $this->getMatrix(-1,-2); - $r[10] = $this->getMatrix(-2,-3); - $r[11] = $this->getMatrix(-1,-3); - $r[12] = $this->getMatrix(0,-3); - $r[13] = $this->getMatrix(1,-3); - $r[14] = $this->getMatrix(2,-3); - $r[15] = $this->getMatrix(0,-4); - $r[16] = $this->getMatrix(-1,-4); - $r[17] = $this->getMatrix(1,-4); - $r[18] = $this->getMatrix(2,-4); - $r[19] = $this->getMatrix(-2,-4); - }elseif($this->gs == 3) - { - //3; // - $r[1] = $this->getMatrix(0,1); - $r[2] = $this->getMatrix(0,0); - $r[3] = $this->getMatrix(0,-1); - $r[4] = $this->getMatrix(-1,1); - $r[5] = $this->getMatrix(-1,0); - $r[6] = $this->getMatrix(-1,-1); - $r[7] = $this->getMatrix(-2,-1); - $r[8] = $this->getMatrix(-2,0); - $r[9] = $this->getMatrix(-2,1); - $r[10] = $this->getMatrix(-3,2); - $r[11] = $this->getMatrix(-3,1); - $r[12] = $this->getMatrix(-3,0); - $r[13] = $this->getMatrix(-3,-1); - $r[14] = $this->getMatrix(-3,-2); - $r[15] = $this->getMatrix(-4,0); - $r[16] = $this->getMatrix(-4,1); - $r[17] = $this->getMatrix(-4,-1); - $r[18] = $this->getMatrix(-4,-2); - $r[19] = $this->getMatrix(-4,2); - }elseif($this->gs == 4) - { - //4; // - $r[1] = $this->getMatrix(1,0); - $r[2] = $this->getMatrix(0,0); - $r[3] = $this->getMatrix(-1,0); - $r[4] = $this->getMatrix(1,1); - $r[5] = $this->getMatrix(0,1); - $r[6] = $this->getMatrix(-1,1); - $r[7] = $this->getMatrix(-1,2); - $r[8] = $this->getMatrix(0,2); - $r[9] = $this->getMatrix(1,2); - $r[10] = $this->getMatrix(2,3); - $r[11] = $this->getMatrix(1,3); - $r[12] = $this->getMatrix(0,3); - $r[13] = $this->getMatrix(-1,3); - $r[14] = $this->getMatrix(-2,3); - $r[15] = $this->getMatrix(0,4); - $r[16] = $this->getMatrix(1,4); - $r[17] = $this->getMatrix(-1,4); - $r[18] = $this->getMatrix(-2,4); - $r[19] = $this->getMatrix(2,4); - } - return $r; - } -} - -$d = new dungeon; -$d->start(); -?> \ No newline at end of file diff --git a/_incl_data/class/__filter_class.php b/_incl_data/class/__filter_class.php deleted file mode 100644 index 8dfeeb81..00000000 --- a/_incl_data/class/__filter_class.php +++ /dev/null @@ -1,168 +0,0 @@ - $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') . ': ' . mysql_real_escape_string($t) . '","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('>', '', $txt); - $txt = str_replace('<', '', $txt); - $txt = str_replace('"', '', $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('"', '', $testEN2); - $testEN2 = str_replace(' ', '', $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); - } -} - -$filter = new Filter(); \ No newline at end of file diff --git a/_incl_data/class/__magic.php b/_incl_data/class/__magic.php deleted file mode 100644 index a4c869fd..00000000 --- a/_incl_data/class/__magic.php +++ /dev/null @@ -1,1999 +0,0 @@ -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); - } - } - - $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 = 'Каст "' . $itm['name'] . '" сгорел'; - $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'], '"System.inventory":(КАСТ СГОРЕЛ) Персонаж использовал "' . $itm['name'] . '" (' . $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 = []; - 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.
'; - } else { - $u->error = 'Ваше здоровье и так полностью восстановлено
'; - $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.
'; - } 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'], '"System.inventory": Персонаж использовал эликсир "' . $itm['name'] . '" (+' . $use['moment_hp'] . ' HP) [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0); - $this->youuse++; - $u->error = 'Вы успешно использовали эликсир "' . $itm['name'] . '"
' . $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'], '"System.inventory": Персонаж использовал эликсир "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0); - $this->youuse++; - $u->error = 'Вы успешно использовали эликсир "' . $itm['name'] . '"
' . $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 = '' . $txt . ''; - if ($u->info['sex'] == 1) { - $txt = 'Хитрая {u1} бросила кусок снега в {u2}. ' . $txt . ' [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']'; - } else { - $txt = 'Хитрый {u1} бросил кусок снега в {u2}. ' . $txt . ' [' . $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 . ' "' . $u->info['login'] . '" бросил' . $sx2 . ' кусок снега в "' . $usr['login'] . '". -1000 [' . 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]] "' . $u->info['login'] . '" использовал' . $sx . ' магию нападения на персонажа "' . $usr['login'] . '".'; - 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(''); - } 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 = '' . $txt . ''; - if ($u->info['id'] == $usr['id']) { - if ($u->info['sex'] == 1) { - $txt = '{u1} использовала "' . $itm['name'] . '" на себя. ' . $txt . ' [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']'; - } else { - $txt = '{u1} использовал "' . $itm['name'] . '" на себя. ' . $txt . ' [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']'; - } - } else { - if ($u->info['sex'] == 1) { - $txt = '{u1} использовала "' . $itm['name'] . '" на {u2}. ' . $txt . ' [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']'; - } else { - $txt = '{u1} использовал "' . $itm['name'] . '" на {u2}. ' . $txt . ' [' . $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 = 'Свиток "' . $itm['name'] . '" был успешно использован.'; - } 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 = 'Свиток "' . $itm['name'] . '" был успешно использован.'; - $rtxt = '[img[items/' . $itm['img'] . ']] Персонаж "' . $u->info['login'] . '" использовал' . $sx2 . ' "' . $itm['name'] . '" на "' . $usr['login'] . '".'; - 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 = '' . $txt . ''; - if ($u->info['id'] == $usr['id']) { - if ($u->info['sex'] == 1) { - $txt = '{u1} использовала "' . $itm['name'] . '" на себя. ' . $txt . ' [' . $btl->stats[$btl->uids[$usr['id']]]['mpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['mpAll'] . '] (Мана)'; - } else { - $txt = '{u1} использовал "' . $itm['name'] . '" на себя. ' . $txt . ' [' . $btl->stats[$btl->uids[$usr['id']]]['mpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['mpAll'] . '] (Мана)'; - } - } else { - if ($u->info['sex'] == 1) { - $txt = '{u1} использовала "' . $itm['name'] . '" на {u2}. ' . $txt . ' [' . $btl->stats[$btl->uids[$usr['id']]]['mpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['mpAll'] . '] (Мана)'; - } else { - $txt = '{u1} использовал "' . $itm['name'] . '" на {u2}. ' . $txt . ' [' . $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 = 'Свиток "' . $itm['name'] . '" был успешно использован.'; - } 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 = 'Свиток "' . $itm['name'] . '" был успешно использован.'; - $rtxt = '[img[items/' . $itm['img'] . ']] Персонаж "' . $u->info['login'] . '" использовал' . $sx2 . ' "' . $itm['name'] . '" на "' . $usr['login'] . '".'; - 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 = '"Легкой травмы"'; - $text_msg2 = 'легких'; - } elseif ($itm['magic_inci'] == 'lech_2') { - $type_lechenie = 2; // тип травмы котору лечим - $text_msg = '"Средней травмы"'; - $text_msg2 = 'средних'; - } elseif ($itm['magic_inci'] == 'lech_3') { - $type_lechenie = 3; // тип травмы котору лечим - $text_msg = '"Тяжелой травмы"'; - $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]] Лекарь "' . $u->info['login'] . '" кинул цепь исцеления на игрока "' . $usr['login'] . '".'; - 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]] Лекари "' . $u->info['login'] . $it_users . '" вылечили от ' . $text_msg . ' игрока "' . $usr['login'] . '".'; - 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 = 'Вы присоединились к цепи исцеления для "' . $text_msg . '" (исцеление ' . $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 = 'Вы создали цепь исцеления для "' . $text_msg . '" (исцеление ' . $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]] Лекарь "' . $u->info['login'] . '" кинул цепь исцеления на игрока "' . $usr['login'] . '".'; - 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 = '"Легкой травмы"'; - $text_msg2 = 'легких'; - } elseif ($itm['magic_inci'] == 'lech_free_2') { - $type_lechenie = 2; // тип травмы котору лечим - $text_msg = '"Средней травмы"'; - $text_msg2 = 'средних'; - } elseif ($itm['magic_inci'] == 'lech_free_3') { - $type_lechenie = 3; // тип травмы котору лечим - $text_msg = '"Тяжелой травмы"'; - $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]] Лекари "' . $u->info['login'] . $it_users . '" вылечили от ' . $text_msg . ' игрока "' . $usr['login'] . '".'; - 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 = 'Вы присоединились к цепи исцеления для "' . $text_msg . '" (исцеление ' . $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 = 'Вы создали цепь исцеления для "' . $text_msg . '" (исцеление ' . $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]] Лекарь "' . $u->info['login'] . '" кинул цепь исцеления на игрока "' . $usr['login'] . '".'; - 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} переманил клона {u2} на свою сторону.'; - } else { - $txt_m = '{u1} переманила клона {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 = 'Вы успешно использовали заклинание "' . $itm['name'] . '" на "' . $usr['login'] . '"'; - } 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'], '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') на персонажа "' . $usr['login'] . '" (id' . $usr['id'] . ') [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0); - $u->addDelo(1, $usr['id'], '"System.inventory": Персонаж "' . $u->info['login'] . '" (id' . $u->info['id'] . ') использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') на персонажа [itm:' . $itm['id'] . '].', time(), $usr['city'], 'System.inventory', 0, 0); - $u->error = 'Вы успешно использовали заклинание "' . $itm['name'] . '" на персонажа "' . $usr['login'] . '"
' . $us[1] . ''; - } else { - $u->addDelo(1, $u->info['id'], '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') на персонажа самого себя [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0); - $u->error = 'Вы успешно использовали заклинание "' . $itm['name'] . '" на самого себя
' . $us[1] . ''; - - } - // - if ($usr['battle'] > 0) { - //Заносим в лог - $txt_m = ''; - if ($u->info['sex'] == 0) { - if ($u->info['id'] != $usr['id']) { - $txt_m .= '{u1} воспользовался магией "' . $itm['name'] . '" на {u2}.'; - } else { - $txt_m .= '{u1} воспользовался магией "' . $itm['name'] . '" на себя.'; - } - } else { - if ($u->info['id'] != $usr['id']) { - $txt_m .= '{u1} воспользовалась магией "' . $itm['name'] . '" на {u2}.'; - } else { - $txt_m .= '{u1} воспользовалась магией "' . $itm['name'] . '" на себя.'; - } - } - $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'] . ']] "' . $u->info['login'] . '" использовала "' . $itm['name'] . ' Саныча" и получила эффект ' . $echotext . ' травмы.'; - } else { - $rtxt = '[img[items/' . $itm['img'] . ']] "' . $u->info['login'] . '" использовал "' . $itm['name'] . ' Саныча" и получил эффект ' . $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 = 'Вы успешно использовали "' . $itm['name'] . '"'; - $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} использовала "' . $itm['name'] . ' Саныча".'); - } else { - $this->inBattleLog('{u1} использовал "' . $itm['name'] . ' Саныча".'); - } - 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 = 'Вы успешно использовали "' . $itm['name'] . '" на ' . $usr['login'] . ''; - - if ($u->info['sex'] == 1) { - $this->inBattleLog('{u1} использовала "' . $itm['name'] . ' Саныча" на {u2}.', $usr); - } else { - $this->inBattleLog('{u1} использовал "' . $itm['name'] . ' Саныча" на {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} использовал "' . $itm['name'] . '" и породил клона.'; - } else { - $txt_m = '{u1} использовала "' . $itm['name'] . '" и породила клона.'; - } - $this->inBattleLog($txt_m, null); - if ($u->info['sex'] == 0) { - $txt_m = '' . $u->info['login'] . ' (клон ' . $bot_cou . ')[' . $u->info['level'] . '] вмешался в поединок!'; - } else { - $txt_m = '' . $u->info['login'] . ' (клон ' . $bot_cou . ')[' . $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 = 'Заклятие "' . $itm['name'] . '" было успешно использовано'; - } 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} применил заклинание "' . $itm['name'] . '".'; - } else { - $txt_m = '{u1} применила заклинание "' . $itm['name'] . '".'; - } - $this->inBattleLog($txt_m, null); - mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . ($itm['iznosNOW'] + 1) . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); - $u->error = 'Заклятие "' . $itm['name'] . '" было успешно использовано'; - } - } 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]; - - //Выбираем тип зверя - - 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'] . '" и помните - "Мы в ответе за тех, кого приручили".'; - $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'], '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $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'], '"System.inventory": Персонаж использовал заклинание "' . $itm['name'] . '" (' . $us[1] . ') [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0); - $this->youuse++; - $u->error = 'Вы успешно использовали заклинание "' . $itm['name'] . '"
' . $us[1] . ''; - } else { - if ($u->error != '') { - $u->error = 'Не удалось использовать "' . $itm['name'] . '"...
' . $u->error; - } else { - $u->error = 'Не удалось использовать "' . $itm['name'] . '"...'; - } - } - } else { - if ($u->error != '') { - $u->error = 'Не удалось использовать "' . $itm['name'] . '"
' . $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 = [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 . '", - "0", - "' . $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) . '", - "250", - "0", - "0", - "50", - "9", - "' . $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 . '", - "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 = ['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 = ' {u1} напал на {u2} завязался бой »»'; - } else { - $text = ' {u1} напала на {u2} завязался бой »»'; - } - $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 .= ''; - } - if ($usr_real['clan'] > 0) { - $usrreal .= ''; - } - $usrreal .= '' . $usr_real['login'] . '[' . $usr_real['level'] . ']'; - } else { - $usrreal = 'Невидимка[??]'; - } - $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 .= ''; - } - if ($me_real['clan'] > 0) { - $mereal .= ''; - } - $mereal .= '' . $me_real['login'] . '[' . $me_real['level'] . ']'; - } else { - $mereal = 'Невидимка[??]'; - } - $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); - "); - } - - - $btxt = ''; - if ($uid1u['align'] > 0) { - $btxt = $btxt . ''; - } - if ($uid1u['align2'] > 0) { - $btxt = $btxt . ''; - } - if ($uid1u['clan'] > 0) { - $btxt = $btxt . ''; - } - $btxt = $btxt . '{u1}[' . $uid1u['level'] . ']'; - 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 = [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'], '' . $a['name'] . ' нуждается в еде...', 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 = ' {u1} вмешался в поединок против {u2} »»'; - } else { - $text = ' {u1} вмешалась в поединок против {u2} »»'; - } - $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 .= ''; - } - if ($usr_real['clan'] > 0) { - $usrreal .= ''; - } - $usrreal .= '' . $usr_real['login'] . '[' . $usr_real['level'] . ']'; - } else { - $mereal = 'Невидимка[??]'; - } - $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 .= ''; - } - if ($me_real['clan'] > 0) { - $mereal .= ''; - } - $mereal .= '' . $me_real['login'] . '[' . $me_real['level'] . ']'; - } else { - $mereal = 'Невидимка[??]'; - } - $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; - -?> \ No newline at end of file diff --git a/_incl_data/class/__quest.php b/_incl_data/class/__quest.php deleted file mode 100644 index 62c1a56e..00000000 --- a/_incl_data/class/__quest.php +++ /dev/null @@ -1,1019 +0,0 @@ -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 = ' "' . $pl['name'] . '"'; - } 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 = ' "' . $pl['name'] . '"'; - } 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 = ' "' . $pl['name'] . '"'; - } 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 = '
-
' . $xrz . '/' . $r . '
-
-
-
-

'; - } - return $r; - } - - /* */ - 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 .= '"' . $qn['name'] . '", '; - } - } - $i++; - } - $t = trim($t, ', '); - $t .= '
'; - unset($qn); - } - // [ idbot-itm1=%,itm2=%| - if (isset($d['tr_botitm'])) { - $t .= ' :
    '; - $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 .= '    • "' . $qn['login'] . '" : '; - } else { - $t .= '    • : '; - } - //$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 .= ' ' . $qi['name'] . ', '; - $j++; - } - $t = trim($t, ', '); - $i++; - } - $t .= '
    '; - unset($qn, $qi, $e2, $e3, $e4); - } - // [ type-itm1=%,itm2=%| - if (isset($d['tr_winitm'])) { - $t .= ' :
    '; - $e = explode('|', $d['tr_winitm']); - $i = 0; - while ($i < count($e)) { - $e2 = explode('-', $e[$i]); - $t .= '    • '; - //$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 .= ' ' . $qi['name'] . ', '; - $j++; - } - $t = trim($t, ', '); - $t .= '
    '; - $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 .= '(: ' . $u->timeOut($qlst['time'] + ($d['tr_zdr'] * 60 * 60) - time()) . ' .)'; - } - $t .= '
    '; - 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'] . '
    '; - } - // - if (isset($d['tr_raz'])) { - if ($d['tr_raz'] == -1) { - $t .= ' :
    '; - } 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]) . '
    '; - } - 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]) . '
    '; - unset($qlst); - } - - if ($t != '') { - $r .= ' :
    ' . $t . '
    '; - $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 .= ' '; - } - $x4++; - } - if ($x5 != '') { - $t .= $x5 . '
    '; - } - unset($x3, $x4, $x5, $x6, $x7); - } - - if (isset($d['add_rep'])) { - $t .= ' ' . $u->city_name[$pl['city']] . ': ' . $d['add_rep'] . '
    '; - } - - if (isset($d['add_repizlom'])) { - $t .= ' : ' . $d['add_repizlom'] . '
    '; - } - - if (isset($d['add_cr'])) { - $t .= ': ' . $d['add_cr'] . ' .
    '; - } - - if ($t != '') { - $r = ':
    ' . $t . '
    ' . $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 = ''; - } else { - $x1 = $x1['text']; - } - $x = 0; - $t .= ' ' . $x1 . ': ' . $x . '/1
    '; - } - $i7++; - } - unset($x1, $x3, $x4, $i7); - } - - // - if (isset($d['kill_user'])) { - $t .= ' : 0/' . $d['kill_user'] . '
    '; - } - - // - 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 .= '    • ' . $bot2['login'] . ' [' . $x2 . '/' . $d['all_kill'] . ']
    '; - } else { - $x .= '    • ' . $pl['name'] . ' [' . $x2 . '/' . $d['all_kill'] . ']
    '; - } - } 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 .= '    • ' . $bot2['login'] . ' [' . $x2 . '/' . $ex2[1] . ']
    '; - } - $i++; - } - } - - if ($x != '') { - $x = trim($x, ', '); - $t .= ' :
    ' . $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 .= '    • ' . $bot2['name'] . ' [' . $x2[0] . '/' . $ex2[1] . ']
    '; - $i++; - } - if ($x != '') { - $x = trim($x, ', '); - $t .= ' :
    ' . $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 .= '    • ' . $bot2['name'] . ' [' . $x2[0] . '/' . $ex2[1] . ']
    '; - $i++; - } - if ($x != '') { - $x = trim($x, ', '); - $t .= ' :
    ' . $x; - } - } - - if ($t != '') { - $r = '
    :
    ' . $t . '
    ' . $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 = ' ' . $quest['name'] . ' ! : ' . $t . '.'; - unset($t); - } else { - $r = ' ' . $quest['name'] . ' !'; - } - $r = '' . $r . ''; - // - 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 ''; - 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 = ' ' . $pl['name'] . ' ! : ' . $t . '.'; - unset($t); - } else { - $r = ' ' . $pl['name'] . ' !'; - } - $r = '' . $r . ''; - // - 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 diff --git a/_incl_data/class/__reg.php b/_incl_data/class/__reg.php deleted file mode 100644 index 254dc037..00000000 --- a/_incl_data/class/__reg.php +++ /dev/null @@ -1,405 +0,0 @@ -"'.(time()-60*60*1).'" AND `ipreg` = "'.mysql_real_escape_string(IP).'" LIMIT 1')); - if(isset($_COOKIE['reg_capitalcity']) || (int)$_COOKIE['reg_capitalcity']>time() || isset($lr['id'])) - { - $error .= ' IP . IP , . .
    '; $_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'] = ''; - } - $error .= ' '.$uz['login'].'. . .
    '; - mysql_query("UPDATE `items_users` SET `data`='info= : ".$cd['code']."
    .
    - . : ".date('d.n.Y H:i',time())."
    ' WHERE `secret_id` = '".$cd['code']."' LIMIT 1"); - $cd['use'] = $reg['id']; - - if($cd['time_create']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($imystr($reg_d[0]))) - { - $error .= ', , .
    '; $_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 .
    '; $_POST['step'] = 1; - } - if(strlen($reg_d[0])<4) - { - $error .= ' 4 .
    '; $_POST['step'] = 1; - } - // - $er = $this->en_ru($reg_d[0]); - if($er==true) - { - $error .= ' . .
    '; $_POST['step'] = 1; - } - // - if(strpos($sr,$reg_d[0])) - { - $error .= ' .
    '; $_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].' , .
    '; $_POST['step'] = 1; - } - // - if(substr_count($reg_d[0],' ')+substr_count($reg_d[0],'-')+substr_count($reg_d[0],'_')>2) - { - $error .= ' (, , ).
    '; $_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 .
    '; $_POST['step'] = 2; - } - if($reg_d[1]!=$reg_d[2]) - { - $error .= ' , . , .
    '; $_POST['step'] = 2; - } - if(preg_match('/'.$reg_d[0].'/i',$reg_d[1])) - { - $error .= ' .
    '; $_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-.
    '; $_POST['step'] = 3; - } - - if(!preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $reg_d[3])) - { - $error .= ' E-mail.
    '; $_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 .= ' !
    '; $_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 .= ' .
    '; $_POST['step'] = 4; - } - - if($reg_d[15]!=0 && $reg_d[15]!=1) - { - $error .= ' .
    '; $_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 .= ' .
    '; $_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 .= ', , .
    '; $_POST['step'] = 5; - } - - if(!isset($_POST['law2_'.$reg['id']]) || $_POST['law2_'.$reg['id']]!='on') - { - $error .= ', '.$c['title'].', .
    '; $_POST['step'] = 5; - } - - if($_POST['code']!=$_SESSION['code'] || $_SESSION['code']<100 || $_POST['code']=='') - { - $error .= ' .
    '; $_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] = ''; - } - - /*$mbid = mysql_fetch_array(mysql_query('select min(t1.id + 1) -from users t1 -where t1.id + 1 not in (select id from users where id > 9999) AND t1.id > 9998')); - //$mbid1 = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "'.$mbid[0].'" LIMIT 1')); - //$mbid2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `id` = "'.$mbid[0].'" LIMIT 1')); - //if(isset($mbid1['id']) && isset($mbid2['id'])) { - */ - $mbid = 'NULL'; - /*}else{ - /* */ - /*if($mbid [0]> 0) { - mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$mbid[0].'" LIMIT 1'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$mbid[0].'" LIMIT 1'); - mysql_query('DELETE FROM `bank` WHERE `uid` = "'.$mbid[0].'" LIMIT 1'); - mysql_query('DELETE FROM `users_delo` WHERE `uid` = "'.$mbid[0].'" LIMIT 1'); - mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$mbid[0].'" LIMIT 1'); - } - $mbid = $mbid[0]; - }*/ - - if($_COOKIE['b4n'] == '1') { - setcookie('b4n','2',time()+60*60*24*3); - $reg['referal'] = 'btl4.net'; - }elseif(isset($_COOKIE['hstreger'])) { - $reg['referal'] = $_COOKIE['hstreger']; - } - - $ins = mysql_query("INSERT INTO `users` (`activ`,`fnq`,`host_reg`,`room`,`login`,`pass`,`ipreg`,`ip`,`city`,`cityreg`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`city_real`,`icq`,`icq_hide`,`deviz`,`chatColor`,`timereg`) VALUES ( - '0', - '0', - '".mysql_real_escape_string($reg['referal'])."', - '0', - '".$reg_d[0]."', - '".md5($reg_d[1])."', - '".IP."', - '".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(); - - $refer = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`banned`,`admin`,`level` FROM `users` WHERE `id` = "'.mysql_real_escape_string($reg['referal']).'" LIMIT 1')); - if(isset($refer['id'])) { - mysql_query("INSERT INTO `items_users` (`gift`,`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$refer['login']."','".$uid."','3199','noodet=1|items_in_file=sunduk_new|var_id=1|open=1|noremont=1|nodelete=1|nosale=1',1,2,'capitalcity',".time().")"); - $text = ' "'.$refer['login'].'"! ( --) .'; - mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','11','0')"); - } - - 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` (`gift`,`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` (`gift`,`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|sudba=".mysql_real_escape_string($reg_d[0])."|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|sudba=".mysql_real_escape_string($reg_d[0])."|useOnLogin=1|musor=1|noremont=1',50,2,'capitalcity',".time().")"); - mysql_query("INSERT INTO `items_users` (`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$uid."','4014','sudba=".mysql_real_escape_string($reg_d[0])."|noremont=1|usefromfile=1|musor=1|nodelete=1|nosale=1|expUpg=300000',1,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] " ", , ""'; - 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] "", , ""'; - 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/qsvit_hran.gif]][1] " ", , "". +300.000 . '; - 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'.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 `uid` = '".$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: /bk'); - die(' ...'); - }else{ - $error .= ' . ...
    '; - } - } - } - } - return $stp; - } -} - -$r = new register; -?> \ No newline at end of file diff --git a/_incl_data/class/__seasons.php b/_incl_data/class/__seasons.php deleted file mode 100644 index 2e582ec1..00000000 --- a/_incl_data/class/__seasons.php +++ /dev/null @@ -1,37 +0,0 @@ - [1, '01', '', ''], - 2 => [2, '02', '', ''], - 3 => [3, '03', '', ''], - 4 => [4, '04', '', ''], - 5 => [5, '05', '', ''], - 6 => [6, '06', '', ''], - 7 => [7, '07', '', ''], - 8 => [8, '08', '', ''], - 9 => [9, '09', '', ''], - 10 => [10, '10', '', ''], - 11 => [11, '11', '', ''], - 12 => [12, '12', '', ''], - ]; - - public static $date = [], $m = []; - - public static function data($val) - { - self::$m = Db::getRow('select * from sss_m where id = ?', [$val]); - if (self::$m['s'] != self::$date['m']) { - self::$m = []; - } - } - -} diff --git a/_incl_data/class/__telegram.php b/_incl_data/class/__telegram.php deleted file mode 100644 index d40c5202..00000000 --- a/_incl_data/class/__telegram.php +++ /dev/null @@ -1,197 +0,0 @@ -readGood('.$id.',"https://img.new-combats.com/i/misc/read.gif"); nobtext('.$id.');'; - } - } - } - - public function lockMsg($id,$uid) - { - $msg = mysql_fetch_array(mysql_query('SELECT * FROM `telegram` WHERE `id`="'.$id.'" AND `uid`="'.$uid.'" LIMIT 1 FOR UPDATE')); - if(isset($msg['id'])) - { - $lock = array(0=>1,1=>0); - mysql_query('START TRANSACTION'); - $upd = mysql_query('UPDATE `telegram` SET `read`="1",`lock`="'.$lock[$msg['lock']].'" WHERE `id` = "'.$id.'" AND `uid`="'.$uid.'" LIMIT 1'); - mysql_query('COMMIT'); - if($upd) - { - if($lock[$msg['lock']]==1) - { - echo ''; - }else{ - echo ''; - } - } - } - } - - public function deleteMsgAll($uid,$pg) - { - mysql_query('START TRANSACTION'); - $upd = mysql_query('UPDATE `telegram` SET `delete`="1" WHERE `uid`="'.$uid.'" AND `read`="1" AND `lock`="0" AND `delete`="0"'); - mysql_query('COMMIT'); - if($upd) - { - echo ''; - } - } - - public function deleteMsg($id,$uid,$pg) - { - $msg = mysql_fetch_array(mysql_query('SELECT * FROM `telegram` WHERE `id`="'.$id.'" AND `uid`="'.$uid.'" LIMIT 1 FOR UPDATE')); - if(isset($msg['id'])) - { - mysql_query('START TRANSACTION'); - $upd = mysql_query('UPDATE `telegram` SET `delete`="1" WHERE `id` = "'.$id.'" AND `uid`="'.$uid.'" LIMIT 1'); - mysql_query('COMMIT'); - if($upd && $msg['delete']==0 && $msg['lock']==0) - { - echo ''; - } - } - } - - private function addMsgTable($id,$from,$fromType,$ttl,$time,$lock,$read,$pg) - { - $i1 = ''; - if($read==1) - { - $i1 = ''; - } - - if($lock==1) - { - $i1 = ''; - } - - if($fromType==1) - { - $from = ''.$from.''; - }elseif($read==0) - { - $from = ''.$from.''; - } - - echo ' - - - - - - - - -
    '.$i1.'
    '.$from.''.substr($ttl,0,30).'...'.date('d.m.y H:i',$time).'
    - '; - } - - public function seeMsg($uid,$page,$maxPages) - { - $page = ceil($page); - echo ' - - - - - - - - - -
    '; - - $i = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `telegram` WHERE `uid`="'.$uid.'" AND `delete`="0"')); - $pg = ceil($i[0]/$maxPages); - if($page<0) - { - $page = 0; - }elseif($page>$pg) - { - $page = $pg; - } - - if($i[0]>0) - { - $sp = mysql_query('SELECT * FROM `telegram` WHERE `uid`="'.$uid.'" AND `delete`="0" ORDER BY `id` DESC LIMIT '.(($page-1)*$maxPages).' , '.$maxPages.''); - while($pl = mysql_fetch_array($sp)) - { - $this->addMsgTable($pl['id'],$pl['from'],$pl['fromType'],$pl['text'],$pl['time'],$pl['lock'],$pl['read'],$page); - } - } - - if($i[0]==0) - { - echo '
    '; - }elseif($i[0]>$maxPages){ - $pages = ''; - $i = 1; - while($i<=$pg) - { - $cls = ''; - if($page==$i) - { - $cls = 'style="color:#6f0000; font-size:14px;"'; - } - $pages .= ' '.$i.''; - $i++; - } - echo ' - - - - - - - - -
    : '.$pages.'
    '; - } - } - - public function __clone() - { - trigger_error(' .', E_USER_ERROR); - } -} - -?> \ No newline at end of file diff --git a/_incl_data/class/__turnir.php b/_incl_data/class/__turnir.php deleted file mode 100644 index 36b8c8b0..00000000 --- a/_incl_data/class/__turnir.php +++ /dev/null @@ -1,539 +0,0 @@ - ' ', - 1 => ' ', - 2 => ' ' - ); - - public function start() { - global $c,$u; - $this->info = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "'.$u->info['inTurnirnew'].'" LIMIT 1')); - $this->user = mysql_fetch_array(mysql_query('SELECT * FROM `users_turnirs` WHERE `turnir` = "'.$u->info['inTurnirnew'].'" AND `bot` = "'.$u->info['id'].'" LIMIT 1')); - } - - public function startTurnir() { - global $c,$u; - $row = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `win` = "0" AND `lose` = "0" AND `nich` = "0"')); - if($row[0] > 0 && $this->info['status'] != 3) { - mysql_query('UPDATE `turnirs` SET `status` = "3" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - // - mysql_query('INSERT INTO `battle` (`city`,`time_start`,`timeout`,`type`,`turnir`) VALUES ("'.$u->info['city'].'","'.time().'","60","1","'.$this->info['id'].'")'); - $uri = mysql_insert_id(); - // - mysql_query('UPDATE `users` SET `battle` = "'.$uri.'" WHERE `inUser` = "0" AND `inTurnirnew` = "'.$this->info['id'].'"'); - // - die(' ""...'); - }else{ - if($this->info['status'] == 3) { - $this->finishTurnir(); - } - } - } - - public function finishTurnir() { - global $c,$u; - $this->info = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "'.$u->info['inTurnirnew'].'" LIMIT 1')); - //mysql_query('UPDATE `users` SET `inUser` = 0, `inTurnirnew` = 0 WHERE `inTurnirnew` = '.$this->info['id'].' AND `inUser` > 0 LIMIT '.$this->info['users_in']); - if($this->info['status'] == 3) { - $win = ''; - $lose = ''; - $sp = mysql_query('SELECT * FROM `users_turnirs` WHERE `turnir` = "'.$this->info['id'].'" ORDER BY `points` DESC'); - while($pl = mysql_fetch_array($sp)) { - mysql_query('DELETE FROM `users_turnirs` WHERE `turnir` = "'.$this->info['id'].'"'); - $inf = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1')); - $bot = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$pl['bot'].'" LIMIT 1')); - if(isset($inf['id'],$bot['id'])) { - // . - mysql_query('DELETE FROM `users` WHERE `id` = "'.$bot['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `stats` WHERE `id` = "'.$bot['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$bot['id'].'" LIMIT 1000'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$bot['id'].'" LIMIT 1000'); - } - - if($pl['team'] == $this->info['winner'] && $this->info['winner'] != 0) { - - $inf['add_expn'] = 3000; - - $inf['add_expp'] = array( - 0, - 1, - 5, - 10, - 15, - 25, - 35, - 70, - 100, - 150, - 200, - 300, - 500, - 700, - 1000 - ); - - //$inf['add_expn'] = floor($inf['add_expn']/100*$inf['add_expp'][$inf['level']]); - //$inf['add_expn'] = floor($inf['add_expn']/100*$inf['add_expp'][7]); - // ( 0 12 ) - $inf['add_expn'] = array( 10 , 30 , 55 , 62 , 92 , 180 , 350 , 1350 , 4500 , 7000 , 21000 , 30000 , 35000 ); - $inf['add_expn'] = $inf['add_expn'][$inf['level']]; - - mysql_query('UPDATE `users` SET `win` = `win` + 1,`win_t` = `win_t` + 1 WHERE `id` = "'.$inf['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `exp` = `exp` + '.$inf['add_expn'].' WHERE `id` = "'.$inf['id'].'" LIMIT 1'); - $win .= ''.$inf['login'].', '; - - $r = ' . , : '.$inf['add_expn'].'.'; - - /*if( $this->info['users_in'] >= 10 ) { - $r .= ' 10 : 1 . .'; - $u->addItem(4393,$inf['id'],''); - }*/ - - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','".$inf['room']."','','".$inf['login']."','".$r."','".time()."','6','0')"); - }elseif($pl['team'] != $this->info['winner'] && $this->info['winner'] != 0) { - mysql_query('UPDATE `users` SET `lose` = `lose` + 1,`lose_t` = `lose_t` + 1 WHERE `id` = "'.$inf['id'].'" LIMIT 1'); - - $lose .= ''.$inf['login'].', '; - - }else{ - mysql_query('UPDATE `users` SET `nich` = `nich` + 1 WHERE `id` = "'.$inf['id'].'" LIMIT 1'); - } - mysql_query('DELETE FROM `users_turnirs` WHERE `uid` = "'.$inf['id'].'" LIMIT 1'); - } - mysql_query('UPDATE `users` SET `inUser` = "0",`inTurnirnew` = "0" WHERE `inTurnirnew` = "'.$this->info['id'].'" LIMIT '.$this->info['users_in']); - mysql_query('UPDATE `turnirs` SET `chat` = 4 , `winner` = -1,`users_in` = 0,`status` = 0,`winner` = -1,`step` = 0,`time` = "'.(time()+$this->info['time2']).'",`count` = `count` + 1 WHERE `id` = '.$this->info['id'].' LIMIT 1'); - - if($win != '') { - $win = rtrim($win,', '); - $lose = rtrim($lose,', '); - $win = ' : '.$win.'. : '.$lose.'. '.$u->timeOut($this->info['time2']).' ('.date('d.m.Y H:i',(time()+$this->info['time2'])).').'; - }else{ - $win = ' . '.$u->timeOut($this->info['time2']).' ('.date('d.m.Y H:i',(time()+$this->info['time2'])).').'; - } - $r = ' . '.$win; - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')"); - } - } - - public function locationSee() { - global $c,$u; - - $r = ''; - - $tm1 = ''; - - $tm2 = ''; - - $noitm = array( - 869 => 1, - 1246 => 1, - 155 => 1, - 1245 => 1, - 678 => 1 - ); - - if($this->info['step'] != 3 && $this->info['step'] != 0) { - // - if(isset($_GET['gocomplect']) && $this->user['points'] < 2) { - $aso = explode(',',$this->user['items']); - $ast = explode('-',$_GET['gocomplect']); - $asg = array(); - $asj = array(); - $asgp = array(); - - $i = 0; - while($i < count($aso)) { - if($aso[$i] > 0) { - $asg[$aso[$i]] = true; - } - $i++; - } - - $i = 0; $j = 0; $noitm = 0; - $addi = 1; - while($i < count($ast)) { - if($ast[$i] > 0) { - if($asg[$ast[$i]] != true) { - $noitm++; - } - $itm = mysql_fetch_array(mysql_query('SELECT `id`,`inSlot`,`price1` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($ast[$i]).'" LIMIT 1')); - if(isset($itm['id'])) { - $itm2 = mysql_fetch_array(mysql_query('SELECT `iid`,`price_1` FROM `items_shop` WHERE `item_id` = "'.mysql_real_escape_string($ast[$i]).'" AND `kolvo` > 0 LIMIT 1')); - if($itm2['price_1'] > $itm['price1']) { - $itm['price1'] = $itm2['price_1']; - } - if($itm['inSlot'] == 3) { - $asg[$itm['inSlot']][count($asg[$itm['inSlot']])] = $itm['id']; - $asgp[$itm['inSlot']][count($asgp[$itm['inSlot']])] = $itm['price1']; - $j++; - }elseif($itm['inSlot'] == 10) { - $asg[$itm['inSlot']][count($asg[$itm['inSlot']])] = $itm['id']; - $asgp[$itm['inSlot']][count($asgp[$itm['inSlot']])] = $itm['price1']; - $j++; - }else{ - $asg[$itm['inSlot']] = $itm['id']; - $asp[$itm['inSlot']] = $itm['price1']; - $j++; - } - } - } - $i++; - } - - if($noitm > 0) { - echo ' !'; - $addi = 0; - }elseif(count($asg[3]) > 2) { - echo ' , '; - $addi = 0; - }elseif(count($asg[10]) > 3) { - echo ' , '; - $addi = 0; - }elseif($j > 16) { - echo ' '; - $addi = 0; - }elseif($j < 1) { - echo ' '; - $addi = 0; - } - - //$addi = 0; - - if($addi == 1) { - - $i = 0; - while($i <= 17) { - if($i == 10) { - if($asg[$i][0] > 0) { - $u->addItem($asg[$i][0],$u->info['id']); - $this->user['points'] += 1+round($asgp[$i][0]); - } - if($asg[$i][1] > 0) { - $u->addItem($asg[$i][1],$u->info['id']); - $this->user['points'] += 1+round($asgp[$i][1]); - } - if($asg[$i][2] > 0) { - $u->addItem($asg[$i][2],$u->info['id']); - $this->user['points'] += 1+round($asgp[$i][2]); - } - }elseif($i == 3) { - if($asg[$i][0] > 0) { - $u->addItem($asg[$i][0],$u->info['id']); - $this->user['points'] += 1+round($asgp[$i][0]); - } - if($asg[$i][1] > 0) { - $u->addItem($asg[$i][1],$u->info['id']); - $this->user['points'] += 1+round($asgp[$i][1]); - } - }elseif($asg[$i] > 0) { - $u->addItem($asg[$i],$u->info['id']); - $this->user['points'] += 1+round($asgp[$i]); - } - $i++; - } - - mysql_query('UPDATE `users_turnirs` SET `points` = "'.$this->user['points'].'",`items` = "0" WHERE `bot` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `ability` = "100",`skills` = "10" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `level` = "12" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `turnirs` SET `step` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - - $this->info['step'] = 0; - $this->info['items'] = '0'; - } - } - } - - if($this->info['step'] == 3) { - $this->finishTurnir(); - }elseif($this->info['step'] == 0) { - // - $po = array(0,0); - $sp = mysql_query('SELECT * FROM `users_turnirs` WHERE `turnir` = "'.$this->info['id'].'" AND `points` > 3 ORDER BY `points` DESC LIMIT '.$this->info['users_in']); - $tmr = rand(1,2); - if($tmr == 1) { - $tmr = array(2,1); - }else{ - $tmr = array(1,2); - } - while($pl = mysql_fetch_array($sp)) { - $inf = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1')); - $bot = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$pl['bot'].'" LIMIT 1')); - if(isset($inf['id'],$bot['id'])) { - if($po[1] == $po[2]) { - $tm = rand(1,2); - }elseif($po[1] > $po[2]) { - $tm = 2; - }else{ - $tm = 1; - } - //$tm = $tmr[$tm]; - $bot['team'] = $tm; - $po[$bot['team']] += $pl['points']; - mysql_query('UPDATE `stats` SET `team` = "'.$bot['team'].'" WHERE `id` = "'.$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users_turnirs` SET `team` = "'.$bot['team'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `turnirs` SET `step` = "1" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - - $sp = mysql_query('SELECT * FROM `users_turnirs` WHERE `turnir` = "'.$this->info['id'].'" LIMIT '.$this->info['users_in']); - $po = array(0,0); - while($pl = mysql_fetch_array($sp)) { - $inf = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1')); - $bot = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `u`.`id` = "'.$pl['bot'].'" LIMIT 1')); - if(isset($inf['id'],$bot['id'])) { - $po[$bot['team']] += $pl['points']; - //${'tm'.$bot['team']} .= ''.$bot['login'].' ['.$bot['level'].']
    '; - ${'tm'.$bot['team']} .= $u->microLogin($bot,2).'
    '; - } - } - $r .= ''; - $r .= '

    «'.$this->name[$this->info['type']].'»


    '.$u->timeOut($this->info['time'] - time()).'! '; - - if(isset($_GET['hpregenNowTurnir'])) { - if($u->stats['hpNow'] < $u->stats['hpAll'] || $u->stats['mpNow'] < $u->stats['mpAll']) { - mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->stats['hpAll'].'",`mpNow` = "'.$u->stats['mpAll'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - - if($this->user['points'] < 3) { - // - if($this->user['points'] < 2) { - $r .= ''; - }else{ - $r .= ' '; - } - }else{ - $r .= ' !'; - $r .= '   '; - } - - $r .= '
    '; - if($this->user['points'] < 3) { - if($this->user['items'] != '0') { - $r .= '
    '; - if($this->user['items'] == '') { - // - $ai = ''; - - $sp = mysql_query('SELECT `a`.*,`b`.* FROM `items_shop` AS `a` LEFT JOIN `items_main` AS `b` ON (`a`.`item_id` = `b`.`id`) WHERE `a`.`sid` = 1 AND - (`a`.`r` != 5 AND `a`.`r` != 9 AND `a`.`r` <= 18 AND `a`.`kolvo` > 0 AND `cantBuy` = 0 AND `a`.`level` < 9 AND `b`.`level` < 9) AND - `b`.`class` != 6'); - while($pl = mysql_fetch_array($sp)) { - if(!isset($noitm[$pl['item_id']])) { - $aso[$pl['inslot']][count($aso[$pl['inslot']])] = $pl; - } - } - - $j = 1; - $com = array(); - while($j <= 5) { - $i = 0; - while($i <= 17) { - if($i == 3) { - // - $com[$i] = $aso[$i][rand(0,count($aso[$i])-1)]; - }elseif($i == 14) { - // - $com[$i] = $aso[$i][rand(0,count($aso[$i])-1)]; - }else{ - // - $com[$i] = $aso[$i][rand(0,count($aso[$i])-1)]; - if($i == 10) { - $ai .= $com[$i]['id'].','; - $com[$i] = $aso[$i][rand(0,count($aso[$i])-1)]; - $ai .= $com[$i]['id'].','; - //$com[$i] = $aso[$i][rand(0,count($aso[$i])-1)]; - //$ai .= $com[$i]['id'].','; - } - } - if($com[$i]['id'] > 0 && $i != 10) { - $ai .= $com[$i]['id'].','; - } - $i++; - } - $j++; - } - unset($com); - - $ai .= '0'; - $this->user['items'] = $ai; - mysql_query('UPDATE `users_turnirs` SET `items` = "'.$ai.'" WHERE `id` = "'.$this->user['id'].'" LIMIT 1'); - } - - // - $ai = explode(',',$this->user['items']); - $i = 0; $ia = array(); - while($i < count($ai)) { - if($ai[$i] > 0) { - $pli = mysql_fetch_array(mysql_query('SELECT `id`,`inSlot`,`name`,`type`,`img`,`level` FROM `items_main` WHERE `id` = "'.$ai[$i].'" LIMIT 1')); - $ia[$pli['inSlot']][count($ia[$pli['inSlot']])] = $pli; - unset($pli); - } - $i++; - } - unset($ai); - - $r .= ' :
    '; - ?> - - - 0) { - $j = 0; - while($j < count($ia[$i])) { - $r .= ''; - $j++; - } - $r .= '
    '; - } - $i++; - } - - } - - } - $r .= '
    '; - //$r .= ' 1: '.rtrim($tm1,', '); - //$r .= '
    2: '.rtrim($tm2,', '); - - $r .= ' - - - - - - - - -
    1 2
    '.rtrim($tm1,', ').''.rtrim($tm2,', ').'
    '; - - - if( ($this->info['time'] - time() < 0) && $this->info['step'] == 1) { - // - $this->startTurnir(); - } - - echo $r; - } - -} -$tur = new turnir; -$tur->start(); -?> \ No newline at end of file diff --git a/_incl_data/class/__user.php b/_incl_data/class/__user.php deleted file mode 100644 index a990e51c..00000000 --- a/_incl_data/class/__user.php +++ /dev/null @@ -1,10772 +0,0 @@ - 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 => '', - 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' => ' '] - ]; - public $btl_txt = '', $rgd = [0 => 0, 1 => 0], $error = '', - - $city_unid = [0, 'capitalcity', 'angelscity', 'abandonedplain', 'newcapitalcity', 'demonscity', 'fallenearth', 'emeraldscity', 'dreamscity', 'suncity', 'devilscity'], - $city_id = ['capitalcity' => 1, 'angelscity' => 2, 'abandonedplain' => 3, 'newcapitalcity' => 4, 'demonscity' => 5, 'fallenearth' => 6, 'emeraldscity' => 6, 'suncity' => 7, 'dreamscity' => 8, 'devilscity' => 10], - $city_name = ['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', 'devilscity' => 'Devils City'], - $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' => ' (HP)', - 'mpAll' => ' (P)', - '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'], - 'add' => [ - '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', 'm21', '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' => ['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'] - ]; - - public function sys_add($uid, $time, $type, $text, $data, $time_see) - { - } - - public function repexp_add($id, $val) - { - mysql_query('UPDATE `stats` SET `repexp` = `repexp` + "' . $val . '" WHERE `id` = "' . $id . '" LIMIT 1'); - } - - public function dayquest($id) - { - - $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' => ' ' - ]; - - if (!isset($test['id'])) { - $n = " "; - } else { - $n = " "; - $n = $n . "
    " . $q[$test['vals']] . ""; - } - - return $n; - } - - public function pensia($type) - { - if ($type == false) { - if (($this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] > 12) && $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'] > 12) && $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 = [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 = [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']) && floor($a['align']) > 0 && 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 .= ' '; - } else { - $r .= ' '; - } - $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 .= ' '; - } else { - $r .= ' '; - } - } - // - } - 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 = [ - 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 = []; - 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 = []; - 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) - { - } - - public function del_buf($id, $uid = null, $mod = null) - { - } - - public function see_buf($id, $uid = null, $mod = null) - { - } - - public function sys_see($type) - { - } - - 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 = []; - 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 = []; - $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']) && $ub['lose'] <= 0 && $ub['nich'] <= 0) { - $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'] . "','! " "! : " . $bsep . ", : " . $mn . " .','-1','6','0')"); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','! " ", : " . $winr['login'] . "! !','-1','5','0')"); - $this->addDelo(1, $uid, '"WinTournament.' . $this->info['city'] . '" ( ): "' . $mn . ' ."', 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','','','! " ", : .','-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 = ['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]; - } - return $r; - } - - // \ - public function plavka($id, $type) - { - $e = ''; - $rn = 1; - $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']); - if ($pl['level'] == 0) { - $pl['level'] = 0 + $po['tr_lvl']; - } - - - 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'] < 0)//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'])) { - $pl['rep'] = 1; - // - // mysql_query('UPDATE `rep` SET `rep1` = `rep1` + "'.$pl['rep'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1')); - - $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'] . '...'; - } - } 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 .= '' . $pl['name'] . ' [' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . ']
    '; - } - } - $r = '
    ' . $r . '
    '; - 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['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; - - $p['B'][0] = ceil($st['s1'] * 1); - $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['pa3']; - $bn = $st['a5']; - } - // - - $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); - - $tp = [0 => ceil($min), 1 => ceil($max), 2 => ceil($kmin), 3 => ceil($kmax)]; - } - return $tp; - } - - // - public function zago($v) - { - if ($v > 1700) { - $v = 1700; - } - return round((1 - (pow(0.5, ($v / 399.51)))) * 100, 2); - } - - // () - 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 = []; - /* */ - $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 .= '' . $y[0] . '-' . $y[1] . ''; - } 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 .= ' / ' . $y[0] . '-' . $y[1] . ''; - } - /* --- */ - } elseif ($v == 'yron') { - $y = []; - /* */ - $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 .= '' . $y[0] . '-' . $y[1] . ''; - } 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 .= ' / ' . $y[0] . '-' . $y[1] . ''; - } - } else { - // - $y = []; - /* */ - $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 .= '' . $y . ''; - } 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 .= ' / ' . $y . ''; - } 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) - { - 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) . "'")); - } - - 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 && $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, '"AddItems.' . $this->info['city'] . '": "' . $i['name'] . '" (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'] = ''; - if ($bus['align'] > 0) { - $bus['login_BIG'] .= ''; - } - if ($bus['align2'] > 0) { - $bus['login_BIG'] .= ''; - } - if ($bus['clan'] > 0) { - $bus['login_BIG'] .= ''; - } - $bus['login_BIG'] .= '' . $bus['login'] . '[' . $bus['level'] . ']'; - 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 .= ''; - } - if ($inf['align2'] > 0) { - $r .= ''; - } - 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 .= ''; - } - } - if ($inf['cityreg'] == '') { - $inf['cityreg'] = 'capitalcity'; - } - $r .= ' ' . $inf['login'] . ' [' . $inf['level'] . ']'; - } else { - $r = ' [??]'; - } - 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 addKr($amount) - { - Db::sql('update users set money = money + ? where id = ?', [$amount, $this->info['id']]); - } - - public function addEkr($amount) - { - Db::sql('update users set money2 = money2 + ? where id = ?', [$amount, $this->info['id']]); - } - - 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`.`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`,`u`.`ang_g`,`u`.`referals`, - `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`,`st`.`alog`,`st`.`mlog`,`st`.`seff`,`st`.`expstopu`,`st`.`upexpdate`,`st`.`repexp`, - `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')); - $this->info['relik'] = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) AS relik FROM `items_users` WHERE `item_id` = 4754 AND `uid`="' . $this->info['id'] . '" AND `delete` =0')); - $this->info['achiv'] = mysql_fetch_array(mysql_query('SELECT * FROM `users_achiv` WHERE `id`="' . $this->info['id'] . '" LIMIT 1')); - if (!isset($this->info['achiv']['id'])) { - mysql_query('INSERT INTO `users_achiv`(`id`, `zb`, `zb_n`, `vx`, `vx_n`, `snt`, `snt_n`, `rp`, `rp_n`, `rn`, `rn_n`, `rb`, `rb_n`, `pg`, `pg_n`, `bv`, `bv_n`, `kw`, `kw_n`, `pa`, `pa_n`) VALUES ("' . $this->info['id'] . '",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)'); - $this->info['achiv'] = mysql_fetch_array(mysql_query('SELECT * FROM `users_achiv` WHERE `id`="' . $this->info['id'] . '" LIMIT 1')); - } - - if ($c['securetime'] > 0) { - if (!defined('IP')) { - $dip = $_SERVER['REMOTE_ADDR']; - define('IP', $dip); - } - - if (isset($this->info['id']) && ($this->info['ip'] != IP || $this->info['banned'] > 0) && $_SERVER['REQUEST_URI'] != '/') { - unset($this->info, $_COOKIE['login'], $_COOKIE['pass']); - die(''); - } - } - - 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']) { - $md = [$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`.`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`,`st`.`alog`,`st`.`mlog`,`st`.`seff`,`st`.`expstopu`,`st`.`upexpdate`,`st`.`repexp` - 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 (!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` - 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'] = ''; - } 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`+`repdevilscity`) as allrep, - (`nu_capitalcity`+`nu_demonscity`+`nu_angelscity`+`nu_suncity`+`nu_dreamscity`+`nu_abandonedplain`+`nu_sandcity`+`nu_emeraldscity`+`nu_devilscity`) 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'); - } - - 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'); - // - unset($this->tfer, $upd); - } - } - } - } - - /* - - */ - - // - $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 .= '"' . $itm_id['name'] . '"'; - } - $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() - 120) . ' 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 < 10) { - $this->addAction(time(), 'create_snowball_cp', $this->info['city']); - $magic->add_eff($this->info['id'], 24); - $this->error2 = ' , ' . (10 - $smt) . ' ...'; - } else { - $this->error2 = ' 10 ...'; - } - } - } - } - } - } - - 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[] = ' '; - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; - } else { - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; - } - $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() - { - return null; - } - - public function addAction($time, $vars, $vls, $uid = null) - { - if ($uid == null) { - $uid = $this->info['id']; - } - $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) . '")'); - - return (bool)$ins; - } - - 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 . '')); - } else if ($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) - { - 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')); - } - - 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); - - $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.20 * ($round))); - $statss['s2'] = ceil($statss['s2'] * (1 + 0.20 * ($round))); - $statss['s3'] = ceil($statss['s3'] * (1 + 0.20 * ($round))); - $statss['s4'] = ceil($statss['s4'] * (1 + 0.20 * ($round))); - // - $statss['hpAll'] = ceil($statss['hpAll'] * (1 + 0.20 * ($round))); - $statss['mpAll'] = ceil($statss['mpAll'] * (1 + 0.20 * ($round))); - // - $statss['m1'] = ceil($statss['m1'] * (1 + 0.20 * ($round))); - $statss['m2'] = ceil($statss['m2'] * (1 + 0.20 * ($round))); - $statss['m3'] = ceil($statss['m3'] * (1 + 0.20 * ($round))); - $statss['m4'] = ceil($statss['m4'] * (1 + 0.20 * ($round))); - $statss['m5'] = ceil($statss['m5'] * (1 + 0.20 * ($round))); - $statss['za'] = ceil($statss['za'] * (1 + 0.20 * ($round))); - $statss['zm'] = ceil($statss['zm'] * (1 + 0.20 * ($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 = []; - $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)] = [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 = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' . ' . $trnt . '
    .'; - - $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','','',' ! ".$this->info['login']." "".$i['name']."" , !','-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'], '"Shop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
    .'; - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' . ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - if (!$ld) { - echo '
    , /db/usersDelo/!
    '; - } - } - } 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 = []; - $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)] = [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 = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' $. ' . $trnt . '
    .'; - - $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','','',' ! ".$this->info['login']." "".$i['name']."" , !','-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'], '"Shop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] ' . $price . ' $', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' $
    .'; - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' $ ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - if (!$ld) { - echo '
    , /db/usersDelo/!
    '; - } - } - } 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 = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' .
    .'; - mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1'); - $ld = $this->addDelo(1, $this->info['id'], '"EkrShop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ',add items ' . $gix . ') [#' . $i['iid'] . '] ' . $price . ' .', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', (int)$price, 0); - } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
    .'; - $ld = $this->addDelo(1, $this->info['id'], '"EkrShop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' .', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', 0, 0); - if (!$ld) { - echo '
    , /db/usersDelo/!
    '; - } - } - } 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 = []; - $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)] = [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 = '
    : ' . $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 = []; - 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['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 = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' . ' . $trnt . '
    .'; - } else { - $r = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $this->zuby($price) . '. ' . $trnt . '
    .'; - } - - $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'], '"Shop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
    .'; - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - if (!$ld) { - echo '
    , /db/usersDelo/!
    '; - } - } - } 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 && $sid == 1) { - $i['price_1'] = round($i['price_1'] / 100 * 95, 2); - } - - // 5% - if ($this->stats['silver'] >= 5 && $sid == 2) { - $i['price_2'] = round($i['price_2'] / 100 * 95, 2); - } - - $price = $i['price_1'] * $x; - - $trnt = ''; - $detrn = []; - $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)] = [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 = '
    : ' . $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 = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' . ' . $trnt . '
    .'; - } else { - $r = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $this->zuby($price) . '. ' . $trnt . '
    .'; - } - - $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 = ' ( )'; - } - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] ' . $price . ' .' . $zuby_inf . '', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
    .'; - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - if (!$ld) { - echo '
    , /db/usersDelo/!
    '; - } - } - } else { - $r = ' ...'; - } - } - } - } else { - $r = ' '; - } - return '
    ' . $r . '
    '; - } - - public function takeBonus() - { - 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) - { - 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) - { - $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'); - - $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 = ' "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '" ' . $price . ' .
    .'; - $ld = $this->addDelo(1, $this->info['id'], '"ComissShop.' . $this->info['city'] . '": "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '" [item:' . $iid . '] ' . $price . ' . [: ' . ($i2['login'] != '' ? '' . $i2['login'] . '' : '(' . $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'], '"ComissShop.' . $this->info['city'] . '": "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '" [item:' . $iid . '] ' . $price . ' . [: ' . $this->info['login'] . ']', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', 0, $price); - } else { - // - $r = ' "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
    .'; - $ld = $this->addDelo(1, $this->info['id'], '"EkrShop.' . $this->info['city'] . '": #' . $i1['iid'] . '. : ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - if (!$ld) echo '
    , /db/usersDelo/!
    '; - } - } else { - $r = ' ...'; - } - } - } else - $r = ' '; - return '
    ' . $r . '
    '; - } - - 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") { - $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 = ['--', '--', '--', '--']; - } - 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 = '
    '; - if ($preview == "full") { - $is1 .= ' '; - } elseif ($preview == "preview") { - $is1 .= ' '; - } - // - - $col = $this->itemsX($pl[0]); - if ($col > 1 && $pl['inGroup'] != 0 && $pl['inGroupCount'] > 1) { - $pl['kolvo'] = $col; - $pl['name'] .= ' (x' . $col . ')'; - } - $is2 .= '' . $pl['name'] . '    '; - 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 .= ' '; - } - if (isset($po['art'])) { - $is2 .= ' '; - } - if (isset($po['sudba'])) { - if ($po['sudba'] == '0') { - $is2 .= ' '; - } elseif ($po['sudba'] == '1') { - $is2 .= ' '; - } else { - $is2 .= ' '; - } - } - } - // - $is2 .= '
    : '; - if ($steck[0] > 1 && $preview == "preview") { - $is2 .= $steck[3] . '-' . $steck[4] . ' . '; - } else { - $is2 .= $pl['1price'] . ' . '; - } - if ($pl['pricerep'] > 0) { - $is2 .= ' (' . round($pl['pricerep'], 2) . ' )'; - } - - // - if ($pl['iznosMAX'] > 0) { - $izcol = ''; - if (floor($pl['iznosNOW']) >= (floor($pl['iznosMAX']) - ceil($pl['iznosMAX']) / 100 * 20)) { - $izcol = 'brown'; - } - } - if ($preview == "preview") { - $is2 .= '
    : ' . floor($steck[1]) . '/' . ceil($steck[2]) . ''; - } else { - if ($pl['iznosMAXi'] == 999999999) { - $is2 .= '
    : '; - } else { - $is2 .= '
    : ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . ''; - } - } - // - - if ($po['srok'] > 0) { - $pl['srok'] = $po['srok']; - } - if ($pl['srok'] > 0 and $preview != "preview") { - if ($pl['time_create'] + $pl['srok'] < time()) { - $is2 .= '
    : ' . $this->timeOut($pl['srok']) . ' ()'; - } else { - $is2 .= '
    : ' . $this->timeOut($pl['srok']) . ' ( ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')'; - } - } elseif ($pl['srok'] > 0) { - $is2 .= '
    : ' . $this->timeOut($pl['srok']); - } - if ($pl['magic_chance'] > 0) { - $is2 .= '
    : ' . 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 .= '
    : ' . $this->timeOut($efi['actionTime']); - } - } - if ($preview == "full" || $preview == "preview") { - // : - $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 .= ''; - $notr++; - } - unset($temp); - } elseif ($n != 'align' || floor($this->info['align']) != $po['tr_' . $n]) { - $tr .= ''; - $notr++; - } - } - $tr .= '
    '; - 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 .= '
    '; - } - } - } - $x++; - } - - if ($tr != '') { - $is2 .= '
    :' . $tr; - } - // : - $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 .= '
    ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n]; - } - $x++; - } - // () - $i = 1; - $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) { - $z = '+'; - if ($po['add_mab' . $i] < 0) { - $z = ''; - } - $tr .= '
    ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i]; - } else { - $tr .= '
    ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i] . ' (' . $this->bronFx([$po['add_mib' . $i], $po['add_mab' . $i]]) . ')'; - } - } - $i++; - } - if ($tr != '') { - $is2 .= '
    :' . $tr; - } - // : - $tr = ''; - $t = $this->items['sv']; - if (isset($po['sv_yron_min'], $po['sv_yron_max'])) { - $tr .= '
    : ' . $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 .= '
    ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n]; - } - $x++; - } - if ($pl['2too'] == 1) { - $tr .= '
    '; - } - if ($pl['2h'] == 1) { - $tr .= '
    '; - } - if (isset($po['zonb'])) { - $tr .= '
    : '; - if ($po['zonb'] > 0) { - $x = 1; - while ($x <= $po['zonb']) { - $tr .= '+'; - $x++; - } - } else { - $tr .= ''; - } - } - - if ($tr != '') { - $is2 .= '
    :' . $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 .= '
    : ' . $po['imposed_name'] . ' '; - unset($rnc); - } - if ($tr != '') { - $is2 .= '
    :'; - $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 .= '
    :'; - $is2 .= '• : ' . $po['free_stats'] . ''; - } - if (floor($pl['iznosNOW']) >= ceil($pl['iznosMAX'])) { - $d[0] = 0; - $d[2] = 0; - } - if (isset($po['complect']) || isset($po['complect2'])) { - $is2 .= '
    :'; - } - if (isset($po['complect'])) { - // - $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'] .= '    • ' . $plc['x'] . ': '; - // - $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'] .= '    ' . $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } else { - $com1['text'] .= $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } - $com1['text'] .= '
    '; - $i2c++; - } - $i1c++; - } - unset($i1c, $i2c, $i3c); - $com1['x']++; - } - $is2 .= '
    • : ' . $com1['name'] . '
    '; - $is2 .= $com1['text']; - $is2 .= ''; - } - if (isset($po['complect2'])) { - // - $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'] .= '    • ' . $plc['x'] . ': '; - // - $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'] .= '    ' . $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } else { - $com1['text'] .= $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } - $com1['text'] .= '
    '; - $i2c++; - } - $i1c++; - } - unset($i1c, $i2c, $i3c); - $com1['x']++; - } - $is2 .= '
    • (): ' . $com1['name'] . '
    '; - $is2 .= $com1['text']; - $is2 .= ''; - } - - $is2 .= ''; - if (isset($po['gravi'])) { - $is2 .= '
    : ' . $po['gravi'] . ''; - } - if ($pl['info'] != '') { - $is2 .= '
    :
    ' . $pl['info'] . '
    '; - } - if ($po['info'] != '') { - $is2 .= '
    ' . $po['info'] . '
    '; - } - if ($pl['max_text'] - $pl['use_text'] > 0) { - $is2 .= '
    : ' . ($pl['max_text'] - $pl['use_text']) . '
    '; - } - if ($pl['maidin'] != '') { - // $is2 .= '
    '.$this->city_name[$pl['maidin']].'
    '; - } - if (isset($po['noremont'])) { - $is2 .= '
    '; - } - if (isset($po['nosale'])) { - $is2 .= '
    '; - } - if (isset($po['nomodif'])) { - $is2 .= '
    '; - } - if (isset($po['nodelete'])) { - $is2 .= '
    '; - } - if (isset($po['frompisher']) && $po['frompisher'] > 0) { - $is2 .= '
    '; - } - if (isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0) { - $is2 .= '
    '; - } - if (isset($po['fromlaba']) && $po['fromlaba'] > 0) { - $is2 .= '
    '; - } - if (isset($po['vip_sale']) && $po['vip_sale'] > 0) { - $is2 .= '
    10%
    '; - } - if ($pl['dn_delete'] > 0) { - $is2 .= '
    '; - } - if ($this->pokol > $pl['geni']) { - $is2 .= '
    '; - } - if (isset($po['zazuby']) && $po['zazuby'] > 0) { - $is2 .= '
    '; - } - //$is2 .= '
    '.$this->city_name[$this->info['city']].'
    '; - $is2 .= '
    '; - } - if ($preview == "preview") { - $kolvoprint = ": $steck[0] ."; - } - echo '' . $is1 . '' . $kolvoprint . $is2 . ''; - $i++; - } - } - if ($i == 0) echo ' '; - } - - public $sid_zuby = [ - // - 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 `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 `item_id` = "' . mysql_real_escape_string($_GET['itmid']) . '" AND `kolvo` > 0 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'); - - $cr = 'c8c8c8'; - $i = 0; - $jid = 0; - while ($pl = mysql_fetch_array($cl)) { - if ($pl['kolvo'] > 0) { - $jid++; - $cr = $cr == 'd4d4d4' ? 'c8c8c8' : '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['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) { - // + - $po['zonb']++; - } - - $is2 = ''; - if ($pl['type'] == 71) { - $is1 = '
    '; - } else { - $is1 = '
    '; - } - if ($sid == 609) { - $is1 .= ''; - } else { - //if($this->info['money']>$pl['price']) - //{ - if ($sid == 2 || $sid == 777) { - $is1 .= ' '; - } else { - $is1 .= ' '; - } - //} - - if ($pl['nozuby'] == 0 && $this->info['level'] > 0 && $this->info['level'] < 8 && $pl['level'] < 8 && $sid_zuby == 1 && $c['zuby']) { - $is1 .= '
    '; - } - } - - // - - if (isset($po['tr_align']) && !isset($po['tr_align_bs'])) { - $pl['name'] .= ''; - } elseif (isset($po['tr_align_bs'])) { - if ($po['tr_align_bs'] == '1') { - $pl['name'] .= ''; - } elseif ($po['tr_align_bs'] == '3') { - $pl['name'] .= ''; - } - } - - if (isset($po['renameadd']) && $po['renameadd'] != '') { - $pl['name'] .= ' (: ' . $po['renameadd'] . ')'; - } - if (isset($po['icos'])) { - $pl['name'] = '' . $pl['name'] . '  ' . $po['icos'] . ' '; - } - $is2 .= '' . $pl['name'] . '    '; - - - if ($pl['massa'] > 0) { - $is2 .= '(: ' . round($pl['massa'], 2) . ')'; - } - - if (isset($po['art'])) { - $is2 .= ' '; - } - - if (isset($po['sudba'])) { - if ($po['sudba'] == '0') { - $is2 .= ' '; - } elseif ($po['sudba'] == '1') { - $is2 .= ' '; - } else { - $is2 .= ' '; - } - } - - // - if ($this->info['admin'] > 0) { - $is2 .= '
      ' . $pl['pos'] . '  
    '; - } - $is2 .= '
    : '; - if ($this->stats['silver'] >= 1 && $sid == 1) { - $is2 .= ''; - } elseif ($this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777)) { - $is2 .= ''; - } - if ($sid == 609) { - if ($pl['price_4'] > ($this->rep['rep3'] - $this->rep['rep3_buy'])) { - $is2 .= '' . round($pl['price_4']) . ''; - } else { - $is2 .= '' . round($pl['price_4']) . ''; - } - - $is2 .= ' '; - } elseif ($pl['price_3'] > 0) { - if ($pl['price_3'] > $this->info['money3']) { - $is2 .= '' . $pl['price_3'] . ''; - } else { - $is2 .= $pl['price_3']; - } - $is2 .= ' $ '; - } elseif ($sid == 2 || $sid == 777) { - $is .= ''; - if ($pl['price_2'] > $this->info['money2']) { - $is2 .= '' . $pl['price_2'] . ''; - } else { - $is2 .= $pl['price_2']; - } - $is2 .= ' . '; - } else { - if ($pl['price_1'] > $this->info['money']) { - $is2 .= '' . $pl['price_1'] . ''; - } else { - $is2 .= $pl['price_1']; - } - $is2 .= ' . '; - } - if ($this->stats['silver'] >= 1 && $sid == 1) { - $is2 .= '   '; - if ($pl['price_1'] > $this->info['money']) { - $is2 .= '' . round($pl['price_1'] * 0.95, 2) . ''; - } else { - $is2 .= round($pl['price_1'] * 0.95, 2); - } - $is2 .= ' . -5%'; - } elseif ($this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777)) { - $is2 .= '   '; - if ($pl['price_2'] > $this->info['money2']) { - $is2 .= '' . round($pl['price_2'] * 0.95, 2) . ''; - } else { - $is2 .= round($pl['price_2'] * 0.95, 2); - } - $is2 .= ' . -5%'; - } - - if ($pl['pricerep'] > 0) { - $is2 .= ' (' . round($pl['pricerep'], 2) . ' )'; - } - - if ($pl['kolvo'] < 100000) { - $is2 .= '     (: ' . $pl['kolvo'] . ')'; - } - - 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 .= ' (' . ltrim($this->zuby(round($pl['price_1'] * 0.95, 2)), ' ') . ')'; - } else { - $is2 .= ' (' . ltrim($this->zuby($pl['price_1']), ' ') . ')'; - } - } - } - } - - 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 .= '[' . $tis['name'] . '] x' . $tims[1] . ', '; - } - } - $j++; - } - if ($c['noitembuy'] == true) { - $trn = 1; - $ttmm = ''; - } - - if ($ttmm != '') { - $ttmm = '
    : ' . rtrim($ttmm, ', ') . ' '; - if ($trn == 0) { - $ttmm = '' . $ttmm . ''; - } - } - } - - $is2 .= $ttmm . '
    '; - unset($ttmm); - - - // - if ($pl['iznos'] > 0) { - $pl['iznosMAXi'] = $pl['iznos']; - } - if ($pl['iznosMAXi'] > 0) { - if ($pl['iznosMAXi'] == 999999999) { - $is2 .= ':
    '; - } else { - $is2 .= ': 0/' . $pl['iznosMAXi'] . '
    '; - } - } - - if ($po['battleUseZd'] > 0) { - $is2 .= ' : ' . $this->timeOut($po['battleUseZd']) . '
    '; - } - - $is2 = rtrim($is2, '
    '); - - // - if ($po['srok'] > 0) { - $pl['srok'] = $po['srok']; - } - if ($pl['srok'] > 0) { - $is2 .= '
    : ' . $this->timeOut($pl['srok']); - } - if ($pl['magic_chance'] > 0) { - $is2 .= '
    : ' . 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 .= '
    : ' . $this->timeOut($efi['actionTime']); - } - } - - // : - $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 .= ''; - $notr++; - } - unset($temp); - } elseif ($n != 'align' || floor($this->info['align']) != $po['tr_' . $n]) { - $tr .= ''; - $notr++; - } - } - $tr .= '
    '; - 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 .= '
    '; - } - } - } - $x++; - } - if ($tr != '') { - - $is2 .= '
    :' . $tr; - } - // : - $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 .= '
    ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n]; - } - $x++; - } - // () - $i = 1; - $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) { - $z = '+'; - if ($po['add_mab' . $i] < 0) { - $z = ''; - } - $tr .= '
    ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i]; - } else { - $tr .= '
    ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i]; - } - } - $i++; - } - - if ($tr != '') { - $is2 .= '
    :' . $tr; - } - // : - $tr = ''; - $t = $this->items['sv']; - if (isset($po['sv_yron_min'], $po['sv_yron_max'])) { - $tr .= '
    : ' . $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 .= '
    ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n]; - } - $x++; - } - if ($pl['2too'] == 1) { - $tr .= '
    '; - } - if ($pl['2h'] == 1) { - $tr .= '
    '; - } - if (isset($po['zonb'])) { - $tr .= '
    : '; - if ($po['zonb'] > 0) { - $x = 1; - while ($x <= $po['zonb']) { - $tr .= '+'; - $x++; - } - } else { - $tr .= ''; - } - } - if ($tr != '') { - $is2 .= '
    :' . $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 .= '
    : ' . $po['imposed_name'] . ' '; - unset($rnc); - } - if ($tr != '') { - $is2 .= '
    :'; - $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 .= '
    :
    '; - $is2 .= '• : +' . $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 .= '
    ' . $mgi['minfo'] . '
    '; - } - } - - if (floor($pl['iznosNOW']) >= ceil($pl['iznosMAX'])) { - $d[0] = 0; - $d[2] = 0; - } - if (isset($po['complect'])) { - $is2 .= '
    :'; - } - if (isset($po['complect'])) { - // - $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'] .= '    • ' . $plc['x'] . ': '; - // - $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'] .= '    ' . $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } else { - $com1['text'] .= $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } - $com1['text'] .= '
    '; - $i2c++; - } - $i1c++; - } - unset($i1c, $i2c, $i3c); - $com1['x']++; - } - $is2 .= '
    • : ' . $com1['name'] . '
    '; - $is2 .= $com1['text']; - $is2 .= ''; - } - - if ($pl['max_text'] - $pl['use_text'] > 0) { - $is2 .= '
    : ' . ($pl['max_text'] - $pl['use_text']) . '
    '; - } - - $is2 .= ''; - - if (isset($po['gravi'])) { - $is2 .= '
    : ' . $po['gravi'] . ''; - } - - if ($pl['info'] != '') { - $is2 .= '
    :
    ' . $pl['info'] . '
    '; - } - - if ($po['info'] != '') { - $is2 .= '
    ' . $po['info'] . '
    '; - } - - if (isset($po['noremont'])) { - $is2 .= '
    '; - } - - if (isset($po['nosale'])) { - $is2 .= '
    '; - } - - if (isset($po['nomodif'])) { - $is2 .= '
    '; - } - - if (isset($po['nodelete'])) { - $is2 .= '
    '; - } - - if (isset($po['frompisher']) && $po['frompisher'] > 0) { - $is2 .= '
    '; - } - - if (isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0) { - $is2 .= '
    '; - } - - if (isset($po['fromlaba']) && $po['fromlaba'] > 0) { - $is2 .= '
    '; - } - - if (isset($po['vip_sale']) && $po['vip_sale'] > 0) { - $is2 .= '
    10%
    '; - } - - if ($pl['dn_delete'] > 0) { - $is2 .= '
    '; - } - - if ($this->pokol > $pl['geni']) { - $is2 .= '
    '; - } - - if (isset($po['zazuby']) && $po['zazuby'] > 0) { - $is2 .= '
    '; - } - - $is2 .= '
    '; - - $crd = ''; - - if ($this->info['admin'] > 0) { - $crd = '  
    '; - } - - echo '' . $is1 . ' ' . $crd . '' . $is2 . ''; - $i++; - } - - } - if ($i == 0) { - echo ' '; - } - } - - public function price($vl) - { - if ($vl == round($vl)) { - $vl = $vl . '.00'; - } - $vl = explode('.', $vl); - $vl = $vl[0] . '.' . $vl[1] . ''; - 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']); - - // - 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" '); - } - } 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" '); - } - } 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 = 0, $ruid = 0) - { - - if ($id == null) { - - if ($ruid < 1 && isset($_GET['use_rune'])) { - $ruid = $_GET['use_rune']; - echo " - - "; - } - $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('"', '"', $name)) . '%" AND `i`.`uid` = "' . mysql_real_escape_string($this->info['id']) . '"'); - } - while ($pl = mysql_fetch_array($sp)) { - $vibor .= '
    '; - if (!isset($id['id'])) { - //if($pl['type']!=4 && $pl['type']!=2 && $pl['type']!=7 ) { - $dt = $this->lookStats($pl['data']); - $id = []; - $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 ' "' . $rune['name'] . '":

    ' . $itm_inv[2] . '
    '; - 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 = [ - '' => 9, // - '' => 10, // - '' => 11, // - '' => 12, // - '' => 14, // - '' => 15, // - '' => 1, // - '' => 3, // - '' => 6, // - '' => 8 // - ]; - if ($rune['type'] == 5) { - $type_rune[''] = 5; - } - - $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 . ')'; - } 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++; - } - - $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 && $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')); - - $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- '; - } else { - if (isset($data['spell']) && $data['spell'] > 0) { - - if (isset($data['spell_st_val_hp'])) { - $data['add_hpAll'] -= $data['spell_st_val_hp']; - unset($data['spell_st_val_hp']); - } - if (isset($data['addspell_mpAll'])) { - $data['add_mpAll'] -= $data['addspell_mpAll']; - unset($data['addspell_mpAll']); - } - - - unset($data['spell']); - if (isset($data['spell_id'])) { - unset($data['spell_id']); - } - if (isset($data['spell_name'])) { - unset($data['spell_name']); - } - if (isset($data['spell_lvl'])) { - unset($data['spell_lvl']); - } - if (isset($data['spell_st_name'])) { - $data['add_' . $data['spell_st_name']] -= $data['spell_st_val']; - if ($data['add_' . $data['spell_st_name']] == 0) { - unset($data['add_' . $data['spell_st_name']]); - } - unset($data['spell_st_name']); - } - if (isset($data['spell_st_val'])) { - unset($data['spell_st_val']); - } - - } - // - - $srune = mysql_query('SELECT * FROM `new_charov` WHERE 1'); - $irun = 0; - while ($nrune = mysql_fetch_array($srune)) { - $irun++; - $ntrune[$irun] = $nrune; - } - if ($irun > 0) { - $addrune = $ntrune[rand(1, $irun)]; - $addrunes = rand($addrune['min'], $addrune['max']); - if (isset($data['add_' . $addrune['gname']])) { - $data['add_' . $addrune['gname']] += $addrunes; - } else { - $data['add_' . $addrune['gname']] = $addrunes; - } - } - $data['spell'] = $rune['id']; - if (!isset($data['sudba'])) { - $data['sudba'] = '0'; - } - $data['spell_name'] = ''; //$info - $data['spell_st_name'] = $addrune['gname']; - $data['spell_st_val'] = $addrunes; - $data['spell_id'] = $rune['item_id']; - $data['spell_lvl'] = 8; - - - // - $data = $this->impStats($data); - unset($srune, $irun, $nrune, $ntrune, $addrune, $addrunes); - $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 = ' !'; - } else { - $this->error = ' !'; - } - unset($tid); - } - //----------------------------------------------- - - } 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($data['spell_id']) && $data['spell_id'] == 6167) { - $this->error = ' ';*/ - } 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 = [ - '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'] . '" "' . $id['name'] . '"'; - } else { - $this->error = ' "' . $id['name'] . '" .,.'; - } - } 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 = [ - 'i' => 0, - 'spell' => [], - 'rune' => [], - 'atack' => [], - 'podgon' => [] - ]; - - 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]].'
    '; - 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 = 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 = [ - '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'] . '" "' . $id['name'] . '"'; - - } 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]; - } - - $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']; - } - - if ($data['add_' . $data['spell_st_name']] == 0) { - unset($data['add_' . $data['spell_st_name']]); - } - } - - $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 = ' "' . $id['name'] . '", ' . $this->is[$rnda] . ': +' . $add[$tw . 'add' . $utp[$i] . '_' . $rnda]; - - - 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 = ' "' . $id['name'] . '" ' . $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']; - - // - $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++; - } - - $data['sv_yron_min'] += $add['upatack']; - $data['sv_yron_max'] += $add['upatack']; - - $this->addDelo(2, $this->info['id'], '"System.remont.upatack": "' . $data['upatack_name'] . '" "' . $id['name'] . '" [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 = ' "' . $id['name'] . '" '; - } - } - } 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'], '"System.remont.upatack": "' . $data['upatack_name'] . '" "' . $id['name'] . '" [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0); - $this->error = ' "' . $id['name'] . '" ! :' . $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'); - - } - } elseif ($rune['type'] == 50) { - // - if ($id['item_id'] == 3196 || $id['item_id'] == 3197 || $id['item_id'] == 3198) { - - - if ($id['iznosNOW'] > 0) { - $id['iznosNOW']--; - $this->error = ' "' . $id['name'] . '" ! [' . 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 = ' "' . $id['name'] . '" ! [' . 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 = ' "' . $id['name'] . '" '; - } - - } 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 = ' "' . $idt['name'] . '" .'; - // - } - } - } 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']) && $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 = []; - $slot = []; - $j = 0; - if ($slot_new > 0) { - $itm[$j] = ['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; - } - } - 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 = [0 => 0, 1 => 0, 2 => '']; // ? - $clr = [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 = []; - // - $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 || - (!empty($po['sudba']) && $po['sudba'] != $this->info['login']) || - !in_array($pl['type'], [1, 3, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 72, 1035]) || - ($po['tr_lvl'] < 4 && $pl['item_id'] != 1035) - ) { - $see1 = 0; - } - } elseif ($type == 14) { // ( ) - if ($pl['inTransfer'] > 0 || !in_array($pl['type'], [31, 6001, 6002, 6003])) { - $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 ($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'] .= ''; - } elseif (isset($po['tr_align_bs'])) { - if ($po['tr_align_bs'] == '1') { - $pl['name'] .= ''; - } elseif ($po['tr_align_bs'] == '3') { - $pl['name'] .= ''; - } - } - if (isset($po['renameadd']) && $po['renameadd'] != '') { - $pl['name'] .= ' (: ' . $po['renameadd'] . ')'; - } - if (isset($po['icos'])) { - $pl['name'] = '' . $pl['name'] . '  ' . $po['icos'] . ' '; - } - $is2 = '' . $pl['name'] . '' . $mx . ''; - $is2 .= '  '; - if ($pl['massa'] > 0) { - $is2 .= ' (: ' . ($pl['massa'] * $col) . ')'; - } - if ($pl['gift'] != '') { - $ttl = ''; - if ($pl['gift'] == 1) { - $ttl = ' -'; - } else { - $ttl = ' ' . $pl['gift'] . '. - '; - } - $is2 .= ' '; - } - - if (isset($po['art'])) { - $is2 .= ' '; - } - - if (isset($po['sudba'])) { - if ($po['sudba'] == '0') { - $is2 .= ' '; - } elseif ($po['sudba'] == '1') { - $is2 .= ' '; - } else { - $is2 .= ' '; - } - } - if ($pl['price1'] > 0) { // - $pex = explode('.', $pl['price1']); - if ($pex[1] == '00') { - $pl['price1'] = $pex[0]; - } - if ($_GET['toRent'] == 2) { - $is2 .= '
    : ' . ($pl['price1']) . ' .'; - } else { - $is2 .= '
    : ' . ($pl['price1'] * $col) . ' .'; - } - } - if ($pl['pricerep'] > 0) { - $is2 .= ' (' . round($pl['pricerep'] * $col, 2) . ' )'; - } - if ($pl['iznosMAX'] > 0) { // - $izcol = ''; - if (floor($pl['iznosNOW']) >= (floor($pl['iznosMAX']) - ceil($pl['iznosMAX']) / 100 * 20)) { - $izcol = 'brown'; - } - if ($pl['iznosMAXi'] == 999999999) { - $is2 .= '
    : '; - } else { - $is2 .= '
    : ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . ''; - } - } - if ($po['battleUseZd'] > 0) { - $is2 .= '
    : ' . $this->timeOut($po['battleUseZd']) . ''; - } - if (isset($po['srok']) && $po['srok'] > 0) { - $pl['srok'] = $po['srok']; - } - if ($pl['srok'] > 0) { // - $is2 .= '
    : ' . $this->timeOut($pl['srok']) . ' ( ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')'; - } - if ($pl['magic_chance'] > 0) { - $is2 .= '
    : ' . 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 .= '
    : ' . $this->timeOut($efi['actionTime']); - } - } - - $notr = 0; - if (isset($po['sudba']) && $po['sudba'] != '0' && $po['sudba'] != $this->info['login']) { - $notr++; - } - // : - $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 .= ''; - $notr++; - } - } elseif ($po['tr_' . $n] > $this->stats[$n]) { - if ($n == 'align_bs' && $this->info['inTurnir'] > 0) { - if ($po['tr_align_bs'] == '1') { - $pal = !($this->info['align_real'] <= 1 || $this->info['align_real'] >= 2); - } elseif ($po['tr_align_bs'] == '3') { - $tar = !($this->info['align_real'] <= 3 || $this->info['align_real'] >= 4); - } - } - if ($n == 'rep') { - $temp = explode('::', $po['tr_' . $n]); - if ($this->rep['rep' . $temp[1]] < $temp[0]) { - $tr .= ''; - $notr++; - } - unset($temp); - } elseif ($n == 'align_bs' && $this->info['inTurnir'] > 0 && ($pal = false || $tar = false)) { - $tr .= ''; - $notr++; - } elseif ($n != 'align' && $n != 'align_bs' || floor($this->info['align']) != $po['tr_' . $n]) { - $tr .= ''; - $notr++; - } - } - $tr .= '
    '; - 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 .= '
    '; - } - } elseif ($po['tr_' . $n] > $this->stats[$n]) { - if ($n == 'align_bs' && $this->info['inTurnir'] > 0 && ($pal = false || $tar = false)) { - $tr .= '
    '; - } elseif ($n != 'align' && $n != 'align_bs' || floor($this->info['align']) != $po['tr_' . $n]) { - $tr .= '
    '; - } - } - } - $x++; - } - if ($tr != '') { - $is2 .= '
    :' . $tr; - } - // : - $tr = ''; - $t = $this->items['add']; - if (isset($po['mf_stats']) && $po['mf_stats'] > 0) { - $tr .= '
    : ' . $po['mf_stats']; - } - if (isset($po['mf_mod']) && $po['mf_mod'] > 0) { - $tr .= '
    : ' . $po['mf_mod']; - } - if (isset($po['mf_mib']) && $po['mf_mib'] > 0) { - $tr .= '
    : ' . $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 .= '
    ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n]; - if (isset($po['mf_stats']) && $po['mf_stats'] > 0 && ($n == 's1' || $n == 's2' || $n == 's3' || $n == 's5')) { - $tr .= ' '; - } - if (isset($po['mf_mod']) && $po['mf_mod'] > 0 && ($n == 'm1' || $n == 'm2' || $n == 'm4' || $n == 'm5')) { - $tr .= ' '; - } - } - $x++; - } - // () - $i = 1; - $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) { - $z = '+'; - if ($po['add_mab' . $i] < 0) { - $z = ''; - } - $tr .= '
    ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i]; - } else { - $tr .= '
    ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i]; - } - if (isset($po['mf_mib']) && $po['mf_mib'] > 0) { - $tr .= ' '; - } - } - $i++; - } - - if ($tr != '') { - $is2 .= '
    :' . $tr; - } - // : - $tr = ''; - $t = $this->items['sv']; - if (isset($po['sv_yron_min'], $po['sv_yron_max'])) { - $tr .= '
    : ' . $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 .= '
    ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n]; - } - $x++; - } - if ($pl['2too'] == 1) { - $tr .= '
    '; - } - if ($pl['2h'] == 1) { - $tr .= '
    '; - } - if (isset($po['zonb'])) { - $tr .= '
    : '; - if ($po['zonb'] > 0) { - $x = 1; - while ($x <= $po['zonb']) { - $tr .= '+'; - $x++; - } - } else { - $tr .= ''; - } - } - if ($tr != '') { - $is2 .= '
    :' . $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 .= '
    ' . $mgi['minfo'] . '
    '; - } - } - - 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 .= '
    • : ' . $po['rune_name'] . ''; - 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 = '#d99800'; - } - $po['spell_name'] = str_replace(' ', '', $po['spell_name']); - $this->is['mab1'] = ' '; - $this->is['mab2'] = ' '; - $this->is['mab3'] = ' '; - $this->is['mab4'] = ' '; - $tr .= '
    • : ' . $po['spell_name'] . ' (' . $this->is[$po['spell_st_name']] . ': +' . $po['spell_st_val'] . ')'; - 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 .= '
    : ' . $po['imposed_name'] . ' '; - unset($rnc); - } - if ($tr != '') { - $is2 .= '
    :'; - $is2 .= $tr; - } - - if (isset($po['free_stats']) && $po['free_stats'] > 0) { - $is2 .= '
    :'; - $is2 .= '
    : ' . $po['add_s1'] . '
    : ' . $po['add_s2'] . '
    : ' . $po['add_s3'] . '
    : ' . $po['add_s5'] . '
    '; - $is2 .= '• : ' . $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 .= '
    :'; - if (isset($po['sudba']) && $po['sudba'] == '0') { - $mx1 = 0; - $is2 .= '
    '; - } else { - $is2 .= '
    - : ' . (0 + $po['add_s1']) . '
    - : ' . (0 + $po['add_s2']) . '
    - : ' . (0 + $po['add_s3']) . '
    - : ' . (0 + $po['add_s4']) . '
    - : ' . (0 + $po['add_s5']) . '
    - : ' . (0 + $po['add_s6']) . '
    -
    '; - $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 .= '
    :'; - if (isset($po['sudba']) && $po['sudba'] == '0') { - $mx1 = 0; - $is2 .= '
    '; - } else { - $is2 .= '
    - : ' . (0 + $po['add_a1']) . '
    - , : ' . (0 + $po['add_a2']) . '
    - , : ' . (0 + $po['add_a3']) . '
    - , : ' . (0 + $po['add_a4']) . '
    - : ' . (0 + $po['add_a5']) . '
    - : ' . (0 + $po['add_mg1']) . '
    - : ' . (0 + $po['add_mg2']) . '
    - : ' . (0 + $po['add_mg3']) . '
    - : ' . (0 + $po['add_mg4']) . '
    - : ' . (0 + $po['add_mg5']) . '
    - : ' . (0 + $po['add_mg6']) . '
    - : ' . (0 + $po['add_mg7']) . '
    -
    '; - $is2 .= ' : ' . $mx1; - } - } - unset($mx1, $mx2, $mx3); - } - - if (isset($po['complect']) || isset($po['complect2'])) { - $is2 .= '
    :'; - } - if (isset($po['complect'])) { - // - $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'] .= '    • ' . $plc['x'] . ': '; - // - $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'] .= '    ' . $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } else { - $com1['text'] .= $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } - $com1['text'] .= '
    '; - $i2c++; - } - $i1c++; - } - unset($i1c, $i2c, $i3c); - $com1['x']++; - } - $is2 .= '
    • : ' . $com1['name'] . '
    '; - $is2 .= $com1['text']; - $is2 .= ''; - } - if (isset($po['complect2'])) { - // - $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'] .= '    • ' . $plc['x'] . ': '; - // - $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'] .= '    ' . $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } else { - $com1['text'] .= $this->is[$this->items['add'][$i1c]] . ': ' . $i3c; - } - $com1['text'] .= '
    '; - $i2c++; - } - $i1c++; - } - unset($i1c, $i2c, $i3c); - $com1['x']++; - } - $is2 .= '
    • (): ' . $com1['name'] . '
    '; - $is2 .= $com1['text']; - $is2 .= ''; - } - - 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 .= '' . date('d.m.Y H:i', $sm_pl['time']) . ' ' . $sm_pl['login'] . '. ' . $sm_pl['text'] . '
    '; - } else { - $smt .= $sm_pl['text'] . '
    '; - } - if ($ixi == 2) { - $smt .= ''; - if ($pl['max_text'] - $pl['use_text'] > 0) { - $is2 .= '
    : ' . ($pl['max_text'] - $pl['use_text']) . '
    '; - } - if ($sma > 0) { - $is2 .= '
    :
    - - - - - -
    ' . $smt . '
    -
    '; - } - unset($sm_sp, $sma, $sm_pl); - } elseif (isset($po['onitm_text'])) { - $is2 .= '
    :
    - - - - -
    ' . $po['onitm_text'] . '
    -
    '; - } - - if (isset($po['gravi'])) { - $is2 .= '
    : ' . $po['gravi'] . ''; - } - - $is2 .= ''; - - if ($pl['info'] != '') { - $is2 .= '
    :
    ' . $pl['info'] . '
    '; - } - - if (isset($po['info']) && $po['info'] != '') { - $is2 .= '
    ' . $po['info'] . '
    '; - } - - 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 .= '
    ' . $clpo['name'] . ''; - $plpo = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "' . $po['toclan1'][1] . '" LIMIT 1')); - if (isset($plpo['id'])) { - $is2 .= ' ( ' . $plpo['login'] . ')'; - 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 .= '
    ( : )'; - } - } - $is2 .= '
    '; - } - } - if (isset($po['noremont'])) { - $is2 .= '
    '; - } - if (isset($po['nosale'])) { - $is2 .= '
    '; - } - if (isset($po['nomodif'])) { - $is2 .= '
    '; - } - if (isset($po['nodelete'])) { - $is2 .= '
    '; - } - if (isset($po['frompisher'])) { - $is2 .= '
    '; - } - if (isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0) { - $is2 .= '
    '; - } - - if (isset($po['fromlaba']) && $po['fromlaba'] > 0) { - $is2 .= '
    '; - } - - 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 .= '
    ' . $this->timeOut($pl['time_create'] - time()) . '
    '; - } else { - $is2 .= '
    , VIP
    '; - if (($pl['time_create'] - time() + 86400 * 30) < 1) { - $is2 .= '
    ...
    '; - } else { - $is2 .= '
    ' . $this->timeOut($pl['time_create'] - time() + 86400 * 30) . '
    '; - } - } - } - - if ($pl['dn_delete'] > 0) { - $is2 .= '
    '; - } - - if ($this->pokol > $pl['geni']) { - $is2 .= '
    '; - } - - if (isset($po['zazuby']) && $po['zazuby'] > 0) { - $is2 .= '
    '; - } - - $is2 .= '
    '; - - if ($col > 1000) { - $is1 .= ' - - - - - - -
    x' . $col . '
    '; - - } else { - $is1 .= ''; - } - - $is1 .= '
    '; - - if ($type == 81) { - - $is1 .= ' '; - - - } 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() - { - $is1 .= ' '; - } else { - $is1 .= ':
    ' . $it['rune_name'] . '
    '; - } - unset($itemrun, $it); - } 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 .= ' ' . $prs1 . ' .
    ' . $rps1 . ' . '; - $is1 .= '
    '; - } elseif ($type == 68) { - $is1 .= '
    '; - if ($pl['lastUPD'] > 0) { - $is1 .= '

    (' . $this->timeOut(($pl['lastUPD'] + 7 * 24 * 60 * 60) - time()) . ')'; - } - $is1 .= '
    '; - } elseif ($type == 67) { - $is1 .= ' ' . (round(1 + $pl['price1'] / 100 * 7) * $col) . ' .'; - } elseif ($type == 66) { - $pos = explode('#', $po['toclan']); - $us_1 = $pos[1]; - if ($pl['uid'] < 1) { - $is1 .= ' '; - } else { - $yui = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "' . mysql_real_escape_string($pl['uid']) . '" LIMIT 1')); - $is1 .= '
    ' . $yui['login'] . '
    '; - if ($this->info['tt'][14][0] == 1 || ($this->info['id'] == $us_1)) { - $is1 .= '
    '; - } - } - } elseif ($type == 65) { - if (!isset($po['toclan'])) { - $is1 .= ''; - } else { - $is1 .= ''; - } - } 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 .= ' '; - } else { - $prcup = ''; - if ($upgitm['price1'] > 0) { - $prcup .= $upgitm['price1'] . ' .'; - } - if ($upgitm['price2'] > 0) { - if ($prcup != '') { - $prcup .= ' '; - } - $prcup .= $upgitm['price2'] . ' .'; - } - $is1 .= ' ' . $prcup . ''; - unset($prcup); - } - } elseif ($type == 63) { - $prcup = ''; - $is1 .= ''; - unset($prcup); - } elseif ($type == 64) { - $prcup = ''; - $is1 .= ' '; - 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 .= ' ' . $prpod . ' .'; - } 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 .= ' ' . $prpod . ' .'; - - } 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 .= ' '.$prpod.' .'; - - if ($this->stats['repair_z'] >= 1) { - $is1 .= ' '; - } else { - $is1 .= ' ' . $prpod . ' . - '; - } - } elseif ($type == 58) { // - if ($po['tr_lvl'] > $pl['level']) { - $pl['level'] = $po['tr_lvl']; - } - //$prpod = 50*$pl['level']+200; - $prpod = 2500; - $prpod_ekr = $pl['level'] * 0.15; - if ($this->stats['repair_r'] >= 1) { - $is1 .= ' '; - } else { - $is1 .= ' ' . $prpod . ' .
    - '; - } - } elseif ($type == 57) { - $prpod = 30; - if ($pl['type'] == 22) { - $prpod = 35; - } elseif ($pl['type'] == 18) { - $prpod = 15; - } - if (isset($po['gravi'])) { - $is1 .= ' ' . $prpod . ' .'; - } else { - $is1 .= ' ' . $prpod . ' .'; - } - } 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 .= ' ' . $prpod . ' .'; - } elseif ($type == 15) { // - $is1 .= ''; - } 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 .= ''; - } elseif ($type == 14) { - $is1 .= ''; - } elseif ($type == 12) { - $is1 .= ''; - } elseif ($type == 10) { - // ( ( )) - $is1 .= ' '; - } elseif ($type == 9) { - // ( ( )) - $is1 .= ' '; - } elseif ($type == 8) { - // ( ) - $is1 .= ' '; - } elseif ($type == 7) { - // ( ) - $is1 .= ' '; - } elseif ($type == 6) { - // - $is1 .= ''; - } elseif ($type == 5) { - // - $is1 .= '

    (: 1 .)'; - } elseif ($type == 12) { - // - $skcd = round($col * ($pl['price1'] * 0.06 - 0.01 * $this->stats['os1']), 2); - if ($skcd < 0.06) { - $skcd = 0.06; - } - $is1 .= '  ' . (1 + $skcd) . ' .'; - } elseif ($type == 13) { - // - if ($pl['1price'] > 0) { - $mess = " ? !"; - $pl['name'] = ' ' . $pl['1price'] . ' .'; - } else { - $mess = " ? "; - } - $date1 = $pl['delete'] - time(); - $is1 .= '
    -


    (' . date("j . H .", $date1) . ' )
    '; - } 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 .= ' 1 . ' . $r1 . ' .
    '; - if ($pl['iznosNOW'] >= 10) { - $is1 .= ' 10 . ' . $r2 . ' .
    '; - } - $is1 .= ' ' . $r3 . ' .
    '; - if ($c['zuby'] == true) { - if ($this->info['level'] < 8) { - $is1 .= '
    1 . ' . $this->zuby($r1) . '
    '; - if ($pl['iznosNOW'] >= 10) { - $is1 .= ' 10 . ' . $this->zuby($r2) . '
    '; - } - $is1 .= ' ' . $this->zuby($r3) . '
    '; - } - } - } elseif ($type == 3) { - $is1 .= ''; - } 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 .= ' ' . $shpCena . ' .'; - if ($pl['pricerep'] > 0) { - $is1 .= '
    ' . floor($pl['pricerep'] * $pl['kolvo'] / 2) . ' c. '; - } - } 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 .= ' ' . $shpCena . ' .'; - } 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 .= '
    '; - } else { - $is1 .= ' .'; - } - } elseif ($type == 31) { - $is1 .= '
    '; - } else { - if ($d[2] == 1) { // - $inv1 = ''; - if (isset($_GET['inv'])) { - $inv1 = 'inv=1&'; - } - if ($pl['item_id'] == 74) { - $is1 .= '-'; - } else { - $useUrl = ''; - if ($pl['magic_inc'] == '') { - $pl['magic_inc'] = $pl['magic_inci']; - } - if ($pl['magic_inc'] && $pl['type'] == 30) { - // - $pldate = '
    "' . $pl['name'] . '"
    ?
    '; - $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 = '
    "' . $pl['name'] . '"
    ?
    '; - $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\',' . (0 + $_GET['otdel']) . ');'; - } - // - } - if ($useUrl != '') { - $is1 .= '-'; - } else { - $d[2] = 0; - } - } - } - - if ($pl['max_text'] > 0 && $pl['max_text'] - $pl['use_text'] > 0) { - $is1 .= '
    '; - } - 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 .= '
    '; - } - 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 .= '-'; - } - } - - 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 .= '
    '; - } - $is1 .= ''; - } - } - if (isset($po['open']) && $d[0] == 1) { - if ($d[2] == 1) { - $is1 .= '
    '; - } - $is1 .= ''; - } - if (isset($po['close'])) { - if ($d[2] == 1) { - $is1 .= '
    '; - } - $is1 .= ' '; - } - if ($pl['group'] > 0) { - $is1 .= '
    '; - if ($this->itemsX($pl['id']) < $pl['group_max']) { - $is1 .= ''; - } - if ($this->itemsX($pl['id']) > 1) { - $is1 .= ' ' . $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 .= ' '; - - if ($d[1] == 1) { // - if (!isset($po['nodelete'])) { - $is1 .= ' '; - } - //$is1 .= ' '; - } - } - - // (: - $rt[2] .= '
    ' . $is1 . '
    ' . $is2 . '
    '; - $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 . ' ')); - 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) - { - $arr = json_decode(str_replace(['=', '|'], ['":', ',"'], '{"' . $m . '}'), true); - return $arr ?: []; - } - - 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 = []; - $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'], $po['zazuby']); - } 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, '"System.inventory": [itm:' . $it . '] .', 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, '"System.inventory": ' . $name . ' [itm:' . $it . '] .', 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 = []; - while ($i <= 10) { - $sv[$i] = ''; - $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] = ''; - } - $i++; - } - $r = '' . - '' . - '' . - '' . - '' . - '' . - '' . - '' . - '' . - '' . - '' . - '' . - '' . - '' . - '' . - '
    ' . $sv[1] . '' . $sv[2] . '' . $sv[3] . '' . $sv[4] . '' . $sv[5] . '' . $sv[6] . '' . $sv[7] . '' . $sv[8] . '' . $sv[9] . '' . $sv[10] . '' . $sv[11] . '' . $sv[12] . '
    '; - return str_replace('"', '\"', $r); - } - - public function nameItemMf($pl, $po) - { - $r = $pl['name']; - if (isset($po['icos'])) { - $r = '' . $pl['name'] . '  ' . $po['icos'] . ' '; - } - //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 .= '
    : ' . $po['rune_name'] . ''; - 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 = '#d99800'; - } - $r .= '
    ' . $po['spell_name'] . ''; - unset($rnc); - } - return $r; - } - - public function getInfoItemInfo($pl) - { - $lvar = ''; - $td = $this->lookStats($pl['data']); - - if (isset($td['sv_yron_max']) && $td['sv_yron_max'] > 0) { - $lvar .= '
    : ' . $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 .= '
    : ' . $m1l . '' . (0 + $td['add_mab1']) . ''; - } else { - $lvar .= '
    : ' . (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 .= '
    ' . $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 .= '
    ' . $this->is[$n] . ': ' . $z . '' . $td['sv_' . $n]; - } - } - $x++; - } - if ($pl['2h'] == 1) { - $lvar .= '
    '; - } - if (isset($po['zonb'])) { - $lvar .= '
    : '; - 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 .= '
    : ' . $m1l . '' . (0 + $td['add_mab2']) . ''; - } else { - $lvar .= '
    : ' . (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 .= '
    : ' . $m1l . '' . (0 + $td['add_mab3']) . ''; - } else { - $lvar .= '
    : ' . (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 .= '
    : ' . $m1l . '' . (0 + $td['add_mab4']) . ''; - } else { - $lvar .= '
    : ' . (0 + $td['add_mib4']) . '-' . (0 + $td['add_mab4']) . ''; - } - } - if ($pl['iznosMAX'] > 0) { - $lvar .= '
    : ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']); - } - - if ($po['battleUseZd'] > 0) { - $lvar .= '
    : ' . $this->timeOut($po['battleUseZd']) . ''; - } - - if (isset($td['gravi'])) { - $lvar .= '
    "' . $td['gravi'] . '"'; - } - - 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`,`u`.`vip`, - `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 = [ - 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 = [0 => '', 1 => []]; - $st = []; - $st['id'] = $u['id']; - $st['login'] = $u['login']; - $st['lvl'] = $u['level']; - - // - $witm = []; - $witm[1] = ''; - $witm[2] = ''; - $witm[3] = ''; - $witm[4] = ''; - $witm[7] = ''; - $witm[8] = ''; - $witm[9] = ''; - $witm[10] = ''; - $witm[11] = ''; - $witm[12] = ''; - $witm[13] = ''; - $witm[14] = ''; - $witm[16] = ''; - $witm[17] = ''; - //40-52 - $witm[53] = ''; - $witm[54] = ''; - $witm[55] = ''; - $witm[56] = ''; - $witm[57] = ''; - $witm[58] = ''; - $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 = [1 => false, 2 => false, 4 => false, 5 => false, 6 => false]; - $b1 = '
    '; - - 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 = $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']] = ''; - - if ($i1 == 1) { - $witm[$pl['inOdet']] = '' . $witm[$pl['inOdet']] . ''; - } 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 = '
    "' . $pl['name'] . '"
    ?
    '; - $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 = '
    "' . $pl['name'] . '"
    ?
    '; - $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');'; - } - } - $witm[$pl['inOdet']] = '' . $witm[$pl['inOdet']] . ''; - } elseif ($pl['item_id'] == 998 && !isset($_GET['inv'])) { - // - $witm[$pl['inOdet']] = '' . $witm[$pl['inOdet']] . ''; - } else { - $witm[$pl['inOdet']] = '' . $witm[$pl['inOdet']] . ''; - } - } - } - //, - $wj1i = ''; - $br = '
    '; - if ($wj[1] != false) { - if ($wj[52] != false) { - $wj1i .= $br; - } - $td = []; - $td = $this->lookStats($wj[1]['data']); - $wj[1]['name'] = $this->nameItemMf($wj[1], $td); - $wj1i .= '' . $wj[1]['name'] . ''; - $wj1i .= $this->getInfoItemInfo($wj[1]); - - } - if (isset($wj[52]) && $wj[52] != false) { - $td = $this->lookStats($wj[52]['data']); - $wj[52]['name'] = $this->nameItemMf($wj[52], $td); - - - $wj1i = '' . $wj[52]['name'] . '' . $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 = []; - $td = $this->lookStats($wj[6]['data']); - $wj[6]['name'] = $this->nameItemMf($wj[6], $td); - $wj4i .= '' . $wj[6]['name'] . ''; - - $wj4i .= $this->getInfoItemInfo($wj[6]); - if ($wj[5] != false || $wj[4] != false) { - $wj4i .= $br; - } - } - if ($wj[5] != false) { - $td = []; - $td = $this->lookStats($wj[5]['data']); - $wj[5]['name'] = $this->nameItemMf($wj[5], $td); - $wj4i .= '' . $wj[5]['name'] . ''; - - $wj4i .= $this->getInfoItemInfo($wj[5]); - if ($wj[4] != false) { - $wj4i .= $br; - } - } - if ($wj[4] != false) { - $td = []; - $td = $this->lookStats($wj[4]['data']); - $wj[4]['name'] = $this->nameItemMf($wj[4], $td); - $wj4i .= '' . $wj[4]['name'] . ''; - - $wj4i .= $this->getInfoItemInfo($wj[4]); - } - - 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']; - } - } 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']; - } - } - 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] = ''; - if ($i1 == 1) { - $witm[1] = '' . $witm[1] . ''; - } else { - $witm[1] = '' . $witm[1] . ''; - } - } - 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] = ''; - if ($i1 == 1) { - if ($wj4idd > 0) { - $wj[4]['item_id'] = $wj4idd; - } - $witm[4] = '' . $witm[4] . ''; - } else { - $witm[4] = '' . $witm[4] . ''; - } - } - /*------------ . ---------------*/ - $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 = [ - 1 => 'cat', - 2 => 'owl', - 3 => 'wisp', - 4 => 'demon', - 5 => 'dog', - 6 => 'pig', - 7 => 'dragon' - ]; - $anan2 = [ - 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'])) { - $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 = ''; - } else { - $anml = ''; - } - } - } - unset($anan); - - if (@isset($sn['items_img'][2])) { - $msl = ''; - } else { - if ($anml == '') { - $msl = ''; - } else { - $msl = $anml; - } - } - unset($nmmsgl1); - $jf = ''; - $oi = ''; - if ($i1 != 1) { - $jf = 'main'; - $oi = 'onMouseOver="top.hi(this,\'' . $u['login'] . ' ( "")\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"'; - $msl = ' - - - - - - - - - - -
    ' . $witm[53] . '' . $witm[55] . '' . $witm[54] . '
    ' . $witm[56] . '' . $witm[57] . '' . $witm[58] . '
    '; - } - $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 = '' . $e['name'] . ''; - 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 .= '
    '; - - 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 .= '
    ' . $this->is[$n] . ': ' . $z . '' . $ed['add_' . $n]; - } - $x++; - } - if ($tr != '') { - $ei .= $tr; - } - if ($e['info'] != '') { - $ei .= '
    :
    ' . $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 .= ''; - } 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 ($type_info == 1) { - $hptop = 0; - $lh = [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 = [0 => 'hp_none', 1 => 1]; - $lm[1] = floor($sn['mpNow'] / $sn['mpAll'] * 120); - if ($lm[1] > 0) { - $lm[0] = 'hp_mp'; - } - $hpmp .= '
    ' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '
    -
    -
    -
    '; - } else { - $hptop = 5; - } - $hpmp = '
    ' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '
    -
    -
    -
    ' . $hpmp; - // - $hpmp = '
    ' . $hpmp . '
    '; - } elseif ($type_info == 2) { - $hptop = 0; - $lh = [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 = [0 => 'hp_none', 1 => 1]; - $lm[1] = floor($sn['mpNow'] / $sn['mpAll'] * 200); - if ($lm[1] > 0) { - $lm[0] = 'hp_mp'; - } - $hpmp .= '
    ' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '
    -
    -
    -
    '; - } else { - $hptop = 5; - } - $hpmp = '
    ' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '
    -
    -
    -
    ' . $hpmp; - // - $hpmp = '
    ' . $hpmp . '
    '; - } - - $lgn = '' . $u['login'] . ' [' . $u['level'] . ']'; - 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 = '' . $lgn; - } - if ($u['align2'] > 0) { - $lgn = '' . $lgn; - } - if ($u['align'] > 0) { - $lgn = '' . $lgn; - } - $pb = ''; - if ($u['banned'] > 0) { - $pb .= '
    '; - } - if ($u['allLock'] > time()) { - $pb .= '
    !
    '; - } - - $swm = 0; // - $l = 40; - while ($l <= 52) { - if (isset($witm[$l])) { - $swm++; - } else { - $witm[$l] = ''; - } - $l++; - } - - $ssm = 0; // - $l = 59; - while ($l <= 62) { - if (isset($witm[$l])) { - $ssm++; - } else { - $witm[$l] = ''; - } - $l++; - } - - $witmg = ''; - - if ($ssm > 0 && $i1 == 0) { - $witmg .= ' - - - - - - -
    ' . $witm[59] . '' . $witm[60] . '' . $witm[61] . '' . $witm[62] . '
    '; - } - - if ($swm > 0 && $i1 == 0) { - $witmg .= ' - - - - - - - - - - - - - - - - - -
    ' . $witm[40] . '' . $witm[41] . '' . $witm[42] . '' . $witm[43] . '' . $witm[44] . '' . $witm[50] . '
    ' . $witm[45] . '' . $witm[46] . '' . $witm[47] . '' . $witm[48] . '' . $witm[49] . '' . $witm[51] . '
    '; - } - $zag = ''; - if ($u['zag'] != '' && $i1 == 1) { - $rt[0] .= ''; - - $zag = ''; - - $j2 = 0; - while ($j2 <= 17) { - $witm[$j2] = '
    ' . $witm[$j2] . '
    '; - $j2++; - } - - } - //
    - if ($type_info == 1) { - if ($pb != '') { - $pb = '
    ' . $pb . '
    '; - } - $rt[0] .= '
    ' . $lgn . '
    ' . $pb . ' -
    - - - - - - -
    - - - - - - - - - - - - - - - - -
    ' . $zag . '' . $witm[1] . '
    ' . $witm[2] . '
    ' . $witm[3] . '
    ' . $witm[4] . '
    ' . $witm[7] . '
    -
    - - - - - - - - - - -
    - - ' . $hpmp . ' - -
    '; - if ($zag == '') { - if ($i1 == 0) { - if (!isset($_GET['inv'])) { - $invg = [0 => 'main.php?inv=1', 1 => '']; - } else { - $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 => ' ']; - } - $uobr = 'i/obraz/' . $u['sex'] . '/' . $u['obraz'] . ''; - if (isset($sn['items_img'][1])) { - $uobr = 'rimg/r' . $sn['items_img'][1]; - } - $rt[0] .= '
    - -
    -
    ' . $eff . '
    ' . $anml . ' -
    '; - } else { - if ($i1 == 0) { - if (!isset($_GET['inv'])) { - $invg = [0 => 'main.php?inv=1', 1 => '']; - } else { - $invg = [0 => 'main.php?skills=1', 1 => '']; - } - } else { - $invg = [0 => 'https://lib.new-combats.com/obraz.php?namez=' . $u['zag'] . '" target="_blank', 1 => ' ']; - } - $rt[0] .= '
    - -
    -
    ' . $eff . '
    ' . $anml . ' -
    '; - } - - unset($invg); - - $rt[0] .= '
    ' . $msl . '
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    ' . $witm[8] . '
    ' . $witm[9] . '
    - - - - - -
    ' . $witm[10] . '' . $witm[11] . '' . $witm[12] . '
    ' . $witm[13] . '
    ' . $witm[14] . '
    ' . $witm[16] . '
    ' . $witm[17] . '
    -
    ' . $witmg . '
    '; - } elseif ($type_info == 2) { - $rt[0] .= '
    ' . $lgn . '
    -
    -
    ' . $pb . '
    -
    - - ' . $hpmp . ' - -
    - - - - - - -
    - - - - - - - - - - - - - - - - -
    ' . $zag . '' . $witm[8] . '
    ' . $witm[9] . '
    ' . $witm[3] . '
    ' . $witm[4] . '
    - - - - - -
    ' . $witm[10] . '' . $witm[11] . '' . $witm[12] . '
    -
    - - - - -
    '; - if ($zag == '') { - if ($i1 == 0) { - if (!isset($_GET['inv'])) { - $invg = [0 => 'main.php?inv=1', 1 => '']; - } else { - $invg = [0 => 'main.php?skills=1', 1 => '']; - } - } else { - $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'] . ''; - if (isset($sn['items_img'][1])) { - $uobr = 'rimg/r' . $sn['items_img'][1]; - } - $rt[0] .= '
    - -
    -
    ' . $eff . '
    ' . $anml . ' -
    '; - } - - unset($invg); - - $rt[0] .= '
    -
    - - - - - - - - - - - - - -
    ' . $witm[1] . '
    ' . $witm[13] . '
    ' . $witm[14] . '
    ' . $witm[17] . '
    -
    ' . $witmg . '
    '; - } - - if ($i1 == 0 && $u['battle'] == 0) { - $rt[0] .= ''; - } - 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 "cgi-bin/magic.pl?use_' . $po['finish_file'] . '".'; - } - } - if (isset($u['id']) && ($e['type1'] < 11 || ($e['type1'] > 16 && $e['type1'] < 23)) && $e['noch'] == 0) { - $text = ' "' . $e['name'] . '"'; - 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; - if (array_keys($m)) { - $k = array_keys($m); - } else { - $k = 0; - } - $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); - } - } - - - $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 = ' "' . $itm['name'] . '":
    ' . $io . '...'; - } else { - unset($no_open_itm); - } - } else { - $this->error = ' "' . $itm['name'] . '" ...'; - } - } 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 = ' "' . $a['name'] . '" ...'; - 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 = ' "' . $itm['name'] . '", :
    ' . $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 = ' "' . $itm['name'] . '", :
    ' . $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 = []; - 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 = 0, $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, '"System.inventory": "' . $itm['name'] . ' (x' . $col . ')" [itm:' . $itm['id'] . '=' . time() . '] .', time(), $this->info['city'], 'System.inventory', 0, 0); - } else { - $this->error = ' "' . $itm['name'] . '" '; - $this->addDelo(1, $uid, '"System.inventory": "' . $itm['name'] . '" [itm:' . $itm['id'] . '] .', 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 = null, $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`,`u`.`vip`, - `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`,`u`.`vip`, - `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 (isset($u['id'], $u['stats']) && !isset($cache)) { - $st = []; - $s_vi = []; - $s_v = []; - $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)) { - - $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 = []; - $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'] = []; - $st['effects'] = []; - $st['reting'] = 0; - $st['irka'] = 0; - $st['vip'] = $u['vip']; - $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 = []; - $coms = []; // - $dom = []; - $btl_cof = 0; - $oza = [ - 1 => [0, 0], - 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; - $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']; - } - } - - - $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 = []; - 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']; - } - } - } - } - - if ($pl['inOdet'] <= 18 && $pl['inOdet'] > 0) { - - $st['reting'] += 1; - } - - $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'] = []; - } - $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'] = []; - } - $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 = [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( $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 = []; - $prsu = []; - 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'); - } - } - } - } - } - 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 (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'] = []; - $st['set_pog2'] = []; - 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; - } - } - } - - // - - if (!isset($st['hpAll'])) { - $st['hpAll'] = 0; - } - $st['hpAll'] += $st['s4'] * 5; - - 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.0; - - if (!isset($st['zm'])) { - $st['zm'] = 0; - } - $st['zm'] += $st['s4'] * 1.0; - - if (!isset($st['zaproc'])) { // 'zaproc'=>' (%)','zmproc'=>' (%) - $st['zaproc'] = 0; - } - $st['zaproc'] += round($st['s5'] * 0); - - if (!isset($st['m19'])) { - $st['m19'] = 0; - } - $st['m19'] += round($st['s3'] * 0.03); - - // - // " . ". - if (!isset($st['antm3'])) { - $st['antm3'] = 0; - } - $st['antm3'] += $st['s2'] * 0.5; - - - 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['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['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['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'] += 1; - } - if ($st['s2'] > 149 && $st['s2'] < 175) { - $st['pa1'] += 20; - $st['m2'] += 110; - $st['m4'] += 115; - $st['m15'] += 2; - } - if ($st['s2'] > 174 && $st['s2'] < 200) { - $st['pa1'] += 23; - $st['m2'] += 145; - $st['m4'] += 145; - $st['m15'] += 3; - } - if ($st['s2'] > 199) { - $st['pa1'] += 30; - $st['m2'] += 165; - $st['m4'] += 165; - $st['m15'] += 5; - } - - // - - 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'] += 1; - } - if ($st['s3'] > 149 && $st['s3'] < 175) { - $st['pa4'] += 20; - $st['m3'] += 30; - $st['m1'] += 145; - $st['m5'] += 50; - $st['m14'] += 2; - } - if ($st['s3'] > 174 && $st['s3'] < 200) { - $st['pa4'] += 23; - $st['m3'] += 35; - $st['m1'] += 165; - $st['m5'] += 55; - $st['m14'] += 3; - } - if ($st['s3'] > 199) { - $st['pa4'] += 30; - $st['m3'] += 40; - $st['m1'] += 185; - $st['m5'] += 65; - $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; - } - if ($st['s4'] > 74 && $st['s4'] < 100) { - $st['hpAll'] += 175; - $st['m19'] += 2; - } - if ($st['s4'] > 99 && $st['s4'] < 125) { - $st['hpAll'] += 250; - $st['m19'] += 4; - } - 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'] += 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['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']++; - } - - /* */ - $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 ($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'] = 1 + ceil($st['reting']); - $st['reting'] = 1 + $st['irka']; - - if ($st['vip'] > 0) { //$u - $st['antm3'] += 20; - $st['zaproc'] += 5; - $st['zmproc'] += 5; - $st['m10'] += 20; - $st['pzm'] += 5; - } - - // - $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`+`repdevilscity`) as allrep, - (`nu_capitalcity`+`nu_demonscity`+`nu_angelscity`+`nu_suncity`+`nu_dreamscity`+`nu_abandonedplain`+`nu_sandcity`+`nu_emeraldscity`+`nu_devilscity`) as allnurep FROM `rep` WHERE `id` = "' . $u['id'] . '" LIMIT 1')); - - if ($u['referals'] >= 3000) { - $st['speedhp'] += 50; - $st['speedmp'] += 50; - $st['antm3'] += 25; - $st['m10'] += 15; - $st['m11'] += 15; - $st['speed_dungeon'] += 25; - $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) { - $st['speed_dungeon'] += 25; - } - - if ($u['admin'] > 0) { - $st['speed_dungeon'] += 1000; - $st['speedhp'] += 1000000000000000; - } - - if (date('H') >= 22 && date('H') <= 10) { - $st['exp'] += 25; - } - - // - $st['reting'] = floor($st['reting']); - - 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 = []; - 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 = [ - '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 = [$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['expstopu'] > 2 && $this->info['exp'] > $c['expstopu']) { - $this->info['exp'] = $c['expstopu']; - mysql_query('UPDATE `stats` SET `exp` = "' . $c['expstopu'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - } elseif ($this->info['exp'] > $c['expstop'] && $this->info['expstopu'] < 3) { - //upexpdate - if ($this->info['upexpdate'] == 0) { - $this->info['upexpdate'] = time(); - mysql_query('UPDATE `stats` SET `upexpdate` = "' . time() . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - } elseif (time() >= ($this->info['upexpdate'] + 400 * 60 * 60 * 24)) //4*60*60*24 - { - $this->info['upexpdate'] = time(); - $this->info['expstopu'] = $this->info['expstopu'] + 1; - mysql_query('UPDATE `stats` SET `upexpdate` = "' . time() . '",`expstopu` = `expstopu`+1 WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - } - if ($this->info['expstopu'] < 3) { - $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 = []; - $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 ''; - } else { - - mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); - $text = ' " [6]" .'; - echo ''; - //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']) { - - // - $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'], ' ' . $this->info['login'] . ' ' . $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'], ' ' . $this->info['login'] . ' (2- "' . $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'); - // - 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'], ' ' . $this->info['login'] . ' (3- "' . $llogin2 . '" ( ' . $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'], ' ' . $this->info['login'] . ' ' . $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'], ' ' . $this->info['login'] . ' ' . $sex1 . ' ' . $lvl['nextLevel'] . '! ( , IP! 1 !)', -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) { - $this->info['money'] = $lvl['money'] + $this->info['money']; - $this->info['money2'] = $lvl['money2'] + $this->info['money2']; - //} - } - $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); - } - - // - $this->send('', $this->info['room'], $this->info['city'], '', '', '' . $this->info['login'] . ' ' . $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'] = 0; - } else { - $this->info['stopexp'] = 0; - } - $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 = [ - 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 = [ - 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'], '' . $a['name'] . ' ' . $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; - } - - /** - * ! hp mp 1000 , - * - . 12.07.2022 . - * @param $uid - * @param $st - * @param $i1 - * @return array|int[] - */ - public function regen($uid, $st, $i1) - { - if ($uid != $this->info['id']) { - $where = is_numeric($uid)? "`u`.`id` = $uid" : "`u`.`login` = $uid"; - $u = mysql_fetch_array(mysql_query('SELECT `u`.`battle`, `st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE ' . $where)); - if (!isset($st['hpAll'])) { - $st = $this->getStats($uid, $i1); - } - } else { - $u = $this->info; - $st = isset($this->stats['hpAll']) ? $this->stats : $this->getStats($uid, $i1); - } - - if (!empty($u['battle'])) { - return [0, 0]; - } - - $sth = $u['minHP']; // HP - $stm = $u['minMP']; // MP - $st['speedhp'] = $st['speedhp'] ?: 0; - $st['speedmp'] = $st['speedmp'] ?: 0; - #$sh = 0; // 1 . - #$sm = 0; // M 1 . - - // - // - # , ? - $st['speedhp'] += 150; - $st['speedmp'] += 150; - - //hp - $sh = ($st['hpAll'] / (60 * $sth)); - $sh += ($sh / 100) * (1 + $st['speedhp'] + $st['levels']['hpRegen']); - $st['hpNow'] += $sh * (time() - $u['regHP']); - $st['hpNow'] = $st['hpNow'] > 0 ? min($st['hpNow'], $st['hpAll']) : 0; - - // . ? - //$sh = $st['hpAll'] * (101 + $st['speedhp'] + $st['levels']['hpRegen']) / (6000 * $u['minHP']) - - //mp - $sm = ($st['mpAll'] / (60 * $stm)); - $sm += ($sm / 100) * (1 + $st['speedmp'] + $st['levels']['mpRegen']); - $st['mpNow'] += $sm * (time() - $u['regMP']); - $st['mpNow'] = $st['mpNow'] > 0 ? min($st['mpNow'], $st['mpAll']) : 0; - - - // - - if ($u['hpNow'] < $st['hpAll'] || $u['mpNow'] < $st['mpAll']) { - Db::sql('update stats set - regHP = unix_timestamp(), - regMP = unix_timestamp(), - hpNow = ?, - mpNow = ? - where id = ?', [$st['hpNow'], $st['mpNow'], $u['id']]); - } - - 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 [$sh, $sm, 'hpNow' => $st['hpNow'], 'mpNow' => $st['mpNow']]; - } - - 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 = '
    '; - } elseif (isset($po['toclan']) && $po['toclan1'] != $user['clan']) { - $r = ' ...
    '; - } elseif ($user['inTurnir'] > 0 || $user['inTurnirnew'] > 0) { - $r = ' .
    '; - } 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 = ' "' . $item_['name'] . '"
    '; - $col = $this->itemsX(((int)$id)); - $this->addDelo(2, $user['id'], '"System.transfer.MONEY": "' . $item_['name'] . '" (#id : "' . $id . '") (x' . $col . ') "' . $res['name'] . '" (' . $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 = ' ...
    '; - } - } 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 = ' "' . $item_['name'] . '"
    '; - } else { - $r = ' ...
    '; - } - } - } - } else { - $r = ' .
    '; - } - 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 = ' ,
    '; - } elseif (isset($itm_['id'])) { - if ($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) { - if ($itm_['inOdet'] != 0) { - $o = ', `inOdet` = 0'; - } else { - $o = ''; - } - $r = ' "' . $itm_['name'] . '"
    '; - $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 = ' .
    '; - } - } else { - $r = ' .
    '; - } - 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 = ' "' . $itm_['name'] . '"
    '; - } else { - $r = ' .
    '; - } - } else { - $r = ' .
    ' . $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 roomInfo($id, $short = false) - { - $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']); - 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(); diff --git a/_incl_data/class/__zv.php b/_incl_data/class/__zv.php deleted file mode 100644 index ca34e581..00000000 --- a/_incl_data/class/__zv.php +++ /dev/null @@ -1,3274 +0,0 @@ - $a); - } - } - - $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]; - } - - 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 = [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; -} - -$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 = ': 5 . '; - 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 = ': 10 . '; - 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 = ': 15 . '; - 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`, - `s`.`stats`, - `u`.`cityreg`, - `u`.`sex`, - `u`.`obraz`, - `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 = []; - 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 .= ' - -
      ' . $u->microLogin($u->info['id'], 1) . '   -
    ' . floor($u->stats['hpNow']) . '/' . $u->stats['hpAll'] . '
    -
    -
    -
    -'; - - if ($u->stats['mpAll'] > 0) { - $r .= '
    ' . floor($u->stats['mpNow']) . '/' . $u->stats['mpAll'] . '
    -
    -
    -
    '; - } - $r .= '
    '; - 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('"', '"', $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 = '- ...
    '; - } - } 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('"', '"', $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 .= ' -
    '; - $gad = 0; - } - - $nz['tm2max'] = (int)$_POST['nlogin2']; - if ($nz['tm2max'] < 1 || $nz['tm2max'] > 99) { - $this->error .= ' -
    '; - $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
    '; - $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 = '- ...
    '; - $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 = '- ...
    '; - $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 = '- ...
    '; - } - } - - $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; - } - } - } - } - } - } - - // - public function addBot() - { - global $u, $c, $code; - - 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 ...
    , - ...
    '; - } 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 '
    Cannot start battle (no prototype "ND0Clone")
    '; - } 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'] . '", - "' . $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(''); - } 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 '
    Cannot start battle (no prototype "ND0Clone")
    '; - } 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(''); - } 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 = ['', ' ', ' ', ' ', ' ', ' ', ' ']; - } - - $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(''); - } else { - $this->error = 'Cannot start battle (no prototype "ABD0' . $id['id'] . '")'; - } - } else { - echo '
    Cannot start battle (no prototype "ND0IZ' . $lvl . '")
    '; - } - } - - 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, - - `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;"); - $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) { - - // , - 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')"); - - } - } 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(''); - } 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 '


    '; - $this->zv_see = 0; - } elseif ($r == 1 && $u->info['level'] > 0) { - echo '


    ;)
    '; - $this->zv_see = 0; - } elseif ($r > 1 && $r < 6 && $u->info['level'] < 1) { - echo '


    ;)
    '; - $this->zv_see = 0; - } elseif ($r > 3 && $r < 6 && $u->info['level'] < 2) { - echo '


    ' . $this->z1n[$r] . ' .
    '; - $this->zv_see = 0; - } elseif ($r == 1 && $u->info['level'] > 0) { - echo '


    ;)
    '; - $this->zv_see = 0; - } elseif ($r == 8 && $u->info['level'] < 1) { - echo '


    .
    '; - $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 = '
      '; - 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("
    • %d .
      : %s
      : %s
    • ", - $tournament['tid'], $time, implode(', ', $members)); - } - $tournaments .= '
    '; - ?> -
    - ! -
      -
    • , - !
    • - info['id'])): ?> -
    • , info['level']) ?> .
    • - - info['exp'] < \Insallah\Tournament::MIN_EXP): ?> -
    • .
    • - -
    • , .
    • -
    • 1, 2 3 25, 15, 5 , 12 , 6 3 !
    • -
    -
    - -
    - .
    - -
    - - info['id']) || !\Insallah\TournamentModel::isStarted($u->info['level'])): ?> -
    - - -
    - - . - - -
    - ! -
    - info['zv'] > 0 && $u->info['battle'] == 0 && $r != 8) { - if ($zi['razdel'] == 1 || $zi['razdel'] == 2 || $zi['razdel'] == 3) { - 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 '
    '; - } else { - // - - $sa = ''; - if ($uz['sex'] == 2) { - $sa = ''; - } - echo ' ' . $sa . ' ' . $ca . ' ' . $u->microLogin($uz['id'], 1) . ' ? '; - } - } 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) . ' '; - } - } - echo '
    '; - } else { - $tm_start = floor(($zi['time'] + $zi['time_start'] - time()) / 6) / 10; - $tm_start = $this->rzv($tm_start); - echo ' ' . $this->z2n[$zi['razdel']] . ' '; - echo '
    ' . $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 = ' [' . $pl['users_in'] . ']:
    '; - $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 .= '
    ' . $i . '. ' . $u->microLogin($plu, 2) . '
    '; - $i++; - } - echo ' - -
    - - - - - - -
    - ' . $this->error . ' -
    - ' . $u->timeOut($pl['time'] - time()) . ' -
    -
    - ' . $dv . ' -
    -
     
    -
    '; - } - } else { - $tlvl = 4; - $i = 4; - $trnmz = [4 => '', 5 => '', 6 => '.\.']; - while ($i <= 6) { - if ($_GET['tlvl'] == $i) { - $trse .= ''; - $tlvl = $i; - } else { - $trse .= ''; - } - $i++; - } - $prb = ''; - echo ''; - $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 .= ''; - } - if ($dv == '') { - $dv = ' ...'; - } - echo ' - -
    - - - - - - -
    - ' . $this->error . ' -
    - : - - ' . $prb . ' -
    -
    - ' . $dv . ' -
    - ' . $prb . ' -
    -
    '; - } - } 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 = ' ' . ($c['bot_level'] + 1) . '- . '; - } else { - if ($u->info['level'] < 9) { - $tstw = ' 8 '; - } else { - $tstw = ''; - } - $dv .= '
    -
    -
    - ' . $tstw . ' - -
    -
    -
    '; - } - 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'); - die(''); - } - } - } - - $dv .= '
    '; - - $dv .= '
    :
    '; - } - - echo ' -
    - - - - - - -
    - - - - -
    - ' . $dv . ' -
    -
    '; - } - } elseif ($r == 4) { - if ($u->room['zvsee'] == 0) { // ?> - - - room['zvsee'] == 0) { - echo '
    -
    - - -
    '; - } - } - } 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 .= ' '; - } - $i++; - } - if ($tm != '') { - $html .= ($p + $x) . '. ' . date('d.m.y H:i', $pl['time_start']) . ' ' . $tm . '
    '; - } - $x++; - } - ?> - - - - - -

    - ( )

    - ...'; - } else { - echo '
    ' . $html . '
    '; - } ?> - - - - - -
    0 && $xx > 15) { ?> -   - 0) { ?> -   -
    - 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 = ' - - - - -
     

    ' . date('d.m.Y', $dt) . '

     
    -
    - : -
    -
    '; - $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 .= ''; - } - $tm2 .= '' . $tms[$g][$h]['login'] . ' [' . $tms[$g][$h]['lvl'] . '], '; - } - $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 .= ' '; - } - $tm .= $tm2; - if ($k + 1 < count($ts) && $tm2 != '' && $ts[$k + 1] > 0) { - $tm .= ' '; - } - $k++; - } - } - if (!isset($btl_lst[$b['id']])) { - $btl_lst[$b['id']] = true; - if ($tm == '') { - $tm = ' '; - } - $jk++; - $btl .= $jk . '. ' . date('d.m.y H:i', $pl['time']) . ' ' . $tm . '
    '; - } - $j++; - } - } - if ($btl == '') { - $see .= '


    , , ...




    '; - } else { - $see .= $btl; - } - echo $see; - } else { - if ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id'])) { - echo '

    '; - } - } - } else { - if ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id'])) { - echo '

    '; - } - } - } - - 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 = ' (' . $w . ')'; - } - 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 = ' '; - } - $n1tv = ''; - $unvs = ''; - if ($pl['invise'] == 1) { - // - $tm = ''; - $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 = '' . $u->microLogin($pl['creator'], 1) . '' . $usrszv . ' - ' . $tm; - - $unvs = ' : ' . (1 + $unvs) . ' . '; - $n1tv = ' '; - } - if ($pl['kingfight'] == 1) { - $n1tv .= ' '; - } - if ($pl['travmaChance'] == 100) { - $n1tv .= ''; - } - if ($pl['noatack'] == 1) { - $n1tv .= ' '; - } - if ($pl['nobot'] == 1) { - $n1tv .= ' '; - } - if ($pl['fastfight'] == 1) { - $n1tv .= ' '; - } - if ($pl['noeff'] == 1) { - $n1tv .= ' '; - } - if ($pl['arand'] == 1) { - $n1tv .= ' '; - } - if ($pl['noart'] == 1) { - $n1tv .= ' '; - } - if ($pl['otmorozok'] == 1) { - $n1tv .= ' '; - } - if ($pl['comment'] != '') { - $dl = ''; - if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { - $dl .= ' ( )'; - 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 = ' '; - } - if ($pl['dcom'] > 0) { - if ($moder['boi'] == 1 || $u->info['admin'] > 0) { - $pl['comment'] = '[ : ' . $pl['comment'] . '] '; - } 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 = ' ( ' . $imn . ')'; - } - if ($r == 5 && ($pl['creator'] == $u->info['id']) && $cols < 2 && $pl['priz'] == 0) { - $del_q = '  '; - } 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 . '' . date('H:i', $pl['time']) . ' (' . $lvldt . ') : ' . $n1tv . ' ( ' . ($pl['timeout'] / 60) . ' .) ' . $zv_comm . ' (' . $unvs . ' ' . $tmStart . ' .) ' . $mon . ' : ' . $tm . ' ' . $del_q . '
    '; - } 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 = ' '; - } else { - $tm1 = rtrim($tm1, ', '); - } - - if ($tm2 == '') { - $tm2 = ' '; - } else { - $tm2 = rtrim($tm2, ', '); - } - // - if ($pl['teams'] == 3) { - if ($tm3 == '') { - $tm2 = ' '; - } 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 = ' ' . $ttl1 . ': ' . $tm1; - $tm2 = ' ' . $ttl2 . ': ' . $tm2; - $tm3 = ' ' . $ttl3 . ': ' . $tm3; - - } - // - $rad = ''; - if (!isset($zi['id']) && $u->room['zvsee'] == 0) { - $rad = ' '; - } - if ($pl['comment'] != '') { - $dl = ''; - if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) { - $dl .= ' ( )'; - 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 = ' '; - } - if ($pl['dcom'] > 0) { - if ($moder['boi'] == 1 || $u->info['admin'] > 0) { - $pl['comment'] = '[ : ' . $pl['comment'] . '] '; - } else { - $pl['comment'] = ''; - } - } - $zv_comm = '' . $pl['comment'] . '' . $dl . ''; - } else { - $zv_comm = ''; - } - if ($pl['teams'] == 3) { - $zv_comm .= ' ( )'; - } - - $zvb .= $rad . '' . date('H:i', $pl['time']) . ' '; - $zvb .= '(' . (0 + $tmc[1]) . '/' . $pl['tm1max'] . ')'; - $zvb .= ' ' . $tm1; - $zvb .= ' ('; - 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 .= ' .)'; - $zvb .= ' '; - $zvb .= '(' . (0 + $tmc[2]) . '/' . $pl['tm2max'] . ')'; - $zvb .= ' ' . $tm2; - $zvb .= ' ('; - 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 .= ' .)'; - $zvb .= ' : (: ' . ($pl['timeout'] / 60) . ' .) '; - $zvb .= ' ' . $zv_comm . ' '; - $zvb .= ' ( ' . $tmStart . ') ' . $mon . '
    '; - } 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 .= ''; - } - $dp1 = ''; - if ($pl['money'] > 0) { - $dp1 = ' , : ' . $u->round2($pl['money']) . ' .'; - } - if ($u->room['zvsee'] == 0) { - $zvb .= ''; - } - $mbcom = ''; - if ($pl['comment'] != '') { - $mbcom = ' ' . $pl['comment'] . ''; - } - $zvb .= '' . date('H:i', $pl['time']) . ' ' . $u->microLogin($uz['id'], 1) . ' ' . $enm . ' : ( ' . round($pl['timeout'] / 60) . ' .' . $dp1 . ' ' . $mon . ')' . $mbcom . '
    '; - if ($uz['banned'] > 0) { - $zvb .= '
    '; - } - } - } - } - $i++; - } - if ($i == 0) { - // - if ($u->room['zvsee'] > 0) { - echo '


    '; - } - } else { - if (!isset($zi['id']) && $u->room['zvsee'] == 0) { - if ($_GET['r'] == 5) { - if (!$u->info['no_zv_key']) { - echo '

    - : -
    ' . $zvb . ' : - -
    '; - } else { - echo '

    -
    ' . $zvb . ' -
    '; - } - } else { - if ($zvb != '' && $u->info['level'] > $c['bot_level']) { - echo '


    ' . $zvb . '
    '; - } else { - echo '
    ' . $zvb . '
    '; - } - } - } 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 = ''; - } - } - if ($uz1['align'] != 0) { - $ca = '' . $ca; - } - $this->error = ' ' . $ca . ' ' . $uz1['login'] . ' [' . $uz1['level'] . ']'; - $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'] . '", - "1", - "' . $u->info['login'] . '", - "0", - "' . $u->info['pass'] . '", - "' . mysql_real_escape_string(IP) . '", - "' . mysql_real_escape_string(IP) . '", - "capitalcity", - "capitalcity", - "422", - "' . time() . '", - "0", - "haot@new-combats.com", - "01.01.1980", - "' . $u->info['sex'] . '", - "0", - "0", - "1", - "' . 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'); - - $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 ''; - } - - 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(); // \ No newline at end of file diff --git a/_incl_data/class/_cron_.php b/_incl_data/class/_cron_.php deleted file mode 100644 index f8915537..00000000 --- a/_incl_data/class/_cron_.php +++ /dev/null @@ -1,2536 +0,0 @@ -users[]['eff'] , 1 -*/ - -class priems -{ - private $btl; - private $u; - const FIRE = 'fire'; - const WATER = 'water'; - const AIR = 'air'; - const EARTH = 'earth'; - private $mname = [ - '' => 1, - '' => 2, - '' => 3, - '' => 4, - '' => 5, - '' => 6, - '' => 7 - ]; - public $ue = []; - private $logColor = [ - 'crit' => '#f00', - 'miss' => '#888', - self::FIRE => '#a00', - self::WATER => '#00a', - self::EARTH => '#0a0', - self::AIR => '#0af', - ]; - - public function __construct() - { - global $btl; - $this->btl = $btl; - $this->u = user::start(); - } - - /** - * @param int $uid 0, id . - * @return void - */ - public function addAirStaticPoints($uid = 0) - { - if ($uid == 0) { - $uid = $this->ue['id']; - } - $x = Db::getValue('select x from eff_users where uid = ? and `delete` = 0 and v2 = 260 and user_use = ? order by id desc limit 1', - [$uid, $this->u->info['id']]); - if (empty($x) || $x >= 5) { - return; - } - $x++; - $data['add_mg2static_points'] = $x; - $data = $this->impStats($data); - Db::sql('update eff_users set x = ?, data = ? where uid = ? and `delete` = 0 and v2 = 260 and user_use = ?', - [$x, $data, $uid, $this->u->info['id']]); - } - - /** - * @param $uid - * @param $mp - * @param $tp [not used] - * @return bool - */ - public function minMana($uid, $mp, $tp = null) - { - global $btl; - /* , $mp > 0 */ - // ss - $mp -= round($mp / 100 * $btl->stats[$btl->uids[$uid]]['min_use_mp']); - $btl->stats[$btl->uids[$uid]]['mpNow'] -= $mp; - $mpNow = $this->zeromax($btl->stats[$btl->uids[$uid]]['mpNow'], $btl->stats[$btl->uids[$uid]]['mpAll']); - if ($mpNow > 0) { - Db::sql('update stats set mpNow = ? where id = ?', - [$btl->stats[$btl->uids[$uid]]['mpNow'], $uid]); - } - return $mpNow > 0; - } - - /** - . - * @param $l2 - * @param $t - * @return int - */ - public function magKrit($l2, $t) - { - $r = $l2 * 2 - 7; - if ($r > $t) { - // ( , 2 ) 6% - //250 . 1% - //$r = -1; , -- - $r = 0; - } else { - // 3% - $r = ceil($t * 0.75); - if ($r > 30) { - $r = 30; - } - if (rand(0, 10000) < $r * 100) { - // - $r = 1; - } else { - $r = 0; - } - } - return $r; - } - - /** - * @param $eff - * @param $pr - * @return bool - */ - public function hodUsePriem($eff, $pr) - { - global $btl; - $return_main = true; - $ue = Db::getRow('select * from users left join stats on (users.id = stats.id) where users.id = ? and battle = ? and hpNow > 0', - [$eff['uid'], $btl->info['id']]); - - if (!empty($pr['file'])) { - if (file_exists('../../_incl_data/class/priems/' . $pr['file'] . '.php')) { - $hod = $eff['hod']; - require_once 'priems/' . $pr['file'] . '.php'; - } - } elseif (!empty($pr['file3'])) { - if (file_exists('../../_incl_data/class/priems/' . $pr['file3'] . '.php')) { - $hod = $eff['hod']; - require_once 'priems/' . $pr['file3'] . '.php'; - } - } - return $return_main; - } - - /** data c add_m11=2*{lvl1} . - *
    :
    lvl1 = $uid[level]
    ts5 = $uid[s5]
    mpAll = $uid[mpAll] - * @param string $pl data - * @param int $uid , . - * @return string data . - */ - public function redate($pl, $uid) - { - global $btl; - $i = 0; - if ($pl != '') { - $e = explode('|', $pl); - while ($i < count($e)) { - $f = explode('=', $e[$i]); - $f[1] = getdr($f[1], [0 => 'lvl1', 1 => 'ts5', 2 => 'mpAll'], [ - 0 => $btl->users[$btl->uids[$uid]]['level'], - 1 => $btl->stats[$btl->uids[$uid]]['s5'], - 2 => $btl->stats[$btl->uids[$uid]]['mpAll'], - ]); - if ($f[0] != '' && $f[1] != '') { - $e[$i] = implode('=', $f); - } - $i++; - } - $pl = implode('|', $e); - } - return $pl; - } - - private function cancelEffects($effects_ids, $uid, battleClass $btl) - { - $arr = explode(',', $effects_ids); - if (!is_array($arr) || empty($arr)) { - return; - } - foreach ($arr as $eid) { - if ($eid <= 0) { - continue; - } - $p = Db::getRow('select * from eff_users where uid = ? and v1 = ? and v2 = ? and `delete` = 0', [$uid, 'priem', $eid]); - if (!$p['id']) { - continue; - } - $p['priem'] = Db::getRow('select * from priems where id = ?', [$eid]); - $btl->delPriem($p, $btl->users[$btl->uids[$uid]], 2); - } - } - - /* uid - - pr - id - data - , -1, 3 - d2 - 3 - tm - , 77 - - h - - "" - uu - id - tp - - */ - /** - * @param int $uid - * @param int $pr id - * @param int|string $data , -1, 3 - * @param int $d2 - * @param $tm - * @param int $h - * @param int $uu id - * @param $max - * @param $bj - * @param $tp - * @param $ch - * @param $rdt - * @param $tr_life_user - * @param $noupdatebtl - * @param $noplus - * @param $pname - * @return bool - */ - public function addPriem( - $uid, - $pr, - $data, - $d2, - $tm, - $h, - $uu, - $max, - $bj, - $tp = 0, - $ch = 0, - $rdt = 0, - $tr_life_user = 0, - $noupdatebtl = 0, - $noplus = 0, - $pname = null - ) { - global $btl; - //$pl = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `id` = ' . (int)$pr)); - $pl = Db::getRow('select * from priems where id = ?', [$pr]); - - $r = false; - - if (!$pl['id']) { - return false; - } - - if ($data == -1) { - $data = $this->redate($pl['date3'], $this->u->info['id']); - } elseif ($d2 == 1) { - $data .= '|' . $this->redate($pl['date3'], $this->u->info['id']); - } - - $this->cancelEffects($pl['cancel_eff2'], $uid, $btl); - - if ($max <= 0) { - return false; - } - - if ($noplus == 0) { - if ($pl['zmu'] == 1) { - $num = Db::getRow('select * from eff_users where bj = ? and user_use = ? and uid = ? and `delete` = 0', - [$bj, $this->u->info['id'], $uid]); - } else { - $num = Db::getRow('select * from eff_users where bj = ? and uid = ? and `delete` = 0', - [$bj, $uid]); - } - } - - if (isset($num['id']) && ($num['user_use'] != $this->u->info['id'] && $pl['zmu'] != 2)) { - // - Db::sql('update eff_users set `delete` = unix_timestamp() where id = ?', - [$num['id']]); - $i = 0; - while ($i < count($btl->stats[$btl->uids[$uid]]['effects'])) { - if ($btl->stats[$btl->uids[$uid]]['effects'][$i]['id'] == $num['id']) { - // - $btl->stats[$btl->uids[$uid]]['effects'][$i]['delete'] = time(); - } - $i++; - } - unset($num); - } - if (!isset($num['id'])) { - $q = 'insert into eff_users (tr_life_user, bj, user_use, hod, v2, img2, id_eff, uid, name, data, overType, timeUse, v1) values (?,?,?,?,?,?,?,?,?,?,?,?,?)'; - $image = !empty($pl['img']) ? $pl['img'] : $pl['id']; - $name = !empty($pname) ? $pname : $pl['name']; - $image .= '.gif'; - Db::sql($q, [floor($tr_life_user), $bj, $uu, $h, $pl['id'], $image, 22, $uid, $name, $data, 0, $tm, 'priem']); - $lid = Db::lastInsertId(); - if ($lid) { - $r = true; - } - - /* $btl->eff */ - if ($noupdatebtl == 0) { - $btl->stats[$btl->uids[$uid]] = $this->u->getStats($uid, 0); - } - } elseif ($num['x'] < $max) { - // - $num['x']++; - $num['hod'] = $h; - if ($data != -1 && $data != '' && $d2 == 2) { - $num['data'] .= '|' . $data; - Db::sql('update eff_users set x = x + 1, hod = ?, data = ? where id = ?', - [$h, $num['data'], $num['id']]); - } else { - Db::sql('update eff_users set x = x + 1, hod = ? where id = ?', - [$h, $num['id']]); - } - $r = true; - } else { - // - $num['hod'] = $h; - if ($data != -1 && $data != '' && $d2 == 2) { - $num['data'] .= '|' . $data; - Db::sql("update eff_users set hod = ?, data = ? where id = ?", [$h, $num['data'], $num['id']]); - } else { - Db::sql('update eff_users set hod = ? where id = ?', - [$h, $num['id']]); - } - $r = true; - } - - if (isset($num['id'])) { - foreach ($btl->stats[$btl->uids[$uid]]['effects'] as $effect) { - if ($effect['id'] != $num['id']) { - continue; - } - $effect['data'] = $num['data']; - $effect['hod'] = $num['hod']; - $effect['x'] = $num['x']; - } - } - - return $r; - } - - /** data ('|a=1|b=2|c=3') [a=>1, b=>2, c=>3]. - * @param $m - * @return array - */ - public function lookStatsArray($m) - { - $arr = json_decode(str_replace(['=', '|'], ['":', ',"'], '{"' . $m . '}'), true); - return $arr ?: []; - } - - /** [a=>1, b=>2, c=>3] data ('|a=1|b=2|c=3') . - * @param array $m - * @return string - */ - private function impStats(array $m) - { - $str = json_encode($m); - return $str ? str_replace(['":', ',"', '{"', '}'], ['=', '|'], $str) : ''; - } - - /** - * @param $data - * @param array $values - * @return string - */ - private function changeStatsData($data, array $values) - { - $arr = $this->lookStatsArray($data); - foreach ($values as $key => $value) { - $arr[$key] = $value; - } - return $this->impStats($arr); - } - - public function magicRegen($ue, $hpmin, $tmp, $pl, $eff, $rp = 0, $dp = 0, $krituet = true, $dopyrn = 0) - { - global $btl; - $rr = []; - $uen = $ue['id']; - $usu = $eff['user_use']; - if ($eff['user_use'] < 1) { - $usu = $this->u->info['id']; - } - $k = $this->magKrit($ue['level'], $btl->stats[$btl->uids[$usu]]['mg' . $tmp]); - - if (!$krituet) { - $k = 0; - } - - $hpmin = $this->testPower($btl->stats[$btl->uids[$usu]], $btl->stats[$btl->uids[$uen]], $hpmin, $tmp, 2); - $hpmin = round($hpmin); - - $dopyrn = $this->testPower($btl->stats[$btl->uids[$usu]], $btl->stats[$btl->uids[$uen]], $dopyrn, $tmp, 2); - $dopyrn = round($dopyrn); - - if ($btl->users[$btl->uids[$uen]]['tactic7'] <= 0 && $dp == 0) { - $hpmin = 0; - $k = -1; - $dopyrn = 0; - } - if ($k == 1 && $hpmin != 0 && $krituet) { - // - $hpmin = $hpmin * 2; - } elseif ($k == -1 && $hpmin != 0) { - // - $hpmin = $hpmin / 2; - $dopyrn = $dopyrn / 2; - } - if ($hpmin < 1) { - $hpmin = 0; - } else { - $hpmin = rand(($hpmin * 0.97), $hpmin); - } - - $hpmin += floor($dopyrn); - - if (isset($btl->stats[$btl->uids[$uen]]['min_heal_proc'])) { - if ($btl->stats[$btl->uids[$uen]]['min_heal_proc'] > 100) { - $btl->stats[$btl->uids[$uen]]['min_heal_proc'] = 100; - } - $hpmin = round($hpmin / 100 * (100 + $btl->stats[$btl->uids[$uen]]['min_heal_proc'])); - } - - if ($btl->users[$btl->uids[$uen]]['tactic7'] > 0 && $dp == 0) { - // , - $btl->users[$btl->uids[$uen]]['tactic7'] -= $hpmin / $btl->stats[$btl->uids[$uen]]['hpAll']; - $btl->users[$btl->uids[$uen]]['tactic7'] = round($btl->users[$btl->uids[$uen]]['tactic7'], 2); - $btl->stats[$btl->uids[$uen]]['tactic7'] = $btl->users[$btl->uids[$uen]]['tactic7']; - if ($uen == $this->u->info['id']) { - $this->u->info['tactic7'] = $btl->users[$btl->uids[$uen]]['tactic7']; - $this->u->stats['tactic7'] = $btl->users[$btl->uids[$uen]]['tactic7']; - } - if ($btl->users[$btl->uids[$uen]]['tactic7'] < 0) { - $btl->users[$btl->uids[$uen]]['tactic7'] = 0; - } - } - $hp2 = floor($btl->stats[$btl->uids[$uen]]['hpNow'] + $hpmin); - - if ($hp2 > $btl->stats[$btl->uids[$uen]]['hpAll']) { - $hpmin = floor($hp2 - $btl->stats[$btl->uids[$uen]]['hpAll']); - $hp2 = $btl->stats[$btl->uids[$uen]]['hpAll']; - } elseif ($hp2 < 0) { - $hp2 = 0; - } - $rr[0] = $hpmin; // - $rr[1] = $k; // - /* */ - // - $miny = 0; // ( ) - $minu = 0; - $sp1 = mysql_query('SELECT `e`.* FROM `eff_users` AS `e` WHERE `e`.`uid` = "' . $uen . '" AND `e`.`id_eff` = "22" AND `e`.`delete` = "0" AND `e`.`v1` = "priem" LIMIT 25'); - while ($pl2 = mysql_fetch_assoc($sp1)) { - $pl2['priem'] = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $pl2['v2'] . '" LIMIT 1')); - if (isset($pl2['priem']['id'])) { - $dt1 = $this->lookStatsArray($pl2['priem']['date2']); - if (isset($dt1['yron_u2'])) { - $minu = getdr($dt1['yron_u2'], [0 => 'lvl1', 1 => 'yr1', 2 => 'ts5', 3 => 'ts6'], - [0 => $btl->users[$btl->uids[$level]], 1 => $hpmin, 2 => 0, 3 => 0]); - $miny -= $minu; - $hpmin += $minu; - $btl->delPriem($pl2, $btl->users[$btl->uids[$uen]]); - } - } - } - - /* */ - - // - $btl->users[$btl->uids[$uen]]['hpNow'] = $hp2; - $btl->stats[$btl->uids[$uen]]['hpNow'] = $hp2; - mysql_query('UPDATE `stats` SET `hpNow` = ' . $hp2 . ',`tactic7` = ' . $btl->users[$btl->uids[$uen]]['tactic7'] . ' WHERE `id` = "' . $uen . '" LIMIT 1'); - - // - $vLog = - 'time1=' . time() . - '||s1=' . $this->u->info['sex'] . - '||t1=' . $this->u->info['team'] . - '||login1=' . $this->u->info['login'] . - '||s2=' . $btl->users[$btl->uids[$uen]]['sex'] . - '||t2=' . $btl->users[$btl->uids[$uen]]['team'] . - '||login2=' . $btl->users[$btl->uids[$uen]]['login']; - $mas1 = [ - 'time' => time(), - 'battle' => $btl->info['id'], - 'id_hod' => ($btl->hodID + 1), - 'text' => '', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - if ($rp == 1) { - $mas1['id_hod']--; - } - - $btl->takeExp($this->u->info['id'], ($hpmin * 0.33), $this->u->info['id'], $uen, true); - - if ($hpmin > 0) { - $hpmin = '+' . ceil($hpmin); - } else { - $hpmin = '--'; - } - $tco = [1 => '006699', 2 => '006699', 3 => '006699', 4 => '006699']; // - $tcl = [1 => 'A00000', 2 => '008080', 3 => '0000FF', 4 => 'A52A2A']; // - $tco = $tco[$tmp]; - $tcl = $tcl[$tmp]; - if ($k == 1) { - // - $tco = 'FF0000'; - $tcl = 'FF0000'; - } elseif ($k == -1) { - // - $tco = '979797'; - $tcl = '979797'; - } - $nmz = [ - 1 => [0 => '', 1 => ''], - 2 => [0 => '', 1 => ''], - 3 => [0 => '', 1 => ''], - 4 => [0 => '', 1 => ''], - ]; - $nmz = $nmz[$tmp]; - - if ($rp == 1) { - $sx = [0 => '', 1 => '']; - $mas1['text'] = '{tm1} "' . $pl['name'] . '" {u2}. ' . $hpmin . ' [' . ceil($hp2) . '/' . $btl->stats[$btl->uids[$uen]]['hpAll'] . ']'; - } else { - $mas1['text'] = '{tm1} {u1} {1x16x0} "' . $pl['name'] . '" {u2} ' . $nmz[0] . '. ' . $hpmin . ' [' . ceil($hp2) . '/' . $btl->stats[$btl->uids[$uen]]['hpAll'] . ']'; - } - $btl->add_log($mas1); - $pz[(int)$id] = 1; - return $rr; - } - - /** magicAttack - * @return array - */ - private function hasGhostDefence($uid) - { - $def = [ - 'all' => false, - self::FIRE => false, - self::AIR => false, - self::EARTH => false, - self::WATER => false, - ]; - $priems = Db::getRows('select v2 from eff_users where uid = ? and v2 in (141, 142, 144, 145, 146)', [$uid]); - foreach ($priems as $priem) { - if ($priem['v2'] == 141) { - $def['all'] = true; - } - if ($priem['v2'] == 142) { - $def[self::FIRE] = true; - } - if ($priem['v2'] == 144) { - $def[self::AIR] = true; - } - if ($priem['v2'] == 145) { - $def[self::WATER] = true; - } - if ($priem['v2'] == 146) { - $def[self::EARTH] = true; - } - } - return $def; - } - - /** - * . - * [priem]. - * @param int $attackerId - * @param int $defenderId - * @param float $damage - * @param string $damageType (?) , . - * @param bool $hasCritical , - * @return array [0|damage] int , [1|crit] bool , [2|miss] bool , [3|miss_type] int ( = 2). - * @author Insallah - */ - public function magicAttack(battleClass $btl, $attackerId, $defenderId, $damage, $damageType, $hasCritical = false) - { - // , . - . - $dmgRuNames = [ - self::FIRE => '', - self::WATER => '', - self::AIR => '', - self::EARTH => '', - ]; - if (in_array($damageType, array_keys($dmgRuNames))) { - $damageType = $dmgRuNames[$damageType]; - } - - // . - // pm# = . - // m11 = . - // m11a = . - // [pm# = m11 + m11a] - ! - $power = $btl->stats[$btl->uids[$attackerId]]['pm' . $this->mname[$damageType]]; - - // . - $suppression = 0; - $suppression += $btl->stats[$btl->uids[$attackerId]]['pzm']; - // , 250. - $suppression += $btl->stats[$btl->uids[$attackerId]]['yzm']; - - // . - $skills = $btl->stats[$btl->uids[$attackerId]]['mg' . $this->mname[$damageType]]; - - // - // zm# = - // zm = - // zma = - // [zm# = zm + zma] - ! - $defence = $btl->stats[$btl->uids[$defenderId]]['zm' . $this->mname[$damageType]]; - - // 100% . - // 8 - 20, : 8 10 . - $requiredSkills = $btl->users[$btl->uids[$defenderId]]['level'] * 2; - - // ׸ " ". - $isGarantCrit = $btl->stats[$btl->uids[$attackerId]]['acestar'] > 0; - - // , . - $supressedDefence = Math::addPercent($defence, -min($suppression, 100)); - - // . - $damage *= $skills - $requiredSkills; - - // , > 0. - $poweredDamage = $damage > 0 ? $damage + $power : 0; - - // - $isCritical = $hasCritical && $skills >= mt_rand(0, 100); - - if ($isGarantCrit) { - $isCritical = true; - Db::sql('delete from eff_users where uid = ? and `delete` = 0 and data like ?', - [$attackerId, '%add_acestar%']); - unset($q); - } - - if ($skills >= $requiredSkills || $isCritical) { - $isHit = true; - } else { - $isCritical = false; - $missChance = 3 * ($requiredSkills - $skills); - $isHit = mt_rand(0, 100) > $missChance; - } - - // . , - . - $pType = 0; - if ($isHit) { - // = - , 0. . - //$finalDamage = max(round(Math::addPercent($poweredDamage, -$supressedDefence)), 0); - $finalDamage = $poweredDamage - $supressedDefence; - if ($isCritical) { - $finalDamage *= 2; - } - } else { - $finalDamage = 0; - // . , - . - $pType = 2; - } - - // , . - $ghostDefences = $this->hasGhostDefence($defenderId); - if ($ghostDefences['all']) { - $finalDamage /= 4; - } - - // . , . - if (in_array($damageType, $dmgRuNames)) { - $damageType = array_search($damageType, $dmgRuNames); - } - - if ($ghostDefences[$damageType]) { - $finalDamage /= 2; - } - - $finalDamage = max(round($finalDamage), 0); - - // . - if ($btl->users[$btl->uids[$attackerId]]['admin'] > 0) { - $s = " : $suppression%, : $power, : $skills, -
    : damage x ($skills - $requiredSkills)
    $damageType - : ($defence -$suppression%) = $supressedDefence | - : ($damage +$power) = $poweredDamage
    - : ($poweredDamage -$supressedDefence) = $finalDamage"; - $s .= $isCritical ? ' ( *2)' : ''; - echo "
    $s
    "; - } - - - // !isHit . - // pType , = 0 = 2 . - . - // -damage - . - return [ - (int)$finalDamage, - $isCritical, - !$isHit, - $pType, // - 'damage' => (int)$finalDamage, - 'crit' => $isCritical, - 'miss' => !$isHit, - 'miss_type' => $pType, - ]; - } - - /** . . */ - public function magatack($u1, $u2, $yron, $type, $krit) - { - global $btl; - return $this->magicAttack($btl, $u1, $u2, $yron, $type, $krit); - } - - public function magatackfiz($u1, $u2, $yron, $type, $krit, $ymelki) - { - global $btl; - $cof_mag = [ - 0 => 250, - 1 => 250, - 2 => 250, - 3 => 250, - 4 => 250, - 5 => 250, - 6 => 250, - 7 => 250, - 8 => 250, - 9 => 300, - 10 => 360, - 11 => 475, - 12 => 520, - 13 => 625, - 14 => 750, - 15 => 895, - 16 => 1075, - 17 => 1290, - 18 => 1550, - 19 => 1860, - 20 => 2230, - 21 => 2675, - ]; - - $r = $yron; - // - if (!isset($ymelki) || $ymelki == '0') { - $ymelki = $type; - } - // - $prm = [ - 'ym' => $btl->stats[$btl->uids[$u1]]['mg' . $this->mname[$ymelki]], // ( ) - 'y' => $btl->stats[$btl->uids[$u1]]['a' . $this->mname[$ymelki]], // - 'yv' => 0, //, . - 'max_krit' => 0 // - ]; - // - // ( )*2 - 7 - , - /* - / : * 2 9 - 3%. 30% - */ - // - /* - b - - m - - z - [.] - p - [.] - k - ; k=250 8, k=300 9 .. +20% - */ - $prm['b'] = $r; // - $prm['m'] = $btl->stats[$btl->uids[$u1]]['pa' . $this->mname[$type]]; // - $prm['z'] = $btl->stats[$btl->uids[$u2]]['za' . $this->mname[$type]]; // (.) - $prm['p'] = $btl->stats[$btl->uids[$u1]]['pza' . $this->mname[$type]]; // (.) - $prm['k'] = $cof_mag[$btl->users[$btl->uids[$u1]]['level']]; // - // - if ($prm['p'] * 10 > $prm['k']) { - $prm['p'] = floor($prm['k'] / 10); - } - // - $r = $prm['b'] * (1 + $prm['m'] / 100) * pow(2, (($prm['p'] * 10 - $prm['z']) / $prm['k'])); - if ($r < floor($prm['b'] * 0.2)) { - $r = floor($prm['b'] * 0.2); - } elseif ($r > floor($prm['b'] * 10)) { - $r = floor($prm['b'] * 10); - } - // - //$prm['y'] -= 5; - if ($type < $this->mname[$type]) { - $prm['yv'] = ($btl->users[$btl->uids[$u2]]['level'] * 2 - 7); - } else { - $prm['yv'] = ($btl->users[$btl->uids[$u2]]['level'] * 2 - 9); - } - // - if ($prm['y'] >= $prm['yv'] || (isset($this->mname[$ymelki]) && $prm['ym'] >= $prm['yv'])) { - if ($krit == 1) { - if (isset($this->mname[$ymelki])) { - $prm['max_krit'] = 3 * ($prm['ym'] - $prm['yv']); - } else { - $prm['max_krit'] = 3 * ($prm['y'] - $prm['yv']); - } - //echo '[Magical crit: '.$prm['max_krit'].'%]'; - if ($prm['max_krit'] < 0) { - $prm['max_krit'] = 0; - } elseif ($prm['max_krit'] > 30) { - $prm['max_krit'] = 30; - } - //$prm['max_krit'] = round($prm['max_krit']/2); - // - if (rand(0, 100) <= $prm['max_krit']) { - $krit = true; - } else { - $krit = false; - } - } else { - $krit = false; - } - $promah = false; - } else { - $krit = false; - // - $prm['promah'] = 3 * ($prm['yv'] - $prm['ym']); - if ($prm['promah'] < 0) { - $prm['promah'] = 0; - } elseif ($prm['promah'] > 30) { - $prm['promah'] = 30; - } - if (rand(0, 100) <= $prm['promah']) { - $promah = true; - } else { - $promah = false; - } - } - // - if ($krit) { - $r = $r * 2; - $promah_type = 0; - } elseif ($promah) { - $r = rand(1, floor($r / 4)); - $promah_type = 1; - if (rand(0, 100) < 50) { - $r = 0; - $promah_type = 2; - } - } - // - unset($prm); - // - return [floor($r), $krit, $promah, $promah_type]; - } - - // priems - public function magicAtack( - $ue, - $hpmin, - $tmp, - $pl, - $eff, - $rp = 0, - $mxx = 0, - $fiz = 0, - $nomf = 0, - $krituet = true, - $heal = 0, - $namenew = null - ) { - $trawm_off = false; - global $btl; - if ($namenew != null) { - $pl['name'] = $namenew; - } - $rr = []; - $nhpmin = $hpmin; - $uen = $ue['id']; - $usu = $eff['user_use']; - if ($eff['user_use'] < 1) { - $usu = $this->u->info['id']; - } - if ($nomf == 0) { - $k = $this->magKrit($ue['level'], $btl->stats[$btl->uids[$usu]]['mg' . $tmp]); - if (!$krituet) { - $k = 0; - } - if ($fiz == 0) { - // - $hpmin = $this->testPower($btl->stats[$btl->uids[$usu]], $btl->stats[$btl->uids[$uen]], $hpmin, $tmp, - 2); - } else { - // - $wAp = $btl->stats[$btl->uids[$usu]]['pa' . $tmp . '']; - $wAp += $btl->stats[$btl->uids[$usu]]['m10']; - $wAp -= $btl->stats[$btl->uids[$uen]]['antpa' . $tmp . ''] * 1.75; - $wAp -= $btl->stats[$btl->uids[$uen]]['antm10'] * 1.75; - $hpmin += ceil((0.01 + $hpmin / 100) * (0.01 + 0.98 * $wAp)) - 1; - - $hpmin -= round($hpmin / 100 * (35 * ($btl->stats[$btl->uids[$uen]]['za'] + $btl->stats[$btl->uids[$uen]]['za' . $tmp]) / 1200)); - $hpmin = round($hpmin); - - if (isset($btl->stats[$btl->uids[$uen]]['zaproc']) || isset($btl->stats[$btl->uids[$uen]]['za' . $fiz . 'proc'])) // () - { - $hpmin = floor($hpmin / 100 * (100 - $btl->stats[$btl->uids[$uen]]['zaproc'] - $btl->stats[$btl->uids[$uen]]['za' . $fiz . 'proc'])); - if ($hpmin < 0) { - $hpmin = 0; - } - } - } - } - $hpmin = round($hpmin); - if ($k == 1 and $krituet) { - // - $hpmin = $hpmin * 2; - } elseif ($k == -1) { - // - $hpmin = $hpmin / 2; - } - if ($hpmin < $nhpmin * 0.2) { - $hpmin = $nhpmin * 0.2; - } - if ($hpmin < 1) { - $hpmin = 0; - } else { - if ($nomf == 0) { - $hpmin = rand(($hpmin * 0.97), $hpmin); - } - } - if ($mxx > 0 && $hpmin > $mxx) { - if ($k == 0) { - $hpmin = $mxx; - } elseif ($k == 1 && $hpmin / 2 > $mxx) { - $hpmin = $mxx * 2; - } - } - $rr[0] = $hpmin; // - $rr[1] = $k; // - /* */ - // - $miny = 0; // ( ) - $sp1 = mysql_query('SELECT `e`.* FROM `eff_users` AS `e` WHERE `e`.`uid` = "' . $uen . '" AND `e`.`id_eff` = "22" AND `e`.`delete` = "0" AND `e`.`v1` = "priem" LIMIT 25'); - while ($pl2 = mysql_fetch_assoc($sp1)) { - $pl2['priem'] = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $pl2['v2'] . '" LIMIT 1')); - if (isset($pl2['priem']['id'])) { - $dt1 = $this->lookStatsArray($pl2['priem']['date2']); - if (isset($dt1['yron_u2'])) { - $minu = getdr($dt1['yron_u2'], [0 => 'lvl1', 1 => 'yr1', 2 => 'ts5', 3 => 'ts6'], - [0 => $btl->users[$btl->uids[$level]], 1 => $hpmin, 2 => 1, 3 => 0]); - $miny -= $minu; - $hpmin += $minu; - if (isset($dt1['rzEndMg']) && $dt1['rzEndMg'] == 1) { - $btl->delPriem($pl2, $btl->users[$btl->uids[$uen]]); - } - } elseif (isset($dt1['rzEndMg']) && $dt1['rzEndMg'] == 1) { - $btl->delPriem($pl2, $btl->users[$btl->uids[$uen]]); - } - } - } - - $hpmin = $btl->testPogB($uen, $hpmin); - - $hp2 = floor($btl->stats[$btl->uids[$uen]]['hpNow'] - $hpmin); - - if ($btl->stats[$btl->uids[$usu]]['yrnhealmpprocmg' . $tmp] > 0 && $fiz == 0) { - // - $btl->stats[$btl->uids[$usu]]['mpNow'] += round($hpmin / 100 * $btl->stats[$btl->uids[$usu]]['yrnhealmpprocmg' . $tmp]); - //if($btl->stats[$btl->uids[$usu]]['mpNow'] > $btl->stats[$btl->uids[$usu]]['mpAll']) { - //$btl->stats[$btl->uids[$usu]]['mpNow'] = $btl->stats[$btl->uids[$usu]]['mpAll']; - //} - $btl->users[$btl->uids[$usu]]['mpNow'] = $btl->stats[$btl->uids[$usu]]['mpNow']; - if ($usu == $this->u->info['id']) { - $this->u->info['mpNow'] = $btl->stats[$btl->uids[$usu]]['mpNow']; - $this->u->stats['mpNow'] = $btl->stats[$btl->uids[$usu]]['mpNow']; - } - } - - if ($hp2 < 0) { - $hp2 = 0; - } elseif ($hp2 > $btl->stats[$btl->uids[$uen]]['hpAll']) { - $hp2 = $btl->stats[$btl->uids[$uen]]['hpAll']; - } - - $btl->stats[$btl->uids[$uen]]['last_hp'] = -floor($hpmin); - - if ($heal != 0) { - if ($heal == -1) { - // - $btl->stats[$btl->uids[$eff['user_use']]]['hpNow'] += $hpmin; - if ($btl->stats[$btl->uids[$eff['user_use']]]['hpNow'] < 0) { - $btl->stats[$btl->uids[$eff['user_use']]]['hpNow'] = 0; - } elseif ($btl->stats[$btl->uids[$eff['user_use']]]['hpNow'] > $btl->stats[$btl->uids[$eff['user_use']]]['hpAll']) { - $btl->stats[$btl->uids[$eff['user_use']]]['hpNow'] = $btl->stats[$btl->uids[$eff['user_use']]]['hpAll']; - } - - if ($eff['user_use'] == $this->u->info['id']) { - $this->u->stats['hpNow'] = $btl->stats[$btl->uids[$eff['user_use']]]['hpNow']; - } - - $btl->users[$btl->uids[$eff['user_use']]]['hpNow'] = $btl->stats[$btl->uids[$eff['user_use']]]['hpNow']; - - mysql_query('UPDATE `stats` SET `hpNow` = "' . $btl->stats[$btl->uids[$eff['user_use']]]['hpNow'] . '" WHERE `id` = "' . $eff['user_use'] . '" LIMIT 1'); - } else { - // - - } - } - - /* */ - - // - $btl->users[$btl->uids[$uen]]['hpNow'] = $hp2; - $btl->stats[$btl->uids[$uen]]['hpNow'] = $hp2; - - if ($uen == $this->u->info['id']) { - $this->u->stats['hpNow'] = $hp2; - } - - // - if ($btl->info['type'] == 99 and $hp2 == 0 and !$trawm_off) { - //$eff['user_use'] - //$sp1 = mysql_query('SELECT `e`.* FROM `eff_users` AS `e` WHERE `e`.`uid` = "'.$uen.'" AND `e`.`id_eff` = "22" AND `e`.`delete` = "0" AND `e`.`v1` = "priem" LIMIT 25'); - - $trawm_off = true; - //$at[2][$i]['ttravm']=' .'; - $btl->addTravm($btl->users[$btl->uids[$uen]]['id'], 3, $btl->users[$btl->uids[$eff['user_use']]]['level']); - } - $upd = mysql_query('UPDATE `stats` SET `hpNow` = ' . $hp2 . ',`last_hp` = "' . $btl->stats[$btl->uids[$uen]]['last_hp'] . '" WHERE `id` = "' . $uen . '" LIMIT 1'); - - // - $vLog = 'time1=' . time() . '||s1=' . $btl->users[$btl->uids[$usu]]['sex'] . '||t1=' . $btl->users[$btl->uids[$usu]]['team'] . '||login1=' . $btl->users[$btl->uids[$usu]]['login'] . '||s2=' . $btl->users[$btl->uids[$uen]]['sex'] . '||t2=' . $btl->users[$btl->uids[$uen]]['team'] . '||login2=' . $btl->users[$btl->uids[$uen]]['login'] . ''; - $mas1 = [ - 'time' => time(), - 'battle' => $btl->info['id'], - 'id_hod' => ($btl->hodID + 1), - 'text' => '', - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - if ($rp > 0) { - $mas1['id_hod']--; - } - $hpminkrit = 0; - if ($k == 1) { - $hpminkrit = $hpmin; - } - $btl->addNewStat([ - 'battle' => $this->u->info['battle'], - 'uid1' => $this->u->info['id'], - 'uid2' => $uen, - 'time' => time(), - 'type' => 0, - 'a' => '10000', - 'b' => 0, - 'type_a' => 1, - 'type_b' => 0, - 'ma' => 1, - 'mb' => 1, - 'yrn' => $hpmin, - 'yrn_krit' => $hpminkrit, - 'tm1' => $this->u->info['team'], - 'tm2' => $btl->users[$btl->uid[$uen]]['team'], - ]); - - $btl->takeExp($this->u->info['id'], $hpmin, $usu, $uen); - - if ($hpmin > 0) { - $hpmin = '-' . ceil($hpmin); - } else { - $hpmin = '--'; - } - $tco = [ - 1 => '006699', - 2 => '006699', - 3 => '006699', - 4 => '006699', - 5 => '006699', - 6 => '006699', - 7 => '006699', - ]; // - $tcl = [ - 1 => 'A00000', - 2 => '008080', - 3 => '0000FF', - 4 => 'A52A2A', - 5 => '006699', - 6 => '006699', - 7 => '006699', - ]; // - $tco = $tco[$tmp]; - $tcl = $tcl[$tmp]; - if ($k == 1) { - // - $tco = 'FF0000'; - $tcl = 'FF0000'; - } elseif ($k == -1) { - // - $tco = 'CCCCCC'; - $tcl = 'CCCCCC'; - } - $nmz = [ - 1 => [0 => '', 1 => ''], - 2 => [0 => '', 1 => ''], - 3 => [0 => '', 1 => ''], - 4 => [0 => '', 1 => ''], - 5 => [0 => '', 1 => ''], - 6 => [0 => '', 1 => ''], - 7 => [0 => ' ', 1 => ' '], - ]; - $nmz = $nmz[$tmp]; - if ($fiz > 0) { - $nmz = [ - 1 => [0 => ', , ', 1 => ''], - 2 => [0 => ', , ', 1 => ''], - 3 => [0 => ', , ', 1 => ''], - 4 => [0 => ', , ', 1 => ''], - ]; - $nmz = $nmz[$fiz]; - } - - if ($rp == 1) { - if ($k == 0) { - $tcl = '000000'; - $tco = '008000'; - } - $sx = [0 => '', 1 => '']; - $mas1['text'] = '{tm1} {u2} ' . $sx[$btl->users[$btl->uids[$uen]]['sex']] . ' "' . $pl['name'] . '". ' . $hpmin . ' [' . ceil($hp2) . '/' . $btl->stats[$btl->uids[$uen]]['hpAll'] . ']'; - } else { - if ($fiz == 1) { - $mas1['text'] = '{tm1} {u1} {1x16x0} "' . $pl['name'] . '" {u2}. ' . $hpmin . ' [' . ceil($hp2) . '/' . $btl->stats[$btl->uids[$uen]]['hpAll'] . ']'; - } else { - $mas1['text'] = '{tm1} {u1} {1x16x0} "' . $pl['name'] . '" ' . $nmz[0] . ' {u2}. ' . $hpmin . ' [' . ceil($hp2) . '/' . $btl->stats[$btl->uids[$uen]]['hpAll'] . ']'; - } - } - $btl->add_log($mas1); - $pz[(int)$id] = 1; - return $rr; - } - - private function testActiv($id) - { - $r = 0; - if ( - $this->u->info['admin'] > 0 || - $this->u->info['nadmin'] > 0 || - $this->u->info['id'] > 0) - { - $r = 1; - } else { - $tst = $this->u->testAction('`uid` = "' . $this->u->info['id'] . '" AND `time` < ' . time() . ' AND `vars` = "read" AND `vals` = "' . $id . '" LIMIT 1', 1); - if (isset($tst['id'])) { - $r = 1; - } - } - return $r; - } - - private function testRazmenOldUser($u2, $u1, $plid) - { - global $btl, $u; - $r = 0; - // -- -- - if ($btl->users[$btl->uids[$u2]]['id'] != $this->u->info['id']) { - if ($btl->users[$btl->uids[$u1]]['level'] < $btl->users[$btl->uids[$u2]]['level']) { - $r = 1; - echo '
    '; - } elseif ($btl->users[$btl->uids[$u1]]['bot'] > 0 && $btl->users[$btl->uids[$u2]]['bot'] == 0) { - echo '
    '; - $r = 1; - } elseif ( - $btl->users[$btl->uids[$u1]]['id'] != $btl->users[$btl->uids[$u2]]['id'] && - !in_array($plid, [35, 63, 64, 65, 66, 85, 86, 87, 88, 89, 90, 104, 105, 106, 107, 134, 135, 136, 137]) - ) // 90,89,88,87,86,85,35 - { - $this->addPriem($this->u->info['id'], '344', 'add_m11=-' . round($this->u->stats['m11'] * 75 / 100), 1, 77, 1, - $this->u->stats['id'], 3, '', 0, 0, 1); // - } - } - return $r; - } - - public function testDie($u1) - { - global $btl; - // 1 2 - $btl->spaCheck($btl->stats[$btl->uids[$u1]]['id']); - } - - public function pruse($id) - { - global $u, $c, $code, $btl, $ue; - if ($id == 100500 && $this->u->info['animal'] > 0) { - $use_lst = $this->u->testAction('`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->info['id'] . '" LIMIT 1', - 1); - if (!isset($use_lst['id'])) { - $a = mysql_fetch_assoc(mysql_query('SELECT * FROM `users_animal` WHERE `uid` = "' . $this->u->info['id'] . '" AND `id` = "' . $this->u->info['animal'] . '" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1')); - if ($this->u->stats['hpNow'] < 1) { - echo ' , '; - } elseif (isset($a['id']) && $a['eda'] < 1) { - echo ' ...'; - } elseif (isset($a['id'])) { - // - $tp = [ - 1 => '', - 2 => '', - 3 => '', - 4 => '', - 5 => '', - 6 => '', - 7 => '', - ]; - $id = mysql_fetch_assoc(mysql_query('SELECT `id` FROM `test_bot` WHERE `login` = "' . $tp[$a['type']] . ' [' . $a['level'] . ']" LIMIT 1')); - if (isset($id['id']) && $btl->info['type'] != 500) { - $b = $this->u->addNewbot($id['id'], null, null); - if ($b > 0 && $b != false) { - $a['eda'] -= 4; - if ($a['eda'] < 0) { - $a['eda'] = 0; - } - - $vLog = 'time1=' . time() . '||s1=' . $this->u->info['sex'] . '||t1=' . $this->u->info['team'] . '||login1=' . $this->u->info['login'] . ''; - $mas1 = [ - 'time' => time(), - 'battle' => $btl->info['id'], - 'id_hod' => $btl->hodID, - 'vars' => $vLog, - 'zona1' => '', - 'zonb1' => '', - 'zona2' => '', - 'zonb2' => '', - 'type' => '1', - ]; - - $sex = $this->u->info['sex'] === 1 ? 'a' : ''; - $mas1['text'] = "{tm1} {u1} $sex "" . $a['name'] . '"'; - $btl->add_log($mas1); - - mysql_query('UPDATE `users` SET `login` = "' . $a['name'] . ' ( ' . $this->u->info['login'] . ')",`obraz` = "' . $a['obraz'] . '.gif",`battle` = "' . $btl->info['id'] . '" WHERE `id` = "' . $b['id'] . '" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "' . $this->u->info['team'] . '" WHERE `id` = "' . $b['id'] . '" LIMIT 1'); - mysql_query('UPDATE `users_animal` SET `eda` = "' . $a['eda'] . '" WHERE `id` = "' . $a['id'] . '" LIMIT 1'); - $this->u->addAction(time(), 'animal_use' . $btl->info['id'], $a['level']); - } else { - echo ' ...'; - } - } else { - // - echo '
    - ...'; - } - } else { - // - echo ' ...'; - } - } else { - // - echo ' ...'; - } - } else { - $p = explode('|', $this->u->info['priems']); - $pz = explode('|', $this->u->info['priems_z']); - if ($p[(int)$id] > 0 && $pz[(int)$id] <= 0 && $this->u->info['hpNow'] >= 1) { - $pl = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `level`<=' . $this->u->info['level'] . ' AND `id` = ' . $p[(int)$id])); - if (isset($pl['id']) && $pl['activ'] != 1) { - if ($pl['activ'] == 0) { - unset($pl); - } elseif ($pl['activ'] > 1) { - // - if ($this->testActiv($pl['activ']) == 0) { - unset($pl); - } - } - } - if (isset($pl['id'])) { - $notr = 0; - $pl['useon_user'] = $this->u->info['enemy']; - if (isset($_POST['useon']) && $_POST['useon'] != '' && $_POST['useon'] != 'none') { - $_POST['useon'] = iconv('UTF-8', 'windows-1251', $_POST['useon']); - $this->ue = mysql_fetch_assoc(mysql_query('SELECT - - `u`.`id`,`u`.`login`,`u`.`login2`,`u`.`online`,`u`.`admin`,`u`.`city`,`u`.`cityreg`,`u`.`align`,`u`.`clan`, - `u`.`level`,`u`.`money`,`u`.`money3`,`u`.`money4`,`u`.`battle`,`u`.`sex`,`u`.`obraz`,`u`.`win`,`u`.`win_t`, - `u`.`lose`,`u`.`lose_t`,`u`.`nich`,`u`.`timeMain`,`u`.`invis`,`u`.`bot_id`,`u`.`animal`,`u`.`type_pers`, - `u`.`notrhod`,`u`.`bot_room`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`activ`,`u`.`stopexp`,`u`.`real`, - - `st`.* - - FROM `users` AS `u` - LEFT JOIN `stats` AS `st` ON (`u`.`id`=`st`.`id`) - WHERE ( - `u`.`login`="' . mysql_real_escape_string($_POST['useon']) . '" OR - ( - `u`.`login2` = "' . mysql_real_escape_string($_POST['useon']) . '" AND - `u`.`login2` != "") - ) AND - ( - `u`.`inUser` > 0 OR - ( - `u`.`battle`="' . $btl->info['id'] . '" AND - `st`.`hpNow` > 0 - ) - ) ORDER BY `u`.`id` DESC LIMIT 1')); - if (isset($this->ue['id']) && $this->ue['inUser'] > 0) { - $this->ue = mysql_fetch_assoc(mysql_query('SELECT - - `u`.`id`,`u`.`login`,`u`.`login2`,`u`.`online`,`u`.`admin`,`u`.`city`,`u`.`cityreg`,`u`.`align`,`u`.`clan`, - `u`.`level`,`u`.`money`,`u`.`money3`,`u`.`money4`,`u`.`battle`,`u`.`sex`,`u`.`obraz`,`u`.`win`,`u`.`win_t`, - `u`.`lose`,`u`.`lose_t`,`u`.`nich`,`u`.`timeMain`,`u`.`invis`,`u`.`bot_id`,`u`.`animal`,`u`.`type_pers`, - `u`.`notrhod`,`u`.`bot_room`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`activ`,`u`.`stopexp`,`u`.`real`, - - `st`.* - - FROM `users` AS `u` - LEFT JOIN `stats` AS `st` ON (`u`.`id`=`st`.`id`) - WHERE - `u`.`battle`="' . $btl->info['id'] . '" AND - `st`.`hpNow` > 0) AND - `u`.`id` = "' . $this->ue['inUser'] . '" ORDER BY `u`.`id` ASC LIMIT 1')); - } - if (!isset($this->ue['id']) && $pl['trUser'] > 0) { - $notr++; - } - if ($pl['team'] == 1) { - // - if ($this->u->info['team'] != $this->ue['team']) { - $notr++; - } - } elseif ($pl['team'] == 2) { - // - if ($this->u->info['team'] == $this->ue['team']) { - $notr++; - } - } elseif ($pl['team'] == 0) { - // - - } - } else { - $ga = mysql_fetch_assoc(mysql_query('SELECT * FROM `battle_act` WHERE `battle` = "' . $btl->info['id'] . '" AND `uid1` = "' . $this->u->info['id'] . '" AND `uid2` = "' . $this->u->info['enemy'] . '" LIMIT 1')); - if (($this->u->info['enemy'] == 0 || isset($ga['id'])) && ($pl['tr_hod'] > 0 || $pl['trUser'] > 0)) { - $notr++; - } - } - - $notr += $this->testpriem($pl, 1, $this->ue['id']); - - if ($this->ue['id'] > 0) { - $notr += $this->testRazmenOldUser($this->ue['id'], $this->u->info['enemy'], $pl['id']); - } - - if ($notr == 0) { - mysql_query('UPDATE `stats` SET `last_pr` = "' . $pl['id'] . '" WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'); - - // - if ($this->ue['id'] > 0) { - $btl->priemsRazmen([$this->u->info['id'], $this->ue['id']], 'fast'); - mysql_query('UPDATE `eff_users` SET `mark` = 1 WHERE `uid` = "' . $this->ue['id'] . '" AND `delete` = 0'); - } else { - $btl->priemsRazmen([$this->u->info['id'], $this->u->info['enemy']], 'fast'); - mysql_query('UPDATE `eff_users` SET `mark` = 1 WHERE `uid` = "' . $this->u->info['enemy'] . '" AND `delete` = 0'); - } - mysql_query('UPDATE `eff_users` SET `mark` = 1 WHERE `uid` = "' . $this->u->info['id'] . '" AND `delete` = 0'); - - if (file_exists('../../_incl_data/class/priem/' . $pl['id'] . '.php')) { - require('../../_incl_data/class/priem/' . $pl['id'] . '.php'); - $this->testDie($this->ue['id']); - } else { - echo 'useSkill' . $pl['id']; - } - - if (!isset($cup)) { - $this->uppz($pl, $id); - // - //$this->mintr($pl); - if ($pl['tr_hod'] > 0) { - $this->trhod($pl); - } - if ($pl['id'] != 258) { - if ($pl['cancel_eff'] == '') { - $pl['cancel_eff'] = '258'; - } else { - $pl['cancel_eff'] .= ',258'; - } - } - if ($pl['cancel_eff'] != '') { - $i = 0; - $e = explode(',', $pl['cancel_eff']); - while ($i < count($e)) { - if ($e[$i] > 0) { - if ($e[$i] == 258) { - $nem = mysql_fetch_assoc(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $this->u->info['id'] . '" AND `v1` = "priem" AND `v2` = "' . $e[$i] . '" AND `delete` = "0" AND `mark` = 1 LIMIT 1')); - } else { - $nem = mysql_fetch_assoc(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $this->ue['id'] . '" AND `v1` = "priem" AND `v2` = "' . $e[$i] . '" AND `delete` = "0" AND `mark` = 1 LIMIT 1')); - } - if (isset($nem['id'])) { - $nem['priem'] = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $e[$i] . '" LIMIT 1')); - if (isset($nem['id'])) { - $btl->delPriem($nem, $btl->users[$btl->uids[$this->ue['id']]], 500); - } - } - } - $i++; - } - } - } - } - } - } - } - } - - private function rezadEff($uid, $mg) - { - global $u, $btl, $c, $code; - //$this->rezadEff($this->u->info['id'],'wis_fire_'); - $md = ''; - $md2 = ''; - $ex = explode('|', $btl->users[$btl->uids[$uid]]['priems']); - $ex2 = explode('|', $btl->users[$btl->uids[$uid]]['priems_z']); - $i = 0; - $ty = []; - while ($i < count($ex)) { - if ($ex[$i] > 0) { - $md .= '`id` = "' . ((int)$ex[$i]) . '" OR '; - $ty[$ex[$i]] = $i; - } - $i++; - } - $md = rtrim($md, ' OR '); - if ($md != '') { - $md = '( ' . $md . ' ) AND '; - } - $sp = mysql_query('SELECT * FROM `priems` WHERE ' . $md . ' `img` LIKE "%' . $mg . '%"'); - while ($pl = mysql_fetch_assoc($sp)) { - $ex2[$ty[$pl['id']]] = 0; - } - $md2 = implode('|', $ex2); - $btl->users[$btl->uids[$uid]]['priems_z'] = $md2; - $this->u->info['priems_z'] = $md2; - $upd = mysql_query('UPDATE `stats` SET `priems_z` = "' . $md2 . '" WHERE `id` = "' . ((int)$uid) . '" LIMIT 1'); - unset($md, $md2, $ty); - return $upd; - } - - private function trhod($pl) - { - global $u, $btl; - if ($this->u->info['notrhod'] == -1) { - $this->u->info['notrhod'] = 0; - if ($this->u->stats['magic_cast'] > 0) { - $this->u->info['notrhod'] = $this->u->stats['magic_cast']; - } - mysql_query('UPDATE `users` SET `notrhod` = "' . $this->u->info['notrhod'] . '" WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'); - } - if ($this->u->info['notrhod'] > 0) { - if ($pl['tr_hod'] > 0) { - $this->u->info['notrhod']--; - mysql_query('UPDATE `users` SET `notrhod` = "' . $this->u->info['notrhod'] . '" WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'); - } - } else { - $a1 = mysql_fetch_assoc(mysql_query('SELECT * FROM `battle_act` WHERE `battle` = "' . $btl->info['id'] . '" AND `uid2` = "' . $this->u->info['id'] . '" AND `uid1` = "' . $this->u->info['enemy'] . '" LIMIT 1')); - if (isset($a1['id'])) { - // , 2 - mysql_query('UPDATE `battle_act` SET `out2` = "1",`tpo2` = "2" WHERE `id` = "' . $a1['id'] . '" LIMIT 1'); - $a1['out2'] = 1; - $a1['tpo2'] = 2; - $btl->atacks[$a1['id']] = $a1; - $btl->users[$this->u->info['id']]['priems_z'] = $this->u->info['priems_z']; - $btl->startAtack($a1['id']); - } else { - // - mysql_query('INSERT INTO `battle_act` (`battle`,`uid1`,`uid2`,`time`,`out1`,`type`,`tpo1`) VALUES ("' . $btl->info['id'] . '","' . $this->u->info['id'] . '","' . $this->u->info['enemy'] . '","' . time() . '","1","1","2")'); - } - } - } - - public function plusData($d1, $d2) - { - global $u; - $j1 = $this->lookStatsArray($d1); - $j2 = $this->lookStatsArray($this->redate($d2, $this->u->info['id'])); - $v = $this->u->lookKeys($this->redate($d2, $this->u->info['id']), 0); // 2 - // - $i = 0; - $inf = ''; - while ($i < count($v)) { - $j1[$v[$i]] += $j2[$v[$i]]; - $vi = str_replace('add_', '', $v[$i]); - if ($this->u->is[$vi] != '') { - if ($j2[$v[$i]] > 0) { - $inf .= $this->u->is[$vi] . ': +' . ($j2[$v[$i]] * (1 + $mpr['x'])) . ', '; - } elseif ($j2[$v[$i]] < 0) { - $inf .= $this->u->is[$vi] . ': ' . ($j2[$v[$i]] * (1 + $mpr['x'])) . ', '; - } - } - $i++; - } - $inf = rtrim($inf, ', '); - $j1 = $this->u->impStats($j1); - return $j1; - } - - private function addEffPr($pl, $id) - { - global $u, $btl; - $rcu = false; - $j = $this->lookStatsArray($pl['date2']); - $mpr = false; - $addch = 0; - $uid = $this->u->info['id']; - if (isset($this->ue['id'])) { - $uid = $this->ue['id']; - } - if (isset($j['onlyOne'])) { - $mpr = Db::getRow('select * from eff_users where v2 = ? and uid = ? and `delete` = 0 and mark = 1', - [$pl['id'], $uid]); - //$mpr = mysql_fetch_assoc(mysql_query('SELECT * FROM `eff_users` WHERE `v2` = "' . $pl['id'] . '" AND `uid` = "' . $uid . '" AND `delete` = "0" AND `mark` = 1 LIMIT 1')); - } - -// if ($pl['cancel_eff2'] != '') { -// $i = 0; -// $e = explode(',', $pl['cancel_eff2']); -// while ($i < count($e)) { -// if ($e[$i] > 0) { -// $nem = mysql_fetch_assoc(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $uid . '" AND `v1` = "priem" AND `v2` = "' . $e[$i] . '" AND `delete` = "0" AND `mark` = 1 LIMIT 1')); -// if (isset($nem['id'])) { -// $nem['priem'] = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $e[$i] . '" LIMIT 1')); -// if (isset($nem['id'])) { -// $btl->delPriem($nem, $btl->users[$btl->uids[$uid]], 2); -// if ($nem['id'] == $mpr['id']) { -// unset($mpr); -// } -// } -// } -// } -// $i++; -// } -// } - - if (!empty($pl['cancel_eff2'])) { - $this->cancelEffects($pl['cancel_eff2'], $uid, $btl); - } - - $pld = [0 => '']; - $nc = 0; - if (isset($mpr['id']) && $j['onlyOne'] == 1) { - // - $addch = 1; - $this->mintr($pl); - $this->uppz($pl, $id); - // - if (isset($this->ue['id'])) { - $btl->stats[$btl->uids[$uid]] = $this->u->getStats($this->ue, 0); - } else { - $btl->stats[$btl->uids[$uid]] = $this->u->getStats($this->u->info, 0); - } - $nc = 1; - } elseif (!isset($mpr['id'])) { - $data = ''; - if (isset($j['date3Plus'])) { - $data = $this->redate($pl['date3'], $this->u->info['id']); - } - - $hd1 = -1; - if ($pl['limit'] > 0) { - $tm = 77; - $hd1 = $pl['limit']; - } else { - $tm = 77; - } - if ($pl['limit'] == -2) { - $hd1 = $pl['limit']; - } - if ($pl['id'] == 239) // - { - $btl->priemAddLogFast($uid, 0, $pl['name'], - '{tm' . $this->u->info['team'] . '} ' . $btl->addlt(1, 17, $btl->users[$btl->uids[$uid]]['sex'], - null) . '', - 1, time()); - } - - $uu = $pl['id'] === 260 ? '' : $this->u->info['id']; - Db::sql('insert into eff_users (hod, v1, v2, img2, id_eff, uid, name, data, overType, timeUse, user_use) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', - [$hd1, 'priem', $pl['id'], $pl['img'] . '.gif', 22, $uid, $pl['name'], $data, 0, $tm, $uu]); - - unset($hd1, $uu); - // - $addch = 1; - $rcu = true; - $nc = 1; - $this->mintr($pl); - //$this->uppz($pl,$id); - // - if (isset($this->ue['id'])) { - $btl->stats[$btl->uids[$uid]] = $this->u->getStats($this->ue, 0); - } else { - $btl->stats[$btl->uids[$uid]] = $this->u->getStats($this->u->info, 0); - } - } elseif ($j['onlyOne'] > 1) { - if ($mpr['x'] < $j['onlyOne'] && isset($j['date3Plus'])) { - $j1 = $this->lookStatsArray($mpr['data']); - $j2 = $this->lookStatsArray($this->redate($pl['date3'], $this->u->info['id'])); - $v = $this->u->lookKeys($this->redate($pl['date3'], $this->u->info['id']), 0); // 2 - // - $i = 0; - $inf = ''; - while ($i < count($v)) { - $j1[$v[$i]] += $j2[$v[$i]]; - $vi = str_replace('add_', '', $v[$i]); - if ($this->u->is[$vi] != '') { - if ($j2[$v[$i]] > 0) { - $inf .= $this->u->is[$vi] . ': +' . ($j2[$v[$i]] * (1 + $mpr['x'])) . ', '; - } elseif ($j2[$v[$i]] < 0) { - $inf .= $this->u->is[$vi] . ': ' . ($j2[$v[$i]] * (1 + $mpr['x'])) . ', '; - } - } - $i++; - } - $inf = rtrim($inf, ', '); - $j1 = $this->u->impStats($j1); - $pld[0] = ' x' . ($mpr['x'] + 1); - if ($j['refHod'] == 1) { - $mpr['hod'] = $pl['limit']; - } - $upd = mysql_query('UPDATE `eff_users` SET `hod` = "' . $mpr['hod'] . '",`data` = "' . $j1 . '",`x` = `x`+1 WHERE `id` = "' . $mpr['id'] . '" LIMIT 1'); - if ($upd) { - // - $this->mintr($pl); - $this->uppz($pl, $id); - // - if (isset($this->ue['id'])) { - $btl->stats[$btl->uids[$uid]] = $this->u->getStats($this->ue, 0); - } else { - $btl->stats[$btl->uids[$uid]] = $this->u->getStats($this->u->info, 0); - } - $addch = 1; - $rcu = true; - $nc = 1; - } - } - } - /* */ - if ($nc == 1 && $pl['tr_hod'] > 0) { - $this->trhod($pl); - } - //return $rcu; - } - - public function mintr($pl) - { - global $u, $btl; - $x = 1; - $rt = ''; - while ($x <= 7) { - if ($pl['ndt' . $x] == 0) { - $this->u->info['tactic' . $x] -= $pl['tt' . $x]; - $btl->users[$btl->uids[$this->u->info['id']]]['tactic' . $x] -= $pl['tt' . $x]; - } - if ($this->u->info['tactic' . $x] < 0) { - $this->u->info['tactic' . $x] = 0; - } - if ($btl->users[$btl->uids[$this->u->info['id']]]['tactic' . $x] < 0) { - $btl->users[$btl->uids[$this->u->info['id']]]['tactic' . $x] = 0; - } - //$rt .= ',`tactic'.$x.'`="'.$this->u->info['tactic'.$x].'"'; - $rt .= ',`tactic' . $x . '`="' . $btl->users[$btl->uids[$this->u->info['id']]]['tactic' . $x] . '"'; - $x++; - } - if ($pl['xuse'] > 0) { - $this->u->addAction(time(), 'use_priem_' . $btl->info['id'] . '_' . $this->u->info['id'], $pl['id']); - } - $rt = ltrim($rt, ','); - mysql_query('UPDATE `stats` SET ' . $rt . ' WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'); - } - - public function maxtr($x, $val) - { - global $u, $btl; - $this->u->info['tactic' . $x] += $val; - $btl->users[$btl->uids[$this->u->info['id']]]['tactic' . $x] += $val; - if ($this->u->info['tactic' . $x] < 0) { - $this->u->info['tactic' . $x] = 0; - } - if ($btl->users[$btl->uids[$this->u->info['id']]]['tactic' . $x] < 0) { - $btl->users[$btl->uids[$this->u->info['id']]]['tactic' . $x] = 0; - } - $rt = '`tactic' . $x . '`="' . $this->u->info['tactic' . $x] . '"'; - mysql_query('UPDATE `stats` SET ' . $rt . ' WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'); - } - - private function actpridMax($pl) - { - global $u, $btl; - if ($pl['actprid2'] > 0 || $pl['actprid3'] > 0) { - $i = 0; - $pe = explode('|', $this->u->info['priems']); - $piz = []; - while ($i < count($pe)) { - if ($pl['sbr'] == 0) { - // - $psp = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . ((int)$pe[$i]) . '" LIMIT 1')); - } else { - // - $imgnm = ''; - $nm = explode('_', $pl['img']); - if ($nm[0] == 'wis') { // - $imgnm = $nm[0] . '_' . $nm[1] . '%'; - } else { - $imgnm = $nm[0] . '%'; - } - // - $psp = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . ((int)$pe[$i]) . '" AND `img` LIKE "' . $imgnm . '" LIMIT 1')); - } - if ($pl['noprid'] == 0 && isset($psp['id']) && $psp['tr_hod'] == 0 && $psp['type_pr'] == 1 && $psp['noprid'] == 0) { - if ($pl['actprid2'] > 0) { - $piz[$pe[$i]] = (int)$pl['actprid2']; - } elseif ($pl['actprid3'] > 0) { - $piz[$pe[$i]] = $psp['zad']; - } - } - $i++; - } - $pz = explode('|', $this->u->info['priems_z']); - $p = explode('|', $this->u->info['priems']); - $i = 0; - while ($i < count($p)) { - if ($p[$i] > 0 && isset($piz[$p[$i]]) && $pz[$i] == 0) { - $pz[$i] = $piz[$p[$i]]; - } - $i++; - } - $pz = implode('|', $pz); - $this->u->info['priems_z'] = $pz; - $btl->users[$btl->uids[$this->u->info['id']]]['priems_z'] = $pz; - $btl->stats[$btl->uids[$this->u->info['id']]]['priems_z'] = $pz; - } - } - - public function uppz($pl, $id) - { - global $u, $btl; - $this->actpridMax($pl); - $p = explode('|', $this->u->info['priems']); - $pz = explode('|', $this->u->info['priems_z']); - $pz[(int)$id] = $pl['zad']; - $i = 0; - $pe = explode(',', $pl['actprid']); - $piz = []; - while ($i < count($pe)) { - $piz[$pe[$i]] = 1; - $i++; - } - $i = 0; - $pe = explode(',', $pl['actprid_one']); - $piz2 = []; - while ($i < count($pe)) { - $piz2[$pe[$i]] = 1; - $i++; - } - $i = 0; - while ($i < count($p)) { - if ($p[$i] > 0) { - if (isset($piz[$p[$i]])) { - if ($pl['id'] == 281) { - // + 5 . - if ($p[$i] == 246 || $p[$i] == 186) { - $pz[$i] = 5; - } else { - $pz[$i] = $pl['zad']; - } - } else { - $pz[$i] = $pl['zad']; - } - } - if (isset($piz2[$p[$i]]) && $pz[$i] == 0) { - $pz[$i] = 1; - } - } - $i++; - } - $pz = implode('|', $pz); - $this->u->info['priems_z'] = $pz; - $btl->users[$btl->uids[$this->u->info['id']]]['priems_z'] = $pz; - $btl->stats[$btl->uids[$this->u->info['id']]]['priems_z'] = $pz; - $tr = $this->lookStatsArray($pl['tr']); - if (isset($tr['tr_mpNow'])) { - $tr['tr_mpNow'] = round($tr['tr_mpNow'] / 100 * (100 - $this->u->stats['min_use_mp'])); - $btl->users[$btl->uids[$this->u->info['id']]]['mpNow'] -= $tr['tr_mpNow']; - $btl->stats[$btl->uids[$this->u->info['id']]]['mpNow'] -= $tr['tr_mpNow']; - if ($btl->stats[$btl->uids[$this->u->info['id']]]['mpNow'] < $btl->users[$btl->uids[$this->u->info['id']]]['mpNow']) { - $btl->users[$btl->uids[$this->u->info['id']]]['mpNow'] = $btl->stats[$btl->uids[$this->u->info['id']]]['mpNow']; - } - } - $this->u->info['mpNow'] = $btl->users[$btl->uids[$this->u->info['id']]]['mpNow']; - mysql_query('UPDATE `stats` SET `mpNow` = "' . $this->u->info['mpNow'] . '",`priems_z` = "' . $pz . '" WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'); - } - - public function reuns($id) - { - global $u, $c, $code; - $p = explode('|', $this->u->info['priems']); - if ($p[(int)$id] > 0) { - // - $p[(int)$id] = 0; - $p = implode('|', $p); - mysql_query('UPDATE `stats` SET `priems` = "' . mysql_real_escape_string($p) . '" WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'); - $this->u->info['priems'] = $p; - } - } - - /** ? - * @param $id - * @return void - */ - public function uns($id) - { - global $u, $c, $code; - $pl = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `level`<="' . $this->u->info['level'] . '" AND `activ` > "0" AND `id` = "' . $id . '" LIMIT 1')); - if (!isset($pl['id']) || $this->testpriem($pl, 1) != 0) { - return; - } - $yes = -1; - $non = -1; - $i = 0; - $p = explode('|', $this->u->info['priems']); - while ($i < $this->u->info['priemslot']) { - if ($non == -1 && $p[$i] == 0) { - $non = $i; - } - if ($p[$i] == $pl['id']) { - $yes = $i; - } - $i++; - } - - if ($yes != -1) { - // , - return; - } - if ($non != -1) { - // - $p[$non] = $pl['id']; - $p = implode('|', $p); - $upd = mysql_query('UPDATE `stats` SET `priems` = "' . $p . '" WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'); - if ($upd) { - $this->u->info['priems'] = $p; - } - } else { - // - echo ' ...'; - } - } - - // $id - 1 ( ), 2 - - public function seeMy($t) - { - global $u, $c, $code, $btl; - $i = 0; - $p = explode('|', $this->u->info['priems']); - $lvar = ''; - $pr = ''; - while ($i < $this->u->info['priemslot']) { - if ($p[$i] > 0) { - $pl = mysql_fetch_assoc(mysql_query('SELECT * FROM `priems` WHERE `level`<="' . $this->u->info['level'] . '" AND `activ` > "0" AND `id` = "' . mysql_real_escape_string($p[$i]) . '" LIMIT 1')); - $lvar = $this->priemInfo($pl, $t, $i); - $pz = $lvar[1]; - $lvar = $lvar[0]; - if ($t == 1) { - if (isset($_GET['inv'])) { - //$cl = 'href="main.php?skills=1&rz=4"'; - $cl = 'href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&rz=4&p_raz=all\'"'; - } else { - //$cl = 'href="main.php?skills=1&rz=4&unuse_priem='.$i.'&rnd='.$code.'"'; - $cl = 'href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&unuse_priem=' . $i . '&rz=4&p_raz=\' + p_raz"'; - } - } else { - if ($pl['type'] == 1) { - // - if ($pl['onUser'] == 1) { - $oninuser = ''; - if ($pl['team'] == 1) { - if ($this->u->info['login2'] != '') { - $oninuser = $this->u->info['login2']; - } else { - $oninuser = $this->u->info['login']; - } - } else { - if ($btl->users[$btl->uids[$this->u->info['enemy']]]['login2'] != '') { - $oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login2']; - } else { - $oninuser = $btl->users[$btl->uids[$this->u->info['enemy']]]['login']; - } - } - $cl = 'href="javascript:void(0);" onClick="top.priemOnUser(' . $i . ',1,\'' . $pl['name'] . '\',\'' . $oninuser . '\',\'' . $pl['img'] . '\');"'; - unset($oninuser); - } else { - $cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"'; - } - } elseif ($pl['type'] == 2) { - // - $cl = 'href="javascript:void(0);" onClick="usepriem(' . $i . ',1,\'' . $pl['img'] . '\');"'; - } elseif ($pl['type'] == 3) { - $cl = 'href="javascript:void(0);" onClick="alert(\' ?\');"'; - } - } - - - $notr = $this->testpriem($pl, $t); - - - $cl2 = ''; - $cli2 = ''; - if ((($pz[$i] > 0 || $notr > 0) && $t == 2) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || $this->u->stats['notuse_last_pr'] == $pl['id']) { - //$cl2 = 'filter: alpha(opacity=15); -moz-opacity: 0.15; -khtml-opacity: 0.15; opacity: 0.15;'; - $cli2 = ' class="nopriemuse" '; - } - - $pr .= ''; - } else { - //if($t==1) - //{ - if (isset($_GET['inv'])) { - $pr .= ''; - } else { - $pr .= ''; - } - //} - } - $i++; - } - if ($this->u->info['animal'] > 0 && $t == 2) { - $use_lst = $this->u->testAction('`uid` = "' . $this->u->info['id'] . '" AND `vars` = "animal_use' . $btl->info['id'] . '" LIMIT 1', - 1); - if (!isset($use_lst['id'])) { - $cl2 = ''; - $pr .= ''; - } else { - $cl2 = '" class="nopriemuse'; - $pr .= ''; - } - } - if ($t == 1) { - echo '
    ' . $pr . '
    '; - } elseif ($t == 2) { - return str_replace('"', '\\"', $pr); - } - } - - public function testpriem($pl, $t = 1, $o = 0) - { - global $c, $u, $code, $btl; - $tr = $this->lookStatsArray($pl['tr']); - $d2 = $this->lookStatsArray($pl['date2']); - $x = 1; - $notr = 0; - - if ($t == 2 && $pl['id'] == 181) { - $imun = mysql_fetch_assoc(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $this->u->info['enemy'] . '" and `v2`="191" and `delete`="0" LIMIT 1')); - if ($imun) { - $notr++; - } - } - - if (isset($btl->stats[$btl->uids[$this->u->info['id']]]['nousepriem']) && $btl->stats[$btl->uids[$this->u->info['id']]]['nousepriem'] > 0 && $pl['nosh'] == 0) { - if ($btl->stats[$btl->uids[$this->u->info['id']]]['noshock_voda'] > 0 && substr($pl['img'], 0, - 10) == 'wis_water_') { - // - } else { - $notr++; - } - } - - if ($pl['id'] == $btl->stats[$btl->uids[$this->u->info['id']]]['notuse_last_pr']) { - $notr++; - } - - while ($x <= 7) { - if (isset($btl->uids[$this->u->info['id']], $btl->users[$btl->uids[$this->u->info['id']]])) { - if ($btl->users[$btl->uids[$this->u->info['id']]]['tactic' . $x] < $pl['tt' . $x] && $x != 7 && $pl['tt' . $x] > 0) { - $notr++; - } elseif ($x == 7) { - if ($pl['tt' . $x] > 0 && $btl->users[$btl->uids[$this->u->info['id']]]['tactic' . $x] <= 0) { - $notr++; - } - } - } - $x++; - } - - - if ($pl['xuse'] > 0) { - $xu = $this->u->testAction('`vars` = "use_priem_' . $btl->info['id'] . '_' . $this->u->info['id'] . '" AND `vals` = "' . $pl['id'] . '" LIMIT ' . $pl['xuse'] . '', - 2); - if ($xu[0] >= $pl['xuse']) { - $notr++; - } - } - - $x = 0; - $t = $this->u->items['tr']; - while ($x < count($t)) { - $n = $t[$x]; - if (isset($tr['tr_' . $n])) { - if ($n == 'lvl') { - if ($tr['tr_' . $n] > $this->u->info['level']) { - $notr++; - } - } elseif ($tr['tr_' . $n] > $this->u->stats[$n]) { - $notr++; - } - } - $x++; - } - - - if ($pl['activ'] == 0 || ($this->testActiv($pl['activ']) == 0 && $pl['activ'] > 1)) { - $notr++; - } - - - //if($t==2) - //{ - if (isset($d2['onlyOne']) || isset($d2['onlyOneX1'])) { - if (isset($d2['onlyOneX1'])) { - if ($d2['onlyOneX1'] == 1) { - $pru = mysql_fetch_assoc(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $this->u->info['id'] . '" AND `v2` = "' . $pl['id'] . '" AND `delete` = "0" AND `x` >= 1 LIMIT 1')); - if (isset($pru['id']) && $pru['x'] >= $d2['onlyOne']) { - $notr++; - } - } - } elseif (isset($d2['onlyOne'])) { - if ($d2['onlyOne'] > 1) { - $pru = mysql_fetch_assoc(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $this->u->info['id'] . '" AND `v2` = "' . $pl['id'] . '" AND `delete` = "0" AND `x` > 1 LIMIT 1')); - if (isset($pru['id']) && $pru['x'] >= $d2['onlyOne']) { - $notr++; - } - } - } - } - - // - if (isset($tr['tr_nousepriem'])) { - $x = 0; - $nouse = explode(',', $tr['tr_nousepriem']); - while ($x < count($nouse)) { - $nousev = explode('.', $nouse[$x]); - if (isset($btl->stats[$btl->uids[$this->u->info['id']]]['prsu'][$nousev[0]]) && $btl->stats[$btl->uids[$this->u->info['id']]]['prsu'][$nousev[0]] >= 0) { - if ($nousev[2] > 1) { - if ($nousev[2] <= $btl->stats[$btl->uids[$this->u->info['id']]]['prsu'][$nousev[0]]) { - $notr++; - } - } else { - $notr++; - } - } - $x++; - } - unset($nouse, $nousev); - } - - if (isset($tr['tr_type_itm1'])) { - // - $itmt = mysql_fetch_assoc(mysql_query('SELECT `u`.`id` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `u`.`item_id` WHERE `m`.`type` = "' . $tr['tr_type_itm1'] . '" AND `u`.`inOdet` > 0 AND `u`.`uid` = "' . $this->u->info['id'] . '" AND `u`.`delete` = "0" LIMIT 1')); - if (!isset($itmt['id'])) { - $notr++; - } - } - - if (isset($tr['tr_mpNow'])) { - if (isset($btl->stats[$btl->uids[$this->u->info['id']]])) { - if ($btl->stats[$btl->uids[$this->u->info['id']]]['mpNow'] < round($tr['tr_mpNow'] / 100 * (100 - $btl->stats[$btl->uids[$this->u->info['id']]]['min_use_mp']))) { - $notr++; - } - } elseif ($this->u->info['mpNow'] < $tr['tr_mpNow']) { - $notr++; - } - } - - if (isset($btl->uids[$this->u->info['id']], $btl->stats[$btl->uids[$this->u->info['id']]])) { - if ($pl['trUser'] == 1) { - // - ( ) - if (isset($btl->ga[$this->u->info['id']][$this->u->info['enemy']])) { - $notr++; - } - } elseif ($pl['trUser'] == 2 && $o > 0) { - // - ( , ) - $ga = mysql_fetch_assoc(mysql_query('SELECT * FROM `battle_act` WHERE `battle` = "' . $btl->info['id'] . '" AND `uid1` = "' . $this->u->info['id'] . '" AND `uid2` = "' . $btl->users[$btl->uids[$this->u->info['id']]]['enemy'] . '" LIMIT 1')); - if (isset($ga['id'])) { - $notr++; - } - } - } - - return $notr; - } - - public function priemInfo($pl, $t, $id = false) - { - global $u, $c, $code, $btl; - $pz = explode('|', $this->u->info['priems_z']); - $tr = $this->lookStatsArray($pl['tr']); - $trs = ''; - $x = 0; - $notr = 0; - $t = $this->u->items['tr']; - while ($x < count($t)) { - $n = $t[$x]; - if (isset($tr['tr_' . $n])) { - if ($tr['tr_' . $n] > $this->u->stats[$n]) { - $trs .= ''; - $notr++; - } - $trs .= '
    '; - $trs .= $this->u->is[$n] . ': ' . $tr['tr_' . $n]; - if ($tr['tr_' . $n] > $this->u->stats[$n]) { - $trs .= '
    '; - } - } - $x++; - } - - $lvar = ''; - $j = 1; - $nm = [1 => 'hit', 2 => 'krit', 3 => 'counter', 4 => 'block', 5 => 'parry', 6 => 'hp', 7 => 'spirit']; - while ($j <= 6) { - if ($pl['tt' . $j] > 0) { - $lvar .= ' ' . round($pl['tt' . $j], - 2) . '   '; - } - $j++; - } - if ($pl['tt7'] > 0) { - if ($lvar != '') { - $lvar .= '
    '; - } - $lvar .= ' : ' . round($pl['tt' . $j], 2) . '
    '; - } - $lvar .= '
    '; - if ($pl['zad'] > 0) { - $lvar .= ': ' . $pl['zad']; - if ($pz[$id] > 0) { - $lvar .= ' ( ' . $pz[$id] . ')'; - } - $lvar .= '
    '; - } - if (isset($tr['tr_mpNow']) && $tr['tr_mpNow'] > 0) { - $tr['tr_mpNow'] -= round($tr['tr_mpNow'] / 100 * $this->u->stats['min_use_mp']); - if ($this->u->info['mpNow'] < $tr['tr_mpNow'] || (isset($btl->stats[$btl->uids[$this->u->info['id']]]) && $btl->stats[$btl->uids[$this->u->info['id']]]['mpNow'] < $tr['tr_mpNow'])) { - $lvar .= ' : ' . $tr['tr_mpNow'] . '
    '; - } else { - $lvar .= ' : ' . $tr['tr_mpNow'] . '
    '; - } - } - if ($pl['tr_hod'] > 0) { - $lvar .= '
    '; - } - if ($trs != '') { - $lvar .= ':' . $trs . '

    '; - } else { - $lvar .= '
    '; - } - $pl['info'] = preg_replace("!(\#)(.*?)(\#)!ise", - "getdr('\\2',array(0=>'lvl1',1=>'ts5',2=>'mpAll'),array(0=>'" . $this->u->info['level'] . "',1=>'" . $this->u->stats['s5'] . "',2=>'" . $this->u->stats['mpAll'] . "'))", - $pl['info']); - $lvar .= $pl['info']; - $lvar = [0 => $lvar, 1 => $pz]; - return $lvar; - } - - // / / .. - public function testPower($s1, $s2, $y, $t, $t2) - { - global $u, $btl; - - $r = 0; - if ($t2 == 2) { - // - $pm = [0 => 0, 1 => 0, 2 => 0, 3 => 0]; - if ($t < 5) { - $pm[0] = $s1['m11']; - $pm[1] = $s2['zm']; - $pm[2] = $s2['antm11']; - } - - if (isset($btl->info['id'])) { - $pm[3] = $btl->zmgo($s2['zm' . $t]); - $pm[3] = round($pm[3]); - } - - // = b*(1+m/100)*2^((p*10-z)/k) - $fx_vl = [ - 250, - 250, - 250, - 250, - 250, - 250, - 250, - 250, - 250, - 350, - 400, - 450, - 500, - 550, - 600, - 650, - 700, - 750, - 800, - 850, - 900, - 950, - ]; - - $fx = [ - 'b' => $y, // - 'm' => round($s1['pm' . $t] * 1 - $s2['antpm' . $t]), // - 'z' => round($s2['zm' . $t]), // . - 'p' => round(($s1['pzm'] + $s1['pzm' . $t])), // - 'k' => $fx_vl[(0 + $s1['lvl'])] // ; k=250 8, k=300 9 .. +20% - ]; - if (($fx['z'] + 250) - $fx['p'] * 10 < 0) { // , 250 . - $fx['p'] = ($fx['z'] + 250) / 10; - } - $fx['p'] = 0; - // - $p = $fx['b'] * (1 + $fx['m'] / 100) * pow(2, (($fx['z'] - $fx['p'] * 10) / $fx['k'])); - //$p += $p/100*10; - $p -= $p / 100 * $pm[3]; - //$p += floor($s1['s5']*0.25); - - if ($p < round($y * 0.1)) { - $p = round($y * 0.1); - } elseif ($p > round($y * 10)) { - $p = $y * 10; - } - - if (isset($s2['zm' . $t . 'proc'])) // () - { - $p = floor($p / 100 * (100 - $s2['zm' . $t . 'proc'])); - if ($p < 0) { - $p = 0; - } - } - if (isset($s2['zmproc'])) // () - { - if ($s2['zmproc'] >= 75) { - $p = floor($p / 100 * (100 - 75)); - } else { - $p = floor($p / 100 * (100 - $s2['zmproc'])); - if ($p < 0) { - $p = 0; - } - } - } - $r = $p; - } - - return round($r / 100 * 70); - } - - private function pyes($id) - { - global $u; - $p = explode('|', $this->u->info['priems']); - $r = false; - $i = 0; - while ($i < count($p)) { - if ($p[$i] == $id) { - $r = true; - } - $i++; - } - return $r; - } - - // - 1, - 2 - public function seePriems($mt) - { - global $u, $c, $code; - $t = $this->u->items['tr']; - $nm = [1 => 'hit', 2 => 'krit', 3 => 'counter', 4 => 'block', 5 => 'parry', 6 => 'hp', 7 => 'spirit']; - $lvlfe = $this->u->info['level']; - if (isset($_GET['all'])) { - $lvlfe = 21; - } - $sp = mysql_query('SELECT * FROM `priems` WHERE `level`<="' . $lvlfe . '" AND `activ` > "0" ORDER BY `img`,`level` ASC'); - $this->u->info['lvl'] = $this->u->info['level']; - $lvar = ''; - while ($pl = mysql_fetch_assoc($sp)) { - $noaki = 0; - if ($pl['activ'] == 1 || $this->testActiv($pl['activ']) == 1) { - $lvar = $this->priemInfo($pl, 1); - $lvar = $lvar[0]; - $cl = ''; - $a1 = ''; - $a2 = ''; - - //$cl = 'href="javascript:void(0)" onclick="location.href=\'main.php?skills=1&unuse_priem='.$i.'&rz=4&p_raz=\' + p_raz"'; - $a1 = ''; - $a2 = ''; - - if ($this->pyes($pl['id']) || $this->testpriem($pl, 1) > 0) { - if ((isset($_GET['all']) && $_GET['all'] == 1) || $this->pyes($pl['id'])) { - $cl = 'filter: alpha(opacity=35); -moz-opacity: 0.35; -khtml-opacity: 0.35; opacity: 0.35;'; - $a1 = ''; - $a2 = ''; - } else { - $noaki = 1; - } - } - if ($noaki == 0) { - $mtnu = explode('_', $pl['img']); - if ($mtnu[0] != 'wis') { - $mtnu = $mtnu[0]; - } else { - $mtnu = 'wis_' . $mtnu[1]; - } - echo $a1 . '' . $a2; - } - } - } - } - - private function zeromax($num, $max) - { - if ($num <= 0) { - return 0; - } - if ($num > $max) { - $num = $max; - } - return $num; - } - - /** : . - * : 34, 67, 68, 69. - * @param $level - * @param battleClass $btl - * @param $id - * pruse() . - * @return void - */ - private function fireFlash($level, battleClass $btl, $id) - { - if (empty($this->ue) || $this->ue['hpNow'] <= 0 || $btl->users[$this->ue['id']]['team'] == $this->u->info['team']) { - return; - } - - $baseDamage = [8 => 40, 9 => 45, 10 => 50, 11 => 60]; - $pvr = []; - $magicTargetTier = Db::getValue('select x from eff_users where uid = ? and v2 = 26 and `delete` = 0', - [$this->ue['id']]); - $leveledDamage = $baseDamage[$level] + 40 / 100 * (5 * $magicTargetTier); - - list($damage, $isCrit, $isMiss) = $this->magicAttack($btl, $this->u->info['id'], $this->ue['id'], $leveledDamage, self::FIRE, 1); - // - $damage = $btl->testYronPriem($this->u->info['id'], $this->ue['id'], 21, $damage, 5, - true); - $btl->priemYronSave($this->u->info['id'], $this->ue['id'], $damage, 0); - - $this->ue['hpNow'] -= $damage; - $this->ue['hpNow'] = $this->zeromax($this->ue['hpNow'], $this->ue['hpAll']); - - $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $this->ue['hpNow']; - - Db::sql('update stats set hpNow = ? where id = ?', [$this->ue['hpNow'], $this->ue['id']]); - - if ($isMiss) { - $color = $this->logColor['miss']; - } elseif ($isCrit) { - $color = $this->logColor['crit']; - } else { - $color = $this->logColor[self::FIRE]; - } - $btl->priemAddLog( - $id, - 1, - 2, - $this->u->info['id'], - $this->ue['id'], - " [$level]", - '{tm1}' . sprintf(" %s %s [%d/%d]", - $btl->addlt(1, 19, $this->u->info['sex'], null), - $pvr['color'], - $isMiss ? '--' : -$damage, - (int)$this->ue['hpNow'], - (int)$this->ue['hpAll'] - ), - $btl->hodID + 1); - } - - /** : {} - * : 25, 26, 27, 28. - * @param $element - * @param $pl - * @param $id - * @param battleClass $btl - * @return bool (bool) . - */ - private function magicTarget($element, $pl, $id, battleClass $btl) - { - $data = [ - self::WATER => [25, ''], - self::FIRE => [26, ''], - self::AIR => [27, ''], - self::EARTH => [28, ''], - ]; - if (!in_array($element, array_keys($data)) || empty($this->ue)) { - return false; - } - - $stacked = Db::getRow('select id, x from eff_users where uid = ? and v2 = ? and `delete` = 0', - [$this->ue['id'], $data[$element][0]]); - $stackNumStr = $stacked['x'] > 0 ? $stacked['x'] + 1 : ''; - if ($stacked['x'] >= 5) { - echo " "; - return true; - } - - // . - $this->addEffPr($pl, $id); - - $dataStr = $stacked['x'] > 0 ? Db::getValue('select data from eff_users where id = ?', - [$stacked['id']]) : $pl['date3']; - - // . , . - $effect = " {$data[$element][1]}: " . current($this->lookStatsArray($dataStr)); - $color = $this->logColor[$element]; - - $name = " {$data[$element][1]}"; - if ($stacked['x'] > 0) { - $name .= " x($stackNumStr)"; - } - - $btl->priemAddLog( - $id, - 1, - 2, - $this->u->info['id'], - $this->ue['id'], - "$name", - '{tm1}' . sprintf(" %s. (%s)", - $btl->addlt(1, 19, $this->u->info['sex'], null), $effect), - $btl->hodID); - - return false; - } - - public function devouringFlame($id, $uid, $j_id, battleClass $btl) - { - $a = 0; - $u1 = 0; - $u2 = 0; - // - $uid1 = $btl->atacks[$id]['uid1']; - $uid2 = $btl->atacks[$id]['uid2']; - if ($uid == $uid1) { - $a = 1; - $u1 = $uid1; - $u2 = $uid2; - } elseif ($uid == $uid2) { - $a = 2; - $u1 = $uid2; - $u2 = $uid1; - } - if ($a <= 0) { - return; - }// - $prv['j_priem'] = $btl->stats[$btl->uids[$u1]]['u_priem'][$j_id][0]; - - $pvr['data'] = $this->lookStatsArray($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['data']); - $pName = $btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['name']; - - $pvr['hp'] = $pvr['data']['atgm']; - - $pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']); - $pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll']; - - // - $pvr['hp'] = $btl->testYronPriem($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['user_use'], $u1, 12, $pvr['hp'], 7, true, false, 1); - - $pvr['hpNow'] -= $pvr['hp']; - $btl->priemYronSave($btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['user_use'], $u1, $pvr['hp'], 0); - - if ($pvr['hpNow'] > $pvr['hpAll']) { - $pvr['hpNow'] = $pvr['hpAll']; - } elseif ($pvr['hpNow'] < 0) { - $pvr['hpNow'] = 0; - } - - $btl->stats[$btl->uids[$u1]]['hpNow'] = $pvr['hpNow']; - - //mysql_query('UPDATE `stats` SET `hpNow` = ' . $btl->stats[$btl->uids[$u1]]['hpNow'] . ' WHERE `id` = ' . $u1); - Db::sql('update stats set hpNow = ? where id = ?', [$btl->stats[$btl->uids[$u1]]['hpNow'], $this->ue['id']]); - - $color = $this->logColor[self::FIRE]; - $prv['text'] = '{u2} "{pr}" '; - if ($pvr['promah_type'] == 2) { - $pvr['hp'] = '-'; - } - $prv['text'] .= sprintf("%s [%d/%d]", $color, -$pvr['hp'], $pvr['hpNow'], $pvr['hpAll']); - - $btl->priemAddLog($id, 1, 2, $u2, $u1, "$pName", $prv['text'], ($btl->hodID)); - } - - /** . , . - * 5 . 5 . - * damage 5 (atgm=). - * : 33, 56, 57, 58, 59, 60. - * @param $id - * @param array $pl priems. - - * @param battleClass $btl - * @return void - */ - private function devouringFlameInit($id, array $pl, battleClass $btl) - { - echo $pl['level']; - $baseDamage = [6 => 53, 7 => 63, 8 => 77, 9 => 91, 10 => 110, 11 => 133, ]; - list($damage, , $isMiss) = $this->magicAttack($btl, $this->u->info['id'], $this->ue['id'], $baseDamage[$pl['level']], self::FIRE); - if ($isMiss || $damage <= 0) { - return; - } - - $color = $this->logColor[self::FIRE]; - $logText = '{tm1}' . $btl->addlt(1, 19, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], null) . '.'; - $btl->priemAddLog($id, 1, 2, $this->u->info['id'], $this->ue['id'], "{$pl['name']}", $logText, $btl->hodID + 1); - - $data = $this->impStats(['atgm' => max(floor($damage / 5), 1)]); - - $this->addPriem($this->ue['id'], $pl['id'], $data, 0, 77, 5, $this->u->info['id'], 1, '', 0, 0, 1); - } -} - -$priem = new priems(); - diff --git a/_incl_data/class/bot.logic.php b/_incl_data/class/bot.logic.php deleted file mode 100644 index 2ef37642..00000000 --- a/_incl_data/class/bot.logic.php +++ /dev/null @@ -1,1339 +0,0 @@ - - array( - 'timeout' => 30 - ) - )); - $val = file_get_contents('https://new-combats.com/jx/battle/refresh_bot.php?uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass'].'&'.$txt,false,$ctx); - echo '['.$val.']
    '; - unset( $val ); - } - } - - static function battle_priems() { - - // - if(self::$st['hpNow'] > 0 && self::$bot['battle'] > 0) { - - $pr = explode('|',self::$bot['priems']); - $rz = explode('|',self::$bot['priems_z']); - $i = 0; - while($i < count($pr)) { - if($pr[$i] > 0) { - self::$pr[$pr[$i]] = $rz[$i]; - } - $i++; - } - $i = 0; - while($i < count($pr)) { - if($rz[$i] < 1 && $pr[$i] > 0) { - // , - botPriemLogic::start( $i, $pr[$i] ); - } - $i++; - } - self::$pr = false; - - } - - } - - static function clear_bot() { - - // , [0], , ., delete - - // - mysql_query('DELETE FROM `chat` WHERE `to` = "'.self::$bot['login'].'"'); - // - mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.self::$bot['id'].'"'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.self::$bot['id'].'"'); - - // - mysql_query('DELETE FROM `users` WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `stats` WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `online` WHERE `uid` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `actions` WHERE `uid` = "'.self::$bot['id'].'" LIMIT 1'); - // - //mysql_query('UPDATE `users` SET `login` = "delete",`login2` = `login` WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - //self::createNewBot(self::$bot['login'],self::$bot['sex']); - /* - $ins = mysql_query("INSERT INTO `users` (`fnq`,`id`,`host_reg`,`room`,`login`,`pass`,`ipreg`,`ip`,`city`,`cityreg`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`city_real`,`icq`,`icq_hide`,`deviz`,`chatColor`,`timereg`) VALUES ( - '0', - ".self::$bot['id'].", - '0', - '0', - '".self::$bot['login']."', - '".self::$bot['pass']."', - '0', - '".self::$bot['ip']."', - 'capitalcity', - 'capitalcity', - '0', - '0', - '".self::$bot['mail']."', - '".self::$bot['name']."', - '".self::$bot['bithday']."', - '".self::$bot['sex']."', - '".self::$bot['city_real']."', - '0', - '1', - '".self::$bot['deviz']."', - '".self::$bot['chatColor']."', - '".time()."')"); - if($ins) { - $uid = self::$bot['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')"); - } - */ - } - - static function inuser_go_main( $id , $txt = '' ) { - if(isset($id['id'])) { - $ctx = stream_context_create(array('https'=> - array( - 'timeout' => 1 - ) - )); - file_get_contents('https://new-combats.com/main_bot.php?uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass'].'&'.$txt,false,$ctx); - } - } - - static function inuser_go_zv( $id , $txt = '' ) { - if(isset($id['id'])) { - $ctx = stream_context_create(array('https'=> - array( - 'timeout' => 1 - ) - )); - file_get_contents('https://new-combats.com/main_bot.php?zayvka=1&r=4&uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass'].'&'.$txt,false,$ctx); - } - } - - // - static function test_fr( $id , $city = 'capitalcity' ) { - $r = true; - if( $city == 'capitalcity' ) { - if( $id != 0 && $id != 2 && $id != 4 && $id != 5 && $id != 7 && $id != 377 ) { - $r = false; - } - } - return $r; - } - - // - static function actions() { - - global $u; - - if( self::$bot['battle'] == 0 && self::$bot['zv'] == 0 && self::$bot['pass'] == 'saintlucia' ) { - - //: , , , - - // - if( true == false && self::$bot['a1'] != 0 && self::$bot['a1'] != self::$bot['room'] ) { - - self::_loc( self::$bot['a1'] ); - - }else{ - - self::update('a1',0); - - //CAPITAL - if( self::$bot['city'] == 'capitalcity' ) { - - - if( self::test_fr(self::$bot['room']) == false ) { - - if( self::$bot['exp'] > 400000 && self::$bot['level'] == 8 ) { - self::$bot['exp'] = 400000; - mysql_query('UPDATE `stats` SET `exp` = "400000" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - }elseif( self::$bot['exp'] > 3500000 && self::$bot['level'] == 9 ) { - self::$bot['exp'] = 3500000; - mysql_query('UPDATE `stats` SET `exp` = "3500000" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - } - - // - // - if( self::$bot['room'] == 10 ) { - - // - if( self::$bot['level'] == 5 && self::$bot['exp'] >= 12499) { - $cr = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "1204" AND `uid` = "'.self::$bot['id'].'" AND `delete` = "0" LIMIT 1')); - if( !isset($cr['id']) ) { - // - $u->addItem(1204,self::$bot['id']); - } - } - - } - - // - self::_loc( self::_loc_zv() ); - - }else{ - - // , )) - - - } - - } - //CAPITAL - - } - - // 6- - if( self::$bot['level'] == 5 && self::$bot['exp'] >= 12499 ) { - $cr = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "1204" AND `uid` = "'.self::$bot['id'].'" AND `delete` = "0" LIMIT 1')); - if( !isset($cr['id']) ) { - self::update('a1',10); - } - } - - // )) - if( self::$bot['clss'] == 0 ) { - - // :) - - // - self::$bot['clss'] = rand( 1, 4 ); - - $x = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `a_bot_tree` WHERE `level` = "'.(self::$bot['level']).'" ')); - - if( $x[0] > 0 ) { - - if( $x[0] > 1 ) { - - $x = rand( 1 , $x[0] ); - // 1 - $da = array('ASC','DESC','DESC','ASC'); - $da = $da[rand(0,5)]; - $com = mysql_fetch_array(mysql_query('SELECT * FROM `a_bot_tree` WHERE `level` = "'.(self::$bot['level']).'" ORDER BY `id` '.$da.' LIMIT '.($x-1).',1')); - }else{ - $com = mysql_fetch_array(mysql_query('SELECT * FROM `a_bot_tree` WHERE `level` = "'.(self::$bot['level']).'" LIMIT 1')); - } - - if(!isset($com['id'])) { - - $com = mysql_fetch_array(mysql_query('SELECT * FROM `a_bot_tree` WHERE `level` < "'.(self::$bot['level']).'" ORDER BY `id` DESC LIMIT 1')); - - } - - if(isset($com['id'])) { - - mysql_query('UPDATE `users` SET `clss` = "'.self::$bot['clss'].'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - - /* */ - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `gift` = "" AND `item_id` != "1204" AND `uid` = "'.self::$bot['id'].'" AND `delete` = "0"'); - mysql_query('UPDATE `items_users` SET `iznosNOW` = "0" WHERE `uid` = "'.self::$bot['id'].'" AND `delete` = "0"'); - mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.self::$bot['id'].'" AND `delete` = "0"'); - - /* */ - - if($com['pr'] == '') { - $i = 1; - while( $i <= 18 ) { - $com['pr'] .= $com['p'.$i].'|'; - $i++; - } - $com['pr'] .= '0'; - } - - mysql_query('UPDATE `stats` SET `stats` = "'.$com['stats'].'",`priems` = "'.$com['pr'].'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - - /* */ - /* - $e = explode(',',$com['eff']); - $i = 0; - while($i < count($e)) { - if( $e[$i] > 0 ) { - // - - } - $i++; - } - */ - - $i = 1; - while($i <= 20) { - if($com['e'.$i] > 0) { - // - //$it = $u->addItem($com['e'.$i],self::$bot['id']); - $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$com['e'.$i].'" LIMIT 1')); - mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("'.$eff['oneType'].'","'.$eff['id2'].'","'.self::$bot['id'].'","'.$eff['mname'].'","'.(time()+9640000).'","'.$eff['mdata'].'","'.$eff['noAce'].'")'); - } - $i++; - } - - $i = 1; - while($i <= 20) { - if($com['w'.$i] > 0) { - // - $it = $u->addItem($com['w'.$i],self::$bot['id']); - $eff1 = mysql_fetch_array(mysql_query('SELECT * FROM `items_shop` WHERE `item_id` = "'.$com['w'.$i].'" LIMIT 1')); - if($it > 0) { - mysql_query('UPDATE `items_users` SET `inOdet` = "'.$i.'",`delete` = "0", `1price` = "'.$eff1['price_1'].'" WHERE `uid` = "'.self::$bot['id'].'" AND `id` = "'.$it.'" LIMIT 1'); - }else{ - - } - } - $i++; - } - - - - } - - }else{ - //, ! - } - - } - - // 1- , :) - if( self::$bot['city'] == 'capitalcity' ) { - - if( self::$bot['level'] < 2 && self::$bot['room'] == 0 && self::$bot['a1'] == 0) { - - self::_loc( self::_loc_zv() ); - - }else{ - - // - - - - if( self::$bot['a1'] > 0 ) { - - // - - - } - - } - - } - // - - - - /* */ - - } - - } - - public $bot_last_action = array(); - - // - static function start( $id ) { - if(!isset($bot_last_action[$id])) { - global $u; - $bot_last_action[$id]++; - self::$bot = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `st`.`id` = `u`.`id` WHERE `u`.`id` = "'.mysql_real_escape_string( $id ).'" AND `u`.`banned` = "0" LIMIT 1')); - - if( isset( self::$bot['id'] ) ) { - - //self::e(self::$bot['id'].'<<['.$bot_last_action[$id].']'); - - self::$st = $u->getStats( self::$bot, 0 ); - - // - self::_online(); - - if( self::$bot['battle'] > 0) { - - // - self::$btl = mysql_fetch_array( mysql_query('SELECT * FROM `battle` WHERE `id` = "'.mysql_real_escape_string(self::$bot['battle']).'" AND `team_win` = "-1" LIMIT 1') ); - if( isset( self::$btl['id'] ) ) { - - $go_bot = false; - $go_txt = ''; - - $a1 = mysql_fetch_array(mysql_query('SELECT `id`,`uid1`,`uid2`,`time` FROM `battle_act` WHERE `battle` = "'.self::$btl['id'].'" AND `uid1` = "'.self::$bot['id'].'" ORDER BY `time` ASC LIMIT 1')); - - // - // - self::battle_priems(); - - if( isset( $a1['id'] ) ) { - - // , , - if( $a1['time'] + self::$btl['timeout'] < time() ) { - $go_bot = true; - } - - } - - - /*$a2_sp = mysql_query('SELECT `id`,`uid1`,`uid2`,`time` FROM `battle_act` WHERE `battle` = "'.self::$btl['id'].'" AND `uid2` = "'.self::$bot['id'].'" ORDER BY `time` ASC LIMIT 5'); - - while( $a2 = mysql_fetch_array( $a2_sp ) ) { - - // - - if( $a2['time'] + self::$btl['timeout'] < time() ) { - // - $go_bot = true; - }else{ - mysql_query('UPDATE `stats` SET `enemy` = "'.$a2['uid1'].'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - $go_bot = true; - $a = array( - 0 => rand(1,5), - 1 => rand(1,5), - 2 => rand(1,5), - 3 => rand(1,5), - 4 => rand(1,5) - ); - $a = $a[0].'_'.$a[1].'_'.$a[2].'_'.$a[3].'_'.$a[4]; - $b = rand(1,5); - $go_txt .= '&atack='.$a.'&block='.$b.''; - } - - }*/ - - // test - $a2 = mysql_fetch_array(mysql_query('SELECT `id`,`uid1`,`uid2`,`time` FROM `battle_act` WHERE `battle` = "'.self::$btl['id'].'" AND `uid2` = "'.self::$bot['id'].'" ORDER BY `time` ASC LIMIT 1')); - if(isset($a2['uid1'])) - { - mysql_query('UPDATE `stats` SET `enemy` = "'.$a2['uid1'].'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - } - $a3 = mysql_fetch_array(mysql_query('SELECT `id`,`uid1`,`uid2`,`time` FROM `battle_act` WHERE `battle` = "'.self::$btl['id'].'" AND `uid2` = "'.self::$bot['id'].'" ORDER BY `time` ASC LIMIT 1')); - if(isset($a3['uid2'])) - { - mysql_query('UPDATE `stats` SET `enemy` = "'.$a3['uid2'].'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - } - // - - - $a1 = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_act` WHERE `battle` = "'.self::$btl['id'].'" AND `uid1` = "'.self::$bot['id'].'" AND `uid2` = "'.self::$bot['enemy'].'" LIMIT 1')); - self::$enemy = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "'.self::$bot['enemy'].'" LIMIT 1')); - /*if( !isset( $a1['id'] ) && self::$bot['hpNow'] >0 && self::$enemy['hpNow'] >0) { - $go_bot = true; - $a = array( - 0 => rand(1,5), - 1 => rand(1,5), - 2 => rand(1,5), - 3 => rand(1,5), - 4 => rand(1,5) - ); - $a = $a[0].'_'.$a[1].'_'.$a[2].'_'.$a[3].'_'.$a[4]; - $b = rand(1,5); - $go_txt .= '&atack='.$a.'&block='.$b.''; - } - - - unset($a1,$a2_sp,$a2); - // - if( $go_bot == true ) { - self::inuser_go_btl( self::$bot , $go_txt ); - }*/ - - }else{ - - // - self::inuser_go_btl( self::$bot ); - - // , - self::$bot['battle'] = 0; - mysql_query( 'UPDATE `users` SET `battle` = "'.self::$bot['battle'].'" WHERE `id` = "'.mysql_real_escape_string(self::$bot['id']).'" LIMIT 1 ' ); - } - - }else{ - - // - if( self::$bot['timeMain'] < time() ) { - - mysql_query('UPDATE `chat` SET `time` = "'.time().'" WHERE `to` = "'.self::$bot['login'].'" AND `time` = "-1"'); - - // - if( self::$bot['ipreg'] == 1 || self::$bot['ipreg'] == 2 || self::$bot['ipreg'] == 4 ) { - // - self::$bot['ipreg'] = 3; - } - if( self::$bot['ipreg'] == 5 ) { - // - self::$bot['ipreg'] = 7; - } - // - if( self::$bot['ipreg'] == 0 || self::test_fr(self::$bot['room']) == false ) { - - /*if( self::$bot['exp'] > 0 && self::$bot['exp'] < 30000 ) { - $u->addItem(1204,self::$bot['id']); - mysql_query('UPDATE `stats` SET `exp` = "270000" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - }*/ - - // - //mysql_query('UPDATE `eff_users` SET `timeUse` = "'.(time()-86400*3).'" WHERE `uid` = "'.self::$bot['id'].'" AND `id_eff` = "4" LIMIT 100'); - - // - $com = mysql_fetch_array(mysql_query('SELECT * FROM `a_bot_tree` WHERE `level` = "'.(self::$bot['level']).'" LIMIT 1')); - if(isset($com['id'])) { - $eft = mysql_fetch_array(mysql_query('SELECT `id` FROM `eff_users` WHERE `uid` = "'.self::$bot['id'].'" AND `delete` = "0" LIMIT 1')); - if(!isset($eft['id'])) { - mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.self::$bot['id'].'" AND `delete` = "0"'); - $i = 1; - while($i <= 20) { - if($com['e'.$i] > 0) { - // - //$it = $u->addItem($com['e'.$i],self::$bot['id']); - $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$com['e'.$i].'" LIMIT 1')); - mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("'.$eff['oneType'].'","'.$eff['id2'].'","'.self::$bot['id'].'","'.$eff['mname'].'","'.(time()+86400*7).'","'.$eff['mdata'].'","'.$eff['noAce'].'")'); - } - $i++; - } - } - } - - if( self::$bot['level'] >= 13 && self::$bot['clan'] == 0 && self::$bot['align'] == 0 ) { - // - self::clear_bot(); - } - - //- , - if( self::test_fr(self::$bot['room']) == false ) { - - // - , - - - }elseif( self::$st['hpNow'] >= self::$st['hpAll'] ) { - echo 1; - // :) - mysql_query('UPDATE `stats` SET `zv`= "0",`team`= "0",`hpNow` = "'.self::$st['hpNow'].'",`mpNow` = "'.self::$st['mpNow'].'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `ipreg` = "'.self::new_action().'",`mod_zvanie` = "" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - - }else{ - - if(self::$bot['mod_zvanie'] == '100500') { - // + - mysql_query('UPDATE `eff_users` SET `timeUse` = "'.( time() + 7200 ) .'" WHERE `uid` = "'.self::$bot['id'].'" AND `delete` = "0" AND `v1` != "priem" LIMIT 12'); - mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.self::$bot['id'].'" AND `inOdet` > 0 AND `delete` = "0"'); - $sp = mysql_query('SELECT `u`.`id`,`st`.`inslot`,`st`.`2too` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `st` ON `st`.`id` = `u`.`item_id` WHERE `u`.`inOdet` = 0 AND `st`.`inslot` > 0 AND `st`.`inSlot` <= 20'); - $in = array(); - while($pl = mysql_fetch_array($sp)) { - $od = $pl['inslot']; - - if($od == 10 && $in[10] > 0) { - if($in[11] > 0) { - if($in[12] == 0) { - $od = 12; - } - }else{ - $od = 11; - } - } - - if($od == 3 && $in[3] > 0 && $pl['2too'] > 0) { - if( $in[14] > 0 ) { - mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.self::$bot['id'].'" AND `inOdet` = "14" AND `delete` = "0" LIMIT 1'); - $in[14] = 0; - } - $od = 14; - } - - if( $in[$od] == 0 ) { - $in[$od] = $pl['id']; - mysql_query('UPDATE `items_users` SET `inOdet` = "'.$od.'" WHERE `id` = "'.$pl['id'].'" AND `uid` = "'.self::$bot['id'].'" LIMIT 1'); - } - } - mysql_query('UPDATE `items_users` SET `mod_zvanie` = "Ca" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - } - - // - if( self::$bot['regHP'] == 0 || self::$bot['regMP'] == 0 ) { - mysql_query('UPDATE `stats` SET `regHP` = "'.time().'", `regMP` = "'.time().'",`hpNow` = "'.self::$st['hpNow'].'",`mpNow` = "'.self::$st['mpNow'].'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - } - - $reg = $u->regen( self::$bot['id'] , self::$st , 0 ); - } - - self::actions(); - - self::update( 'timeMain', self::rnd() ); - - }elseif( self::$bot['ipreg'] == 1 ) { - - // (.) - if( self::$bot['zv'] == 0 ) { - - // . - $rz = 2; - $zv = 0; - $nozv = 0; - - if( self::$bot['level'] == 0 ) { - $rz = 1; - } - - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `city` = "'.self::$bot['city'].'" AND `otk` < "'.rand( 2, 6 ).'" AND `time` < "'.( time() - rand( 15, 25 ) ).'" AND `bcs` < "'.time().'" AND `start` = "0" AND `razdel` = "'.$rz.'" AND `cancel` = "0" AND `time` > "'.( time() - 1111).'" AND `money3` = 0 ORDER BY `time` DESC LIMIT 1')); - - if( isset( $zv['id'] ) ) { - - $uz1 = 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`="'.$zv['id'].'" AND `st`.`team`="1" LIMIT 1')); - $uz2 = 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`="'.$zv['id'].'" AND `st`.`team`="2" LIMIT 1')); - - if( isset( $uz1['id'] ) && !isset( $uz2['id'] ) ) { - - $uz1st = $u->getStats($uz1,0); - - if( $uz1st['reting'] <= floor(self::$st['reting']*1.27) ) { - - // - $sa = ''; - if( self::$bot['sex'] == 2 ) { - $sa = ''; - } - - $text = ' [login:'.self::$bot['login'].'] '.$sa.' .[reflesh_main_zv_priem:'.self::$bot['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')"); - mysql_query('UPDATE `stats` SET `zv` = "'.$zv['id'].'",`team` = "2" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `ipreg` = "8",`timeMain` = "'.self::rnd().'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - - }else{ - $nozv = 1; - } - - unset ($uz1st); - - }else{ - $nozv = 1; - } - }else{ - $nozv = 1; - } - - if( $nozv == 1 ) { - - if( self::$bot['timeMain'] < time() - rand(1,3)*60 ) { - mysql_query('UPDATE `users` SET `ipreg` = "0",`timeMain` = "'.self::rnd().'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - } - - } - - unset($rz); - } - - - }elseif( self::$bot['ipreg'] == 2 ) { - - // (.) - self::bot_group_haot_zv( 6 ); - }elseif( self::$bot['ipreg'] == 3 ) { - - // (.) - self::bot_group_haot_zv( 7 ); - }elseif( self::$bot['ipreg'] == 4 ) { - - // (.) - self::e(''.self::$bot['login'].', ...'); - }elseif( self::$bot['ipreg'] == 5 ) { - - // (.) - if( self::$bot['zv'] == 0 ) { - - $rz = 2; - if( self::$bot['level'] == 0 ) { - $rz = 1; - } - - $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 ( - "0", - "0", - "'.time().'", - "'.self::$bot['city'].'", - "'.self::$bot['id'].'", - "0", - "0", - "300", - "0", - "21", - "0", - "21", - "1", - "1", - "0", - "0", - "'.$rz.'", - "", - "", - "","'.( 0 + self::$bot['reting'] ).'","0")'); - $zid = mysql_insert_id(); - mysql_query('UPDATE `stats` SET `zv` = "'.$zid.'", `team` = "1" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `ipreg` = "8",`timeMain` = "'.self::rnd().'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - } - - }elseif( self::$bot['ipreg'] == 6 || self::$bot['ipreg'] == 7 ) { - - self::bot_group_haot_zv( self::$bot['ipreg'] ); - - // (.) - //$test_zv = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `creator` = '.self::$bot['id'].' AND `cancel` = 0 AND `start` = 0 LIMIT 1')); - - //self::e('SELECT * FROM `zayvki` WHERE `creator` = '.self::$bot['id'].' AND `cancel` = 0 AND `start` = 0 LIMIT 1'); - - if( self::$bot['zv'] == 0 ) { - - $rz = 4; - - if( self::$bot['ipreg'] == 7 ) { - $rz = 5; - } - - $rz = 5; - - $zv_c = array( - - 'time_start' => ( 60 * 5 ), - 'tm1' => rand( 2, 6 ), - 'tm2' => rand( 2, 6 ), - 'l1min' => 0, - 'l1max' => 21, - 'l2min' => 0, - 'l2max' => 21, - 'timeout' => ( 60 * rand( 1, 3 ) ) - - ); - - if( self::$bot['ipreg'] == 7 ) { - $zv_c['tm1'] = 99; - } - - $zv_c['tm2'] = $zv_c['tm1']; - $zv_c['l1min'] = self::$bot['level']; - $zv_c['l1max'] = self::$bot['level']; - - if($zv_c['l1min'] < 2) { - $zv_c['l1min'] = 2; - } - if($zv_c['l1max'] >21) { - $zv_c['l1max'] = 21; - } - - $zv_c['l2min'] = $zv_c['l1min']; - $zv_c['l2max'] = $zv_c['l1max']; - /* - $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`,`maxplayers`) VALUES ( - "0", - "0", - "'.time().'", - "'.self::$bot['city'].'", - "'.self::$bot['id'].'", - "0", - "'.$zv_c['time_start'].'", - "'.$zv_c['timeout'].'", - "'.$zv_c['l1min'].'", - "'.$zv_c['l1max'].'", - "'.$zv_c['l2min'].'", - "'.$zv_c['l2max'].'", - "'.$zv_c['tm1'].'", - "'.$zv_c['tm2'].'", - "0", - "0", - "'.$rz.'", - "", - "", - "","'.( 0 + self::$bot['reting'] ).'","0", - "12")'); - $zid = mysql_insert_id(); - mysql_query('UPDATE `stats` SET `zv` = "'.$zid.'", `team` = "1" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `ipreg` = "8",`timeMain` = "'.self::rnd().'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - */ - } - - }elseif( self::$bot['ipreg'] == 8 ) { - - // - if( self::$bot['zv'] == 0 ) { - - // - mysql_query('UPDATE `users` SET `ipreg` = "0",`timeMain` = "'.self::rnd().'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - }else{ - $zv = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id` = "'.self::$bot['zv'].'" AND `cancel` = "0" AND `start` = "0" LIMIT 1')); - - if( !isset( $zv['id'] ) ) { - - // - mysql_query('UPDATE `users` SET `ipreg` = "0",`timeMain` = "'.self::rnd().'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - - }elseif($zv['razdel'] == 4 || $zv['razdel'] == 5) { - - // - if( $zv['time_start'] + $zv['time'] <= time() ) { - - self::inuser_go_zv( self::$bot ); - } - - }else{ - // - if( $zv['creator'] == self::$bot['id'] ) { - - $uz2 = 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`="'.$zv['id'].'" AND `st`.`team`="2" LIMIT 1')); - if( isset( $uz2['id'] ) ) { - // - , ! :) - $pr = -1; - - $uz2st = $u->getStats($uz2,0); - - //btl-cof - if( $uz2st['reting'] > floor(self::$st['reting']*1.27)) { - - //, 95% , - if( rand( 0, 100 ) > 95 ) { - // :D - $pr = 1; - }else{ - // - $pr = 0; - } - - }else{ - $pr = 1; - } - - // - //$pr = 0; - - if( $pr == 1 ) { - - // - // - $expB = 0; - $btl = array('players'=>'','timeout'=>$zv['timeout'],'type'=>$zv['type'],'invis'=>$zv['invis'],'noinc'=>0,'travmChance'=>0,'typeBattle'=>0,'addExp'=>$expB,'money'=>0); - $ins = mysql_query('INSERT INTO `battle` (`time_over`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`,`team_win`) VALUES ( - "0", - "'.self::$bot['city'].'", - "'.time().'", - "'.$btl['players'].'", - "'.$btl['timeout'].'", - "'.$btl['type'].'", - "'.$btl['invis'].'", - "'.$btl['noinc'].'", - "'.$btl['travmChance'].'", - "'.$btl['typeBattle'].'", - "'.$btl['addExp'].'", - "'.$btl['money'].'", - "-1")'); - if($ins) - { - $btl_id = mysql_insert_id(); - // - mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$uz2['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'",`ipreg` = "0" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `zv` = "0",`team`="1" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `zv` = "0",`team`="2" WHERE `id` = "'.$uz2['id'].'" LIMIT 1'); - - // , - if($btl['type']==1) - { - mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.self::$bot['id'].'" AND `inOdet`!=0'); - mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$uz2['id'].'" AND `inOdet`!=0'); - } - - mysql_query('UPDATE `zayvki` SET `start` = "'.time().'",`btl_id` = "'.$btl_id.'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - - // , - self::$bot['battle'] = $btl_id; - - // - mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','".$u->info['room']."','".$uz2['login']."','".time()."','11','0','117')"); - } - - }elseif( $pr == 0 ) { - - // - $sa = ''; - if( self::$bot['sex'] == 2 ) { - $sa = ''; - } - $text = ' [login:'.self::$bot['login'].'] '.$sa.' .'; - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$uz2['city']."','','','".$uz2['login']."','".$text."','".time()."','6','0')"); - mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "1" WHERE `id` = "'.$uz2['id'].'" LIMIT 1'); - mysql_query('UPDATE `zayvki` SET `otk` = ( `otk` + 1 ),`bcs` = "'.( time() + rand( 30, rand( 60, 180 ) ) ).'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - }else{ - //- ... - } - - }else{ - - // , ! - if( self::$bot['timeMain'] < time() - 30 - rand((7 / $zv['otk'] ), (3*49 / $zv['otk'] )) ) { - - mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `ipreg` = "0",`timeMain` = "'.self::rnd().'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `zayvki` SET `cancel` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - - } - - } - - } - - } - - // , - if( self::$bot['timeMain'] < time() - rand((30 / $zv['otk'] ), (135 / $zv['otk'] )) && $zv['creator'] != self::$bot['id'] && ( $zv['razdel'] == 1 || $zv['razdel'] == 2 ) ) { - - $uz1 = 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`="'.$zv['id'].'" AND `st`.`team`="1" LIMIT 1')); - if( isset( $uz1['id'] ) ) { - - $sa = ''; - if( self::$bot['sex'] == 2 ) { - $sa = ''; - } - - $text = ' [login:'.self::$bot['login'].'] '.$sa.' .'; - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$uz1['city']."','','','".$uz1['login']."','".$text."','".time()."','6','0')"); - } - - mysql_query('UPDATE `zayvki` SET `otk` = ( `otk` + 1 ),`bcs` = "'.( time() + rand( 30, rand( 60, 180 ) ) ).'" WHERE `id` = "'.$zv['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "1" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `ipreg` = "1",`timeMain` = "'.self::rnd().'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - } - - } - - }elseif( self::$bot['ipreg'] == 9 ) { - - // (.) - - }elseif( self::$bot['ipreg'] == 10 ) { - - // - - }elseif( self::$bot['ipreg'] == 11 ) { - - // - - }elseif( self::$bot['ipreg'] == 12 ) { - - // - - }elseif( self::$bot['ipreg'] == 13 ) { - - // - - }elseif( self::$bot['ipreg'] == 14 ) { - - // - - }elseif( self::$bot['ipreg'] == 15 ) { - - // (, , , ) - - }elseif( self::$bot['ipreg'] == 16 ) { - - // - - }else{ - self::update('ipreg',0); - } - - } - - } - - return true; - - }else{ - - return false; - - } - } - } - - static function team_zv_cf( $zv , $tm ) { - $r = mysql_fetch_array(mysql_query('SELECT SUM(`btl_cof`) FROM `stats` WHERE `zv` = "'.$zv['id'].'" AND `team` = "'.$tm.'" LIMIT 1')); - $r = 0+round($r[0]); - return $r; - } - - static function new_action() { - - $r = rand( 1 , 7 ); - - if( self::$bot['level'] < 2 ) { - if( $r == 2 || $r == 3 || $r == 6 || $r == 7 || $r == 8 ) { - if( rand(0,1) == 1 ) { - $r = 1; // - }elseif( rand(0,1) == 0 ){ - $r = 4; // - }else{ - $r = 5; // - } - } - }elseif( self::$bot['level'] == 0 ) { - if( rand(0,1) == 1 ) { - $r = 1; // - }else{ - $r = 5; // - } - }else{ - // - - } - - if( $r == 4 ) { - $r = 1; - } - - return $r; - - } - - - /*/ - - /*/ - // - static function bot_group_haot_zv( $id ) { - - if($id == 6) { - // - $rz = 4; - }elseif($id == 7) { - // - $rz = 5; - } - - // - $rz = 5; - // - - - $sp = mysql_query('SELECT * FROM `zayvki` WHERE `razdel` = "'.$rz.'" AND `cancel` = "0" AND `start` = "0" AND `invise` = "0" AND `money3` = 0 AND ( - ( `min_lvl_1` <= '.self::$bot['level'].' AND `max_lvl_1` >= '.self::$bot['level'].' ) OR ( `min_lvl_2` <= '.self::$bot['level'].' AND `max_lvl_2` >= '.self::$bot['level'].' ) - )'); - - $pr = 0; - - while($pl = mysql_fetch_array( $sp )) { - - if( $pr == 0 ) { - - $go = 1; - $tm = array(0,0,0); - - if( $rz == 4 ) { - - $tm1c = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$pl['id'].'" AND `team` = "1" LIMIT 1')); - $tm2c = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$pl['id'].'" AND `team` = "2" LIMIT 1')); - - if($tm1c[0] < $pl['tm1max']) { - if( $pl['min_lvl_1'] <= self::$bot['level'] && $pl['max_lvl_1'] >= self::$bot['level']) { - $tm[1] = 1; - } - } - - if($tm2c[0] < $pl['tm2max']) { - if( $pl['min_lvl_1'] <= self::$bot['level'] && $pl['max_lvl_1'] >= self::$bot['level']) { - $tm[2] = 1; - } - } - - $atm = 1; - $tmr = 0; - if( $tm[1] == 1 && $tm[2] == 0 ) { - $tmr = 1; - }elseif( $tm[1] == 0 && $tm[2] == 1 ) { - $tmr = 2; - }else{ - $tmr = rand(1,2); - } - - if($tmr > 0) { - if($tmr == 1) { - $atm = 2; - } - - - // - if( self::team_zv_cf($pl,$atm) > ( self::team_zv_cf($pl,$tmr) + self::$st['reting'] )*1.67 || ($zv['tm2max'] < $zv['tm1max']/2) || ($zv['tm1max'] < $zv['tm2max']/2) ) { - //self::e(self::$bot['login'].', '.$pl['id'].' , '.self::team_zv_cf($pl,$atm).' VS '.(self::team_zv_cf($pl,$tm) + self::$st['reting'] ).' ...'); - if(rand(0,100) < 90) { - $go = 0; - } - } - } - - }elseif( $rz == 5 ) { - /* - if( $pl['min_lvl_1'] <= self::$bot['level'] && $pl['max_lvl_1'] >= self::$bot['level']) { - $tm[1] = 1; - } - */ - // 8- - /*if( self::$bot['level'] <= 8 ) { - if( $pl['min_lvl_1'] <= 8 && $pl['max_lvl_1'] <= 8) { - $tm[1] = 1; - } - }else{*/ - if( $pl['min_lvl_1'] == self::$bot['level'] && $pl['max_lvl_1'] == self::$bot['level'] ) { - $tm[1] = 1; - } - $col_p = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$pl['id'].'"')); - $cols = $col_p[0]; - if( $cols >= $pl['maxplayers'] ) { - $go = 0; - } - //} - } - - - if($go == 1 && ( $tm[1] != 0 || $tm[2] != 0 )) { - - if( $tm[1] == 1 && $tm[2] == 0 ) { - $tm = 1; - }elseif( $tm[1] == 0 && $tm[2] == 1 ) { - $tm = 2; - }else{ - $tm = rand(1,2); - } - - if( $rz == 5 ) { - $tm = 1; - } - - //self::e(self::$bot['login'].', #'.$pl['id'].', '.$tm.' '); - - if( $rz == 5 ) { - /* */ - if($pl['tm1'] > $pl['tm2']) - { - $tm = 2; - }elseif($z['tm1']<$z['tm2']) - { - $tm = 1; - }else{ - $tm = rand(1,2); - } - - $tm = rand(1,2); - - if($pl['invise']==0) - { - $nxtID = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$pl['id'].'"')); - $nxtID = $nxtID[0]; - //$u->info['login2'] = ' ('.($nxtID+1).')'; - self::$bot['login2'] = ''; - }else{ - self::$bot['login2'] = ''; - } - - $blnc = 100*self::$bot['level']+self::$st['reting']; - - $pl['tm'.$tm] += $blnc; - - mysql_query('UPDATE `zayvki` SET `tm1` = "'.$pl['tm1'].'", `tm2` = "'.$pl['tm2'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - - } - - if( $tm > 0 || $rz == 5 ) { - - // - mysql_query('UPDATE `stats` SET `zv` = "'.$pl['id'].'",`team` = "'.$tm.'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `login2` = "'.self::$bot['login2'].'",`ipreg` = "8" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - self::$bot['zv'] = $pl['id']; - $pr = $pl['id']; - - } - - } //if - - } // while - - } - - } - - // - static function createNewBot($login,$sex) { - if($sex != 1) { - $sex = 0; - }else{ - $se = 1; - } - - $r = array( - 'name' => '_', - 'city_real' => '', - 'deviz' => '', - 'chatColor' => 'Black' - ); - - $ins = mysql_query("INSERT INTO `users` (`fnq`,`host_reg`,`room`,`login`,`pass`,`ipreg`,`ip`,`city`,`cityreg`,`name`,`sex`,`city_real`,`deviz`,`chatColor`,`timereg`) VALUES ( - '0', - 'real_bot_user', - '0', - '".mysql_real_escape_string($login)."', - '".md5('regnxt#$%^0.'.time())."', - '127.0.0.1', - '127.0.0.1', - 'capitalcity', - 'capitalcity', - '".$r['name']."', - '".mysql_real_escape_string($sex)."', - '".$r['city_real']."', - '".$r['deviz']."', - '".$r['chatColor']."', - '".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("UPDATE `users` SET `online`='".time()."' WHERE `uid` = '".$uid."' LIMIT 1"); - } - - } - - // - static function _online() { - if( self::$bot['online'] < time() - 60 ) { - /// - if( self::$bot['battle'] == 0 && self::$bot['zv'] == 0) { - self::_level(); - } - self::update( 'online', time() ); - //self::$bot['online'] = time(); - //mysql_query( 'UPDATE `users` SET `online` = "'.self::$bot['online'].'" WHERE `id` = "'.mysql_real_escape_string(self::$bot['id']).'" LIMIT 1 ' ); - - } - } - - // - static function _loc_A( $a, $b ) { - $r = $b; - - return $r; - } - - static function _loc_zv() { - - if( rand(0,100) < 5 ) { - - $r = 1; - - }else{ - - $r = rand(1,4); - - } - - if( $r == 4 ) { - - // - if( self::$bot['sex'] != 1 ) { - $r = rand(1,3); - } - - } - - if( self::$bot['city'] == 'capitalcity' ) { - if($r == 4) { - // - $r = 7; - }elseif( $r == 3 ) { - // 3 - $r = 5; - }elseif( $r == 2 ) { - // 2 - $r = 2; - }else{ - // 1 - $r = 4; - } - - if( self::$bot['level'] == 0 ) { - // - $r = 0; - } - - } - - return $r; - } - - static function _loc( $id ) { - - if( $id == self::$bot['room'] ) { - - //, - self::update('a1',0); - - }else{ - - // - $rid_next = self::_loc_A(self::$bot['room'],$id); - if( $rid_next > 0 ) { - // - //$rid_next = 377; - mysql_query('UPDATE `users` SET `room` = "'.$rid_next.'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - return true; - }else{ - // - return false; - } - - } - - } - - // , - static function _level() { - global $u; - $lvl = mysql_fetch_array(mysql_query('SELECT `upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.(self::$bot['upLevel']+1).'" LIMIT 1')); - if( isset($lvl['upLevel']) ) { - - if( self::$bot['level'] <= 5 && self::$bot['exp'] >= 12499 ) { - $cr = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "1204" AND `uid` = "'.self::$bot['id'].'" AND `delete` = "0" LIMIT 1')); - if( !isset($cr['id']) ) { - $u->addItem(1204,self::$bot['id']); - self::$bot['exp'] = 12500; - } - } - //self::$bot['exp'] = 300000; - if($lvl['exp'] <= self::$bot['exp']) { - //mysql_query('UPDATE `stats` SET `exp` = "300000" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - //self::e('test'); - // - self::inuser_go_main( self::$bot ); - mysql_query('UPDATE `users` SET `clss` = "0" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - - } - - }else{ - self::e(self::$bot['login']); - } - - } - - // - static function e( $t ) { - - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' ( ): '.mysql_real_escape_string($t).'","capitalcity", - "LEL","6","1","-1")'); - - } - - static function rnd() { - return time() + rand(3,14) + rand(0,14) + rand(7,21); - } - - static function update( $n, $v, $t = 'users' ) { - self::$bot[$n] = $v; - mysql_query('UPDATE `'.$t.'` SET `'.$n.'` = "'.self::$bot[$n].'" WHERE `id` = "'.self::$bot['id'].'" LIMIT 1'); - } - -} -?> \ No newline at end of file diff --git a/_incl_data/class/bot.priem.php b/_incl_data/class/bot.priem.php deleted file mode 100644 index 058ccb5d..00000000 --- a/_incl_data/class/bot.priem.php +++ /dev/null @@ -1,516 +0,0 @@ -= 175 && $id <= 179 ) { self::priem175( $i ); } - - //********************************* - } - return true; - - } - - static function usePriem($id,$on = NULL) { - - //if(self::$p['id'] > 7 && self::$p['id'] < 11) { - //botLogic::e(botLogic::$bot['login'].', "'.self::$p['name'].'" , battle: Link'); - //} - - $go_txt = '&usepriem='.$id; - if( $on != '') { - $on = str_replace(' ','%20',$on); - $go_txt .= '&useon='.$on; - } - botLogic::inuser_go_btl( botLogic::$bot , $go_txt ); - } - // - static function priem220( $i ) { - $su = true; - // - if(rand(0,100) >= 30) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem217( $i ) { - $su = true; - // - if(rand(0,100) >= 30) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem204( $i ) { - $su = true; - // - if(rand(0,100) >= 30) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem232( $i ) { - $su = true; - // - if(self::hp() > 30 || rand(0,100) >= 50) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem188( $i ) { - $su = true; - // - if(rand(0,100) >= 30) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem235( $i ) { - $su = true; - // - if(rand(0,100) >= 50) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem240( $i ) { - $su = true; - // - //if(botLogic::$st['tactic2'] < 7 || botLogic::$st['tactic4'] < 3 || self::hp() > 70) { - if(self::hp() > 70) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem175( $i ) { - $su = true; - // - /*if(botLogic::$st['hpNow'] >= botLogic::$st['hpAll']) { - $su = false; - }elseif(botLogic::$st['hpNow'] < 5) { - $su = false; - }elseif(rand(0,100) >= 50) { - $su = false; - }*/ - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem1( $i ) { - $su = true; - if(rand(0,100) >= 50) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem2( $i ) { - $su = true; - // - if(rand(0,100) >= 50) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem3( $i ) { - $su = true; - // - /*if(botLogic::$st['hpNow'] >= botLogic::$st['hpAll']) { - $su = false; - }elseif(botLogic::$st['hpNow'] < 10) { - $su = false; - }elseif(isset(botLogic::$pr[1]) && botLogic::$pr[1] < 1) { - $su = false; - }*/ - if(self::hp() > 70 || rand(0,100) >= 50) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem6( $i ) { - $su = true; - // - if(self::hp() > 40 || rand(0,100) >= 50) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem8( $i ) { - $su = true; - // - if(rand(0,100) >= 30) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem48( $i ) { - $su = true; - // - if(rand(0,100) >= 70) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem9( $i ) { - $su = true; - // - if(rand(0,100) >= 30) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem47( $i ) { - $su = true; - // - if(rand(0,100) >= 50) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem10( $i ) { - $su = true; - // - if(rand(0,100) >= 30) { - $su = false; - } - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem49( $i ) { - $su = true; - // - if(rand(0,100) >= 80 || self::hp() > 60) { - $su = false; - } - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem223( $i ) { - $su = true; - // - if(self::hp() > 50 || rand(0,100) >= 50) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem11( $i ) { - $su = true; - // - //if(isset(botLogic::$pr[6]) && botLogic::$st['tactic7'] > 0 && self::hp() < 66 && botLogic::$st['tactic1'] < 14) { - if(rand(0,100) >= 30){ - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem13( $i ) { - $su = true; - // - if(rand(0,100) >= 50){ - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - // - static function priem14( $i ) { - $su = true; - // - if(rand(0,100) >= 50){ - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem4( $i ) { - $su = true; - // - /*if(isset(botLogic::$pr[6]) && botLogic::$st['tactic7'] > 0 && self::hp() < 66 && botLogic::$st['tactic1'] < 14) { - $su = false; - }elseif((isset(botLogic::$pr[11]) || isset(botLogic::$pr[6])) && rand(0,100) <= 75) {*/ - if(rand(0,100) >= 60){ - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - // - static function priem5( $i ) { - $su = true; - // - if(self::hp() > 95) { - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - - // - static function priem211( $i ) { - $su = true; - // - - //if( rand(0,100) >= 80 || (isset(botLogic::$pr[7]) && botLogic::$pr[7] < 1) || (isset(botLogic::$pr[45]) && botLogic::$pr[45] < 1) || self::hp() > 80 ) { - if( rand(0,100) >= 80){ - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - - - // - static function priem45( $i ) { - $su = true; - // - - //if( rand(0,100) >= 60 || (isset(botLogic::$pr[7]) && botLogic::$pr[7] < 1) || (isset(botLogic::$pr[211]) && botLogic::$pr[211] < 1) || self::hp() > 80 ) { - if( rand(0,100) >= 50){ - $su = false; - } - - if($su == true) { - self::usePriem( $i ); - } - } - - - // - static function priem7( $i ) { - //if (rand(0,100) >= 50){$su = true;}else{$su = false;} - - $su = true; - // - /* () , - 70% */ - //if( rand(0,100) >= 50 || (isset(botLogic::$pr[45]) && botLogic::$pr[45] < 1) || (isset(botLogic::$pr[211]) && botLogic::$pr[211] < 1) || self::hp() > 80 ) { - if(rand(0,100) >= 30) { - - $su = false; - - } - if($su == true) { - self::usePriem( $i ); - } - } - - - - - static function hp() { - $p = round((botLogic::$st['hpNow']/botLogic::$st['hpAll']*100),2); - return $p; - } - - // - static function testpriem($pl) { - global $u; - $notr = 0; - - $tr = $u->lookStats($pl['tr']); - $d2 = $u->lookStats($pl['date2']); - - $x = 1; - while( $x <= 7 ) { - if(botLogic::$bot['tactic'.$x] < $pl['tt'.$x] && $x!=7 && $pl['tt'.$x] > 0) { - $notr++; - }elseif($x==7) { - if($pl['tt'.$x]>0 && botLogic::$bot['tactic'.$x]<=0) { - $notr++; - } - } - $x++; - } - - if($pl['xuse']>0) { - $xu = $u->testAction('`vars` = "use_priem_'.botLogic::$bot['battle'].'_'.botLogic::$bot['id'].'" AND `vals` = "'.$pl['id'].'" LIMIT '.$pl['xuse'].'',2); - if($xu[0] >= $pl['xuse']) { - $notr++; - } - } - - $x = 0; - $t = $u->items['tr']; - while($x < count($t)) - { - $n = $t[$x]; - if(isset($tr['tr_'.$n])) - { - if($n=='lvl') - { - if($tr['tr_'.$n] > botLogic::$bot['level']) - { - $notr++; - } - }elseif($tr['tr_'.$n] > botLogic::$st[$n]) - { - $notr++; - } - } - $x++; - } - - if(isset($tr['tr_mpNow'])) - { - if(botLogic::$st['mpNow'] < $tr['tr_mpNow']) - { - $notr++; - } - } - - if($pl['trUser']==1) - { - // - ( ) - $ga = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_act` WHERE `battle` = "'.botLogic::$bot['battle'].'" AND `uid1` = "'.botLogic::$bot['id'].'" AND `uid2` = "'.botLogic::$bot['enemy'].'" LIMIT 1')); - if(isset($ga['id'])) - { - $notr++; - } - } - - // - if(botLogic::$st['prsu'][$pl['id']]>0) { - $notr++; - } - - return $notr; - } - -} -?> \ No newline at end of file diff --git a/_incl_data/class/dialog.class.php b/_incl_data/class/dialog.class.php deleted file mode 100644 index 4e34c5c1..00000000 --- a/_incl_data/class/dialog.class.php +++ /dev/null @@ -1,1501 +0,0 @@ -0,1=>0); - $i = floor($x/$j); - $r = array(0=>$i,1=>$x-($i*$j)); - return $r; - } - - public function objLevel($t,$l) - { - $i = 1; - $r = 0; - while($i<=$l) - { - if(isset($t[$i])) - { - $r = $t[$i]; - } - $i++; - } - return $r; - } - - public function start($id) - { - global $u,$q,$c,$d,$code; - $this->info = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_dialog` WHERE `id` = "'.mysql_real_escape_string((int)$id).'" LIMIT 1')); - if(isset($this->info['id'])) - { - $pg = 1; - $go = 1; - $txt = ''; - // - if(isset($_GET['act'])) - { - $ta = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_dlg` WHERE `type` = "0" AND `id` = "'.mysql_real_escape_string((int)$_GET['act']).'" AND `id_dg` = "'.$this->info['id'].'" LIMIT 1')); - if(isset($ta['id'])) - { - $ta['action'] = $this->ltr($ta['action']); - $act = explode('|',$ta['action']); - $go1 = 1; - $needRep = array(); - if($ta['tr'] != '') { - $i = 0; - $x = explode('|',$ta['tr']); - while($i < count($x)) { - // - $k = explode('=',$x[$i]); - if($k[0]=='data') { - $date = explode('-',$k[1]); - $dd1 = $date[0]; - $mm1 = $date[1]; - $dd2 = $date[2]; - $mm2 = $date[3]; - $date1 = strtotime($dd1.'-'.$mm1.'-'.date('Y')); - $date2 = strtotime($dd2.'-'.$mm2.'-'.date('Y')); - - if( $date1 > time() || $date2 < time() ) { - $go1 = 'delete'; - $i = count($x); - } - - }elseif($k[0]=='diact') { - // - //user_id # all # all # lukaqst1 # -1 - if($this->quest_act($k[1])==false) { - $go1 = 'delete'; - $i = count($x); - } - }elseif($k[0]=='quest_end') { - // - $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$k[1].'" ORDER BY `id` DESC LIMIT 1')); - if(isset($qlst['id']) && $qlst['vals'] != 'win' && $qlst['vals'] != 'end' && $qlst['vals'] != 'bad') { - $go1 = 0; - $txt .= '
    - , ...'; - $pg = $ta['page']; - } - }elseif($k[0]=='quest_only_one') { - // - $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$k[1].'" ORDER BY `id` DESC LIMIT 1')); - if(isset($qlst['id']) && ($qlst['vals'] == 'win' || $qlst['vals'] == 'bad')) { - $go1 = 0; - $txt .= '
    - , ...'; - $pg = $ta['page']; - } - }elseif($k[0]=='quest_now') { - // - $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$k[1].'" ORDER BY `id` DESC LIMIT 1')); - if(isset($qlst['id']) && $qlst['vals'] != 'win' && $qlst['vals'] != 'end' && $qlst['vals'] != 'bad'){}else{ - $go1 = 0; - $txt .= '
    - , ...'; - $pg = $ta['page']; - } - }elseif($k[0]=='tr_itm') { - // - $qlst = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.$k[1].'" AND `inOdet` = 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if($qlst[0] < $k[2]){ - $go1 = 0; - $itmqs = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$k[1].'" LIMIT 1')); - if(isset($itmqs['id'])) { - $txt .= '
    "'.$itmqs['name'].'" (x'.$k[2].').'; - } - $pg = $ta['page']; - } - }elseif($k[0]=='tr_itmodet') { - // - $k[1] = str_replace(',','" OR `item_id` = "',$k[1]); - $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "'.$k[1].'") AND `inOdet` > 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if(!isset($qlst['id'])){ - $go1 = 0; - $itmqs = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$k[1].'" LIMIT 1')); - if(isset($itmqs['id'])) { - $txt .= '
    "'.$itmqs['name'].'".'; - } - $pg = $ta['page']; - } - }elseif($k[0]=='tr_noitmodet') { - // - $k[1] = str_replace(',','" OR `item_id` = "',$k[1]); - $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "'.$k[1].'") AND `inOdet` > 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if(isset($qlst['id'])){ - $go1 = 0; - $itmqs = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$k[1].'" LIMIT 1')); - if(isset($itmqs['id'])) { - $txt .= '
    "'.$itmqs['name'].'".'; - } - $pg = $ta['page']; - } - }elseif($k[0]=='tr_noitm') { - // - $k[1] = str_replace(',','" OR `item_id` = "',$k[1]); - $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "'.$k[1].'") AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if(isset($qlst['id'])){ - $go1 = 0; - $itmqs = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$k[1].'" LIMIT 1')); - if(isset($itmqs['id'])) { - $txt .= '
    "'.$itmqs['name'].'".'; - } - $pg = $ta['page']; - } - }elseif($k[0]=='del_itm') { - // - $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.$k[1].'" AND `inOdet` = 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if(isset($qlst['id'])){ - $itmqs = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$k[1].'" LIMIT 1')); - if(isset($itmqs['id'])) { - if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$qlst['id'].'" LIMIT 1')) { - $txt .= '
    "'.$itmqs['name'].'"'; - } - } - $pg = $ta['page']; - } - } elseif( $k[0] == 'needRep' ) { - // . - $temp = explode(',', $k[1]); - $needRep = array('city' => $temp[0], 'rep' => (int)$temp[1]); - if( isset($needRep) ) { # . - if($u->rep['rep'.$needRep['city']] < $needRep['rep'] ) { - $swapActStatus = 0; - $go1 = 0; - $txt = ' , !'; - $pg = $ta['page']; - } - } - } - $i++; - } - } - if(isset($act[1]) && $go1 == 1){ - $act1 = explode('=',$act[1]); - $act0 = explode('=',$act[0]); - if( $act0[0] == 'fileqst' ) { - if(file_exists('_incl_data/class/quest/'.htmlspecialchars($act0[1]).'.php')) { - require_once('_incl_data/class/quest/'.htmlspecialchars($act0[1]).'.php'); - }else{ - $txt .= '
    NPS...'; - } - $pg = $act[1]; - }elseif( $act[0]=='dialog_act_update') { - $act33 = $this->dialog_act_update($act[2]); - if( $act33[0] == false ) { - if( $act33[1] == '' ) { - $txt .= '
    - ...'; - }else{ - $txt .= '
    '.$act33[1].''; - } - }else{ - $txt .= '
    '.$act33[1].''; - } - $pg = $act[1]; - }elseif( $act[0]=='quest_act' ) { - $txt .= '
    .'; - mysql_query('INSERT INTO `dialog_act` ( - `uid`,`city`,`time`,`var`,`val`,`btl_bot`,`itms`,`now`,`max`,`info` - ) VALUES ( - "'.$u->info['id'].'","'.$u->info['city'].'","'.time().'","'.mysql_real_escape_string($act1[0]).'","'.mysql_real_escape_string($act1[1]).'" - ,"'.mysql_real_escape_string($act1[3]).'","'.mysql_real_escape_string($act1[4]).'","'.mysql_real_escape_string($act1[5]).'","'.mysql_real_escape_string($act1[6]).'","'.mysql_real_escape_string($act1[7]).'" - )'); - $pg = $act1[2]; - if( $act1[8] != 0 ) { - // - $itmb = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$act1[8].'" LIMIT 1')); - if(isset($itmb['id'])) { - $u->addItem($act1[8],$u->info['id'],'|nodelete=1'); - $txt .= '
    "'.$itmb['name'].'"'; - } - } - }elseif( $act[0]=='buyitm' ) { - $itmb = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$act1[0].'" LIMIT 1')); - if(isset($itmb['id'])) { - if( $u->info['money'] < $act1[1] ) { - $txt .= '
    "'.$itmb['name'].'", '.$act1[1].' .'; - }else{ - $act1dt = ''; - $txt .= '
    "'.$itmb['name'].'"'; - if($act1[1] > 0) { - $txt .= ' '.$act1[1].' .'; - $u->info['money'] -= $act1[1]; - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - if($act1[2] > 0) { - $txt .= ' '.$act1[2].' .'; - } - if( $act1[3] > 0 ) { - $txt .= ' '.$u->timeOut($act1[3]).''; - $act1dt .= '|srok='.$act1[3].''; - } - $txt .= ''; - - $u->addItem($itmb['id'],$u->info['id'],$act1dt); - $pg = $act1[4]; - } - }else{ - $txt .= '
    ...'; - $pg = 1; - } - }elseif( $act1[0]=='quest' ) { - $pg = $act1[1]; - $act2 = explode('=',$act[1]); - if($act2[0] > 0 && $q->testGood($act2[0])==1) { - // - if($act2[1]!='0') { - // - $ic1 = 0; - $act21 = explode(',',$act2[1]); - while($ic1 < count($act21)) { - $act3 = explode('-',$act21[$ic1]); - $itmqs = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$act3[0].'" LIMIT 1')); - if(isset($itmqs['id'])) { - if($act3[2] > 1) { - // - $txt .= '
    "'.$itmqs['name'].'" (x'.$act3[2].' .).'; - }else{ - // - $txt .= '
    "'.$itmqs['name'].'".'; - } - $ic2 = 1; - while($ic2 <= $act3[2]) { - $u->addItem($itmqs['id'],$u->info['id'],'|quest_item=1',array('del'=>$act3[3])); - $ic2++; - } - } - $ic1++; - } - } - $q->startq($act2[0]); - $txt .= '
    '.$u->error.'.'; - $u->error = ''; - } else { - $txt .= '
    , ...'; - } - } elseif($act[0]=='go' && $go1 == 1) { - $pg = $act[1]; - } elseif($act[0]=='atackbot' && $go1 == 1) { - // - if( round((int)$act[1]) > 0 ) { - $btl_id = 0; - //$expB = -77.77; - $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 ( - "'.$d->info['id2'].'", - "'.$d->info['id'].'", - "'.$u->info['x'].'", - "'.$u->info['y'].'", - "'.$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(); - - if($btl_id > 0) { - // - $k = $u->addNewbot(round((int)$act[1]),NULL,NULL,array()); - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$k['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `x`="'.$u->info['x'].'",`y`="'.$u->info['y'].'",`team` = "2" WHERE `id` = "'.$k['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - - } - header('location: main.php'); - }else{ - echo ' - ...'; - } - die(); - } elseif($act[0]=='goroom' && $go1 == 1) { - $u->info['room'] = $act[1]; - mysql_query('UPDATE `users` SET `room` = "'.$u->info['room'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - header('location: main.php'); - die(); - } elseif($act[0]=='transfer2' && $go1 == 1) { - // - $txt = ''; - - $xtik = 0; // - - if( $act[1] == 1 && true == false ) { - $txt .= ' 1...'; - $xtik = 10; - $itik = 4465; - - }elseif( $act[1] == 2 ) { - $txt .= ' 2...'; - $xtik = 15; - $itik = 2143; - - }elseif( $act[1] == 3 ) { - $txt .= ' 3...'; - $xtik = 15; - $itik = 2144; - - }elseif( $act[1] == 4 && true == false ) { - $txt .= ' 4...'; - $xtik = 6; - // - $itik = -1; - - }elseif( $act[1] == 5 && true == false ) { - $txt .= ' 5...'; - $xtik = 6; - // - $itik = -2; - - }elseif( $act[1] == 6 ) { - $txt .= ' 6...'; - $xtik = 50; - // 1 - $itik = -3; - - }elseif( $act[1] == 7 ) { - $txt .= ' 7...'; - $xtik = 70; - // 2 - $itik = -4; - - }else{ - $txt .= ' ...'; - } - - $txt = ' 3 '; - - $itms = array(); - $sp = mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "4504" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 100'); - while($pl = mysql_fetch_array($sp)) { - $itms[$pl['item_id']]++; - } - - $t = $this->trnObj($itms[4504],$xtik); - if($t[0] > 0) { - // $t[0] - , $cn[$i]['add'][0] - item_id - // - - $gdtik = 1; - - if( $gdtik == 1 ) { - $upd = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "4504" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" ORDER BY `inGroup` ASC LIMIT '.$xtik.''); - //echo 'UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "4504" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT '.$t[0].''; - if($upd) { - if( $itik > 0 ) { - // - $u->addItem($itik,$u->info['id'],'|nosale=1|srok='.(7*86400).'',NULL,1); - $itm_nm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$itik.'" LIMIT 1')); - $txt = ' "'.$itm_nm['name'].'"'; - }else{ - //- - if( $itik == -1 ) { - // - $arts_1 = array(); - $arts_lvl = $u->info['level']; - if( $arts_lvl < 4 ) { - $arts_lvl = 4; - }elseif( $arts_lvl > 10 ) { - $arts_lvl = 10; - } - $sp1 = mysql_query('SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl='.$arts_lvl.'%" AND `data` NOT LIKE "%|tr_s5=%" AND `data` NOT LIKE "%|add_s6=%" AND `data` NOT LIKE "%|tr_s6=%"'); - while( $pl1 = mysql_fetch_array($sp1) ) { - $arts_1[] = $pl1['items_id']; - } - $arts_1 = $arts_1[rand(0,count($arts_1)-1)]; - if( $arts_1 > 0 ) { - $u->addItem($arts_1,$u->info['id'],'|sroknext=1|nosale=1|sleep_moroz=1|srok='.(86400/2).'',NULL,100); - } - $itm_nm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$arts_1.'" LIMIT 1')); - - $txt = ' "'.$itm_nm['name'].'" 12 .'; - }elseif( $itik == -2 ) { - // - $arts_1 = array(); - $arts_lvl = $u->info['level']; - if( $arts_lvl < 4 ) { - $arts_lvl = 4; - }elseif( $arts_lvl > 10 ) { - $arts_lvl = 10; - } - $sp1 = mysql_query('SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl='.$arts_lvl.'%" AND ( `data` LIKE "%|tr_s6=%" OR `data` LIKE "%|add_s6=%")'); - while( $pl1 = mysql_fetch_array($sp1) ) { - $arts_1[] = $pl1['items_id']; - } - $arts_1 = $arts_1[rand(0,count($arts_1)-1)]; - if( $arts_1 > 0 ) { - $u->addItem($arts_1,$u->info['id'],'|sroknext=1|nosale=1|sleep_moroz=1|srok='.(86400/2).'',NULL,100); - } - $itm_nm = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$arts_1.'" LIMIT 1')); - - $txt = ' "'.$itm_nm['name'].'" 12 .'; - }elseif( $itik == -3 ) { - // +1 - mysql_query('DELETE FROM `users_ico` WHERE `uid` = "'.$u->info['id'].'" AND (`img` = "helloween_2014m1.gif" OR `img` = "helloween_2014m2.gif")'); - mysql_query('INSERT INTO `users_ico` (`uid`,`time`,`text`,`img`,`endTime`,`bonus`,`type`,`x`) VALUES ( - "'.$u->info['id'].'", - "'.time().'", - "`'.date('Y').'
    !", - "helloween_2014m1.gif", - "'.(time()+86400*365).'", - "add_m10=15|add_m11=15", - "1", - "1" - )'); - $txt = ' "`'.date('Y').' "'; - }elseif( $itik == -4 ) { - // +5 - mysql_query('DELETE FROM `users_ico` WHERE `uid` = "'.$u->info['id'].'" AND (`img` = "helloween_2014m1.gif" OR `img` = "helloween_2014m2.gif")'); - mysql_query('INSERT INTO `users_ico` (`uid`,`time`,`text`,`img`,`endTime`,`bonus`,`type`,`x`) VALUES ( - "'.$u->info['id'].'", - "'.time().'", - "`'.date('Y').'
    !", - "helloween_2014m2.gif", - "'.(time()+86400*365).'", - "add_m10=15|add_m11=15", - "1", - "1" - )'); - $txt = ' "`'.date('Y').' "'; - } - } - } - }else{ - $txt = ' ...'; - } - }else{ - $txt = ' ...'; - } - - if($txt!=''){ - $txt = '
    '.$txt.''; - } - $pg = 3; - } elseif($act[0]=='transfer1' && $go1 == 1) { - // - // ... , ! - $pg = $act[1]; $itms = array(); - $sp = mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "1002" OR `item_id` = "1003" OR `item_id` = "1004" OR `item_id` = "1005" OR (`item_id` >= "1009" AND`item_id` <= "1014")) AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250'); - while($pl = mysql_fetch_array($sp)) { - $itms[$pl['item_id']]++; - } - // - $cn = array( - 0 => 3, //- - 1 => array( - // - 1 => array('n'=>'',0=>1002,1=>3,7=>9,8=>15), - // - 2 => array('n'=>'',0=>1003,1=>1,7=>3,8=>5), - // - 3 => array('n'=>'',0=>1005,1=>(1/3),7=>1,8=>2), - 'add' => array(0=>1006,1=>'') // , - ), // - 2 => array( - // - 1 => array('n'=>' ',0=>1009,1=>3,7=>9,8=>15), - // - 2 => array('n'=>' ',0=>1010,1=>1,7=>3,8=>5), - // - 3 => array('n'=>' ',0=>1011,1=>(1/3),7=>1,8=>2), - 'add' => array(0=>1007,1=>' ') // , - ), // - 3 => array( - // - 1 => array('n'=>' ',0=>1012,1=>3,7=>9,8=>15), - // - 2 => array('n'=>' ',0=>1013,1=>1,7=>3,8=>5), - // - 3 => array('n'=>' ',0=>1014,1=>(1/3),7=>1,8=>2), - 'add' => array(0=>1008,1=>' ') // , - ) // - ); - - $i = 1; - while($i<=$cn[0]) - { - $j = 1; - while($jtrnObj($itms[$cn[$i][$j][0]],$this->objLevel($cn[$i][$j],$u->info['level'])); - if($t[0]>0) - { - // $t[0] - , $cn[$i]['add'][0] - item_id - // - $upd = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.$cn[$i][$j][0].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" LIMIT '.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).''); - if($upd) - { - $data = '|frompisher='.$d->info['id2']; - $e = 1; - while($e<=$t[0]) - { - $u->addItem($cn[$i]['add'][0],$u->info['id'],$data); - $e++; - } - $txt .= $cn[$i][$j]['n'].' x'.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).' = '.$cn[$i]['add'][1].' x'.$t[0].'
    '; - }else{ - $txt .= ' "'.$cn[$i][$j]['n'].'", - ...
    '; - } - } - $j++; - } - $i++; - } - - if($txt!='') { - $txt = '
    '.$txt.''; - } - } elseif($act[0]=='transfer3' && $go1 == 1) { - // ... , ! - // , 3 1 - $pg = $act[1]; $itms = array(); - $sp = mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "1007" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250'); - while($pl = mysql_fetch_array($sp)) { - $itms[$pl['item_id']]++; - } - // - $cn = array( - 0 => 1, //- - 1 => array( - // - 1 => array('n'=>' ',0=>1007,1=>3,7=>3,8=>3), - 'add' => array(0=>1008,1=>' ') // , - ) - ); - - $i = 1; - while($i<=$cn[0]) - { - $j = 1; - while($jtrnObj($itms[$cn[$i][$j][0]],$this->objLevel($cn[$i][$j],$u->info['level'])); - if($t[0]>0) - { - // $t[0] - , $cn[$i]['add'][0] - item_id - // - $upd = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.$cn[$i][$j][0].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" LIMIT '.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).''); - if($upd) - { - $data = '|frompisher='.$d->info['id2']; - $e = 1; - while($e<=$t[0]) - { - $u->addItem($cn[$i]['add'][0],$u->info['id'],$data); - $e++; - } - $txt .= $cn[$i][$j]['n'].' x'.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).' = '.$cn[$i]['add'][1].' x'.$t[0].'
    '; - }else{ - $txt .= ' "'.$cn[$i][$j]['n'].'", - ...
    '; - } - } - $j++; - } - $i++; - } - - if($txt!='') { - $txt = '
    '.$txt.''; - } - } elseif($act[0]=='transfer4' && $go1 == 1) { - // ... , ! - // , 20 1 - $pg = $act[1]; $itms = array(); - $sp = mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "4728" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250'); - while($pl = mysql_fetch_array($sp)) { - $itms[$pl['item_id']]++; - } - // - $cn = array( - 0 => 1, //- - 1 => array( - // - 1 => array('n'=>'',0=>4728,1=>20,7=>20,8=>20), - 'add' => array(0=>1008,1=>' ') // , - ) - ); - - $i = 1; - while($i<=$cn[0]) - { - $j = 1; - while($jtrnObj($itms[$cn[$i][$j][0]],$this->objLevel($cn[$i][$j],$u->info['level'])); - if($t[0]>0) - { - // $t[0] - , $cn[$i]['add'][0] - item_id - // - $upd = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.$cn[$i][$j][0].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" LIMIT '.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).''); - if($upd) - { - $data = '|frompisher='.$d->info['id2']; - $e = 1; - while($e<=$t[0]) - { - $u->addItem($cn[$i]['add'][0],$u->info['id'],$data); - $e++; - } - $txt .= $cn[$i][$j]['n'].' x'.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).' = '.$cn[$i]['add'][1].' x'.$t[0].'
    '; - }else{ - $txt .= ' "'.$cn[$i][$j]['n'].'", - ...
    '; - } - } - $j++; - } - $i++; - } - - if( $txt == '' ) { - $txt = ' 20 .'; - } - - if($txt!='') { - $txt = '
    '.$txt.''; - } - }elseif($act[0]=='transferSpells30' && $go1 == 1) { - - //2553 2554 - - $keypr1 = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = "2553" LIMIT 1')); - $keypr2 = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = "2554" LIMIT 1')); - - $txt = ''; - - if(isset($keypr1['id'],$keypr2['id'])) { - mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$keypr1['id'].'" OR `id` = "'.$keypr2['id'].'" LIMIT 2'); - $data = '|frompisher='.$d->info['id2']; - $u->addItem(2555,$u->info['id'],$data); - $txt = ' " "'; - } - - if( $txt == '' ) { - $txt = ' ...'; - } - - if($txt!='') { - $txt = '
    '.$txt.''; - } - - }elseif($act[0]=='transferSpells31' && $go1 == 1) { - - $pg = $act[1]; $itms = array(); - $sp = mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "2560" OR `item_id` = "2564" OR `item_id` = "2568" OR `item_id` = "2572" OR `item_id` = "2576") AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250'); - while($pl = mysql_fetch_array($sp)) { - $itms[$pl['item_id']]++; - } - - $keypr = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = "2555" LIMIT 1')); - if(!isset($keypr['id'])) { - $itms = array(); - $txt = ' " ", ...'; - } - - // - $cn = array( - 0 => 5, //- - 1 => array( - 1 => array('n'=>' [0]',0=>2560,8=>3,'add'=>array(2561,' [1]')), - 2 => array('n'=>' [0]',0=>2564,8=>3,'add'=>array(2565,' [1]')), - 3 => array('n'=>' [0]',0=>2568,8=>3,'add'=>array(2569,' [1]')), - 4 => array('n'=>' [0]',0=>2572,8=>3,'add'=>array(2573,' [1]')), - 5 => array('n'=>' [0]',0=>2576,8=>3,'add'=>array(2577,' [1]')) - ) - ); - - $i = 1; - while($i<=$cn[0]) - { - $j = 1; - while($j<=$cn[0]) - { - $t = $cn[$i][$j]; - $t = $this->trnObj($itms[$cn[$i][$j][0]],$this->objLevel($cn[$i][$j],8)); - if($t[0]>0) - { - $upd = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.$cn[$i][$j][0].'" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT '.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).''); - if($upd) - { - $data = '|frompisher='.$d->info['id2']; - $e = 1; - while($e<=$t[0]) - { - $u->addItem($cn[$i][$j]['add'][0],$u->info['id'],$data); - $e++; - } - mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$keypr['id'].'" LIMIT 1'); - $txt .= $cn[$i][$j]['n'].' x'.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).' = '.$cn[$i][$j]['add'][1].' x'.$t[0].'
    '; - }else{ - $txt .= ' "'.$cn[$i][$j]['n'].'", - ...
    '; - } - $i = $cn[0]; - $j = count($cn[$i][$j]); - } - $j++; - } - $i++; - } - - if( $txt == '' ) { - $txt = ' ...'; - } - - if($txt!='') { - $txt = '
    '.$txt.''; - } - - }elseif($act[0]=='transferSpells32' && $go1 == 1) { - - $pg = $act[1]; $itms = array(); - $sp = mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "2561" OR `item_id` = "2565" OR `item_id` = "2569" OR `item_id` = "2573" OR `item_id` = "2577") AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250'); - while($pl = mysql_fetch_array($sp)) { - $itms[$pl['item_id']]++; - } - - $keypr = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = "2555" LIMIT 1')); - if(!isset($keypr['id'])) { - $itms = array(); - $txt = ' " ", ...'; - } - - // - $cn = array( - 0 => 5, //- - 1 => array( - 1 => array('n'=>' [1]',0=>2561,8=>3,'add'=>array(2562,' [2]')), - 2 => array('n'=>' [1]',0=>2565,8=>3,'add'=>array(2566,' [2]')), - 3 => array('n'=>' [1]',0=>2569,8=>3,'add'=>array(2570,' [2]')), - 4 => array('n'=>' [0]',0=>2573,8=>3,'add'=>array(2574,' [2]')), - 5 => array('n'=>' [1]',0=>2577,8=>3,'add'=>array(2578,' [2]')) - ) - ); - - $i = 1; - while($i<=$cn[0]) - { - $j = 1; - while($j<=$cn[0]) - { - - $t = $cn[$i][$j]; - $t = $this->trnObj($itms[$cn[$i][$j][0]],$this->objLevel($cn[$i][$j],8)); - if($t[0]>0) - { - $upd = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.$cn[$i][$j][0].'" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT '.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).''); - if($upd) - { - $data = '|frompisher='.$d->info['id2']; - $e = 1; - while($e<=$t[0]) - { - $u->addItem($cn[$i][$j]['add'][0],$u->info['id'],$data); - $e++; - } - mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$keypr['id'].'" LIMIT 1'); - $txt .= $cn[$i][$j]['n'].' x'.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).' = '.$cn[$i][$j]['add'][1].' x'.$t[0].'
    '; - }else{ - $txt .= ' "'.$cn[$i][$j]['n'].'", - ...
    '; - } - $i = $cn[0]; - $j = count($cn[$i][$j]); - } - $j++; - } - $i++; - } - - if( $txt == '' ) { - $txt = ' ...'; - } - - if($txt!='') { - $txt = '
    '.$txt.''; - } - - }elseif($act[0]=='transferSpells33' && $go1 == 1) { - - $pg = $act[1]; $itms = array(); - $sp = mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "2562" OR `item_id` = "2566" OR `item_id` = "2570" OR `item_id` = "2574" OR `item_id` = "2578") AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 250'); - while($pl = mysql_fetch_array($sp)) { - $itms[$pl['item_id']]++; - } - - $keypr = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = "2555" LIMIT 1')); - if(!isset($keypr['id'])) { - $itms = array(); - $txt = ' " ", ...'; - } - - // - $cn = array( - 0 => 5, //- - 1 => array( - 1 => array('n'=>' [0]',0=>2562,8=>3,'add'=>array(2563,' [3]')), - 2 => array('n'=>' [0]',0=>2566,8=>3,'add'=>array(2567,' [3]')), - 3 => array('n'=>' [0]',0=>2570,8=>3,'add'=>array(2571,' [3]')), - 4 => array('n'=>' [0]',0=>2574,8=>3,'add'=>array(2575,' [3]')), - 5 => array('n'=>' [0]',0=>2578,8=>3,'add'=>array(2579,' [3]')) - ) - ); - - $i = 1; - while($i<=$cn[0]) - { - $j = 1; - while($j<=$cn[0]) - { - - $t = $cn[$i][$j]; - $t = $this->trnObj($itms[$cn[$i][$j][0]],$this->objLevel($cn[$i][$j],8)); - if($t[0]>0) - { - $upd = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.$cn[$i][$j][0].'" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT '.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).''); - if($upd) - { - $data = '|frompisher='.$d->info['id2']; - $e = 1; - while($e<=$t[0]) - { - $u->addItem($cn[$i][$j]['add'][0],$u->info['id'],$data); - $e++; - } - $txt .= $cn[$i][$j]['n'].' x'.($t[0]*$this->objLevel($cn[$i][$j],$u->info['level'])).' = '.$cn[$i][$j]['add'][1].' x'.$t[0].'
    '; - mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$keypr['id'].'" LIMIT 1'); - }else{ - $txt .= ' "'.$cn[$i][$j]['n'].'", - ...
    '; - } - $i = $cn[0]; - $j = count($cn[$i][$j]); - } - $j++; - } - $i++; - } - - if( $txt == '' ) { - $txt = ' ...'; - } - - if($txt!='') { - $txt = '
    '.$txt.''; - } - - }elseif( $act[0] == 'GoHrumpShop' && $go1 == 1) { // ( ) - mysql_query('UPDATE `stats` SET `x` = "6",`y` = "73" WHERE `id` = "'.$u->info['id'].'" AND `dnow` = "'.$u->info['dnow'].'" LIMIT 1'); - header('location: main.php'); - die(); - }elseif( $act[0] == 'swapItem' && $go1 == 1) { - $txt = ''; - $swapItem = $act[1]; - $swapError = $act[2]; - $swapTrue = $act[3]; - # ( ) - if( !isset($swapActStatus) ) $swapActStatus = 1; # , ! - $swapAct = array(); # . - $temp = explode ("\\", $swapItem); - foreach ( $temp as $t ) { - $t = explode('=', $t); - if( $t[0] == 'tr' ) { // - $temp2 = explode(',', $t[1]); $tr_items = array(); - foreach( $temp2 as $t2 ) { - $temp3 = explode('x', $t2); - if( !isset($temp3[1]) ) $temp3[1] = 1; // , 1. - if( isset($temp3[2]) && $temp3[2]=='del' ) $temp3[2] = true; else $temp3[2]=false; // ! - $tr_items[] = array('item_id' => $temp3[0], 'colvo' => (int)$temp3[1], 'delete' => $temp3[2]); - } - $swapAct['tr'] = $tr_items; - - } elseif( $t[0] == 'needQuest' ){ // - . - - } elseif( $t[0] == 'needRep' ){ // - $temp2 = explode(',', $t[1]); $need_rep = array(); - $need_rep[] = array('city' => $temp2[0], 'rep' => (int)$temp2[1]); - - $swapAct['need_rep'] = $need_rep; - - } elseif( $t[0] == 'add' ){ // . - $temp2 = explode(',', $t[1]); $add_items = array(); - foreach($temp2 as $t2) { - $temp3 = explode('x', $t2); - if( !isset($temp3[1]) ) $temp3[1] = 1; // , 1. - $add_items[] = array('item_id' => $temp3[0], 'colvo' => (int)$temp3[1]); - } - $swapAct['add'] = $add_items; - } elseif( $t[0] == 'uses' ){ // - $swapAct['uses'] = $t[1]; - } - } // . - unset($temp,$temp2,$temp3,$t2,$tr_items,$add_items); - - if( $swapActStatus == 0 ) { - $txt = ' , !'; - $pg = $swapError; - } elseif ( isset($swapAct['need_rep']) ) { # . - foreach($swapAct['need_rep'] as $rep) { # - if($u->rep['rep'.$rep['city']] < $rep['rep'] ) { - $swapActStatus = 0; - $txt = ' , !'; - $pg = $swapError; - } - } - } - - if( isset($swapAct['uses']) ) { # . - #$swapAct['uses'] = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `room` = "'.$u->info['room'].'" AND `vals` = "masteryUses'.$u->info['dnow'].'" ORDER BY `id` DESC LIMIT '.$swapAct['uses'] .'')); - if( isset($swapAct['uses']['id']) ) { - $swapActStatus = 0; - $txt = '- , ...'; - $pg = 0; - } - } - - if( isset($swapAct['tr']) AND $swapActStatus == 1 ) { # . - foreach($swapAct['tr'] as $item) { # . - $item_info = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$item['item_id'].'" LIMIT 1')); - if( isset($item_info['id']) ) { - $query = mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.$item['item_id'].'" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.$item['colvo'].''); - $j=0; - while( $t = mysql_fetch_array($query) ) { - $j++; - } - if( $j < $item['colvo'] ) { - $txt .= ' "'.$item_info['name'].'"! ('.$item['item_id'].')
    '; - $swapActStatus = 3; - $pg = $swapError; - } elseif( $swapActStatus != 3) { - $swapActStatus = 2; - } - } - } - } - - if( isset($swapAct['tr']) AND $swapActStatus == 3 ) { # del==true. - $mess = ' : '; - $qsw = 0; - foreach($swapAct['tr'] as $item) { # . - if ( $item['delete'] == true ){ - $query = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `item_id` = "'.$item['item_id'].'" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "0" AND `inOdet` = "0" ORDER BY inGroup DESC LIMIT '.$item['colvo'].''); - if($query){ - $item_info = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$item['item_id'].'" LIMIT 1')); - if( $qsw > 0 ) $mess .=', '; - $mess .= '"'.$item_info['name'].'"'; - if( $item['colvo'] > 1 ) $mess .= '('.$item['item_id'].')'; - $qsw++; - } - } - } - $mess .= '.
    '; - if( $qsw > 0 ) $txt .= $mess; - } elseif( isset($swapAct['tr']) AND $swapActStatus == 2 ) { # . - $mess = ' : '; - $qsw = 0; - foreach($swapAct['tr'] as $item) { - $query = mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `item_id` = "'.$item['item_id'].'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY inGroup DESC LIMIT '.$item['colvo'].''); - if($query) { - $item_info = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$item['item_id'].'" LIMIT 1')); - if( $qsw > 0 ) $mess .=', '; - $mess .= '"'.$item_info['name'].'"'; - if( $item['colvo'] > 1 ) $mess .= '('.$item['item_id'].')'; - $qsw++; - } - } - $mess .= '.
    '; - if( $qsw > 0 ) $txt .= $mess; - } - - if( isset($swapAct['add']) AND $swapActStatus == 2 ) { # . - foreach($swapAct['add'] as $item) { - $qsw = 0; - while($qsw < $item['colvo']) { - $txt .= '
    '; - $u->addItem($item['item_id'],$u->info['id']); - $qsw++; - } - } - - mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("'.$u->info['id'].'","'.time().'","'.$u->info['city'].'","'.$u->info['room'].'", "","'.mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']).'", "masteryUses'.$u->info['dnow'].'")'); - $pg = $swapTrue; - } - if( $txt != '' ) { - $txt = '
    '.$txt.''; - } - } - } - } - } - - if($this->info['tr_room']!=0 && $this->info['tr_room']!=$u->info['room']) - { - $go = 0; - } - - if($this->info['tr_dn']!=0) { - // - global $d; - if($this->info['tr_dn']!=$d->info['id2']) - { - $go = 0; - }elseif($this->info['x']!=0 || $this->info['y']!=0) - { - if($d->testLike($u->info['x'],$u->info['y'],$this->info['x'],$this->info['y'])!=1) - { - $go = 0; - } - // - $dbot = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_bots` WHERE `dn` = "'.$u->info['dnow'].'" AND `x` = "'.$this->info['x'].'" AND `y` = "'.$this->info['y'].'" LIMIT 1')); - if(!isset($dbot['id2'])) - { - $go = 0; - } - } - } - - if($go==1) { - //dlg_nps:=:3=7 - // ( ) - $qs_sp = mysql_query('SELECT `id`,`act_date` FROM `quests` WHERE `act_date` LIKE "%dlg_nps:=:'.$this->info['id'].'='.$pg.'=1=e%" LIMIT 1'); - while($qs_pl = mysql_fetch_array($qs_sp)) { - $q->endq($qs_pl['id'],'win'); - $gsex = explode('=e'.$this->info['id'].$pg.'=',$qs_pl['act_date']); - if($gsex[1] > 0) { - // - $q->startq($gsex[1]); - $txt .= '
    '; - } - } - - // ( ) - $qs_sp = mysql_query('SELECT `id`,`act_date` FROM `quests` WHERE `act_date` LIKE "%dlg_nps:=:'.$this->info['id'].'='.$pg.'=0=e%" LIMIT 1'); - while($qs_pl = mysql_fetch_array($qs_sp)) { - $q->endq($qs_pl['id'],'end'); - $gsex = explode('=e'.$this->info['id'].$pg.'=',$qs_pl['act_date']); - if($gsex[1] > 0) { - // $gsex[1] - $q->startq($gsex[1]); - $txt .= '
    '; - } - } - - $this->title = $this->info['text']; - $this->youInfo = $u->getInfoPers($u->info['id'],1); - $this->youInfo = $this->youInfo[0]; - $this->botInfo = $this->infoBot($this->info['bot_id']); - // - $qpl = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_dlg` WHERE `type` = "1" AND `qid` = "0" AND `id_dg` = "'.$this->info['id'].'" AND `page` = "'.((int)$pg).'" LIMIT 1')); - if( !isset($qpl['id']) ) { - if($txt == '' ){ - $qpl['text'] = ' ...'; - } else { - $qpl['text'] = $txt.' ()'; - $txt = ''; - } - } else { - $this->pg = $qpl['id']; - } - - if( $u->info['admin'] > 0 ) { - if( isset($_GET['add_new_qid']) ) { - mysql_query('INSERT INTO `dungeon_dlg` (`type`,`qid`,`id_dg`,`text`) VALUES ("0","'.$qpl['id'].'","'.$this->info['id'].'"," ")'); - } - } - - // - $a = ''; - $sp = mysql_query('SELECT * FROM `dungeon_dlg` WHERE `type` = "0" AND `qid` = "'.$qpl['id'].'" AND `id_dg` = "'.$this->info['id'].'" ORDER BY `sort` DESC LIMIT 25'); - while($pl = mysql_fetch_array($sp)) - { - $pl['action'] = $this->ltr($pl['action']); - $act = explode('|',$pl['action']); - if(isset($act[1])) - { - $pl['action'] = 'main.php?talk='.$this->info['id'].'&act='.$pl['id'].'&rnd='.$code; - } - $go1 = ''; - if($pl['tr'] != '') { - $i = 0; - $x = explode('|',$pl['tr']); - while($i < count($x)) { - // - $k = explode('=',$x[$i]); - if($k[0]=='data') { - $date = explode('-',$k[1]); - $dd1 = $date[0]; - $mm1 = $date[1]; - $dd2 = $date[2]; - $mm2 = $date[3]; - $date1 = strtotime($dd1.'-'.$mm1.'-'.date('Y')); - $date2 = strtotime($dd2.'-'.$mm2.'-'.date('Y')); - - if( $date1 > time() || $date2 < time() ) { - $go1 = 'delete'; - $i = count($x); - } - - }elseif($k[0]=='diact') { - // - //user_id # all # all # lukaqst1 # -1 - if($this->quest_act($k[1])==false) { - $go1 = 'delete'; - $i = count($x); - } - - }elseif($k[0]=='quest_end') { - // - $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$k[1].'" ORDER BY `id` DESC LIMIT 1')); - if(isset($qlst['id']) && $qlst['vals'] != 'win' && $qlst['vals'] != 'end' && $qlst['vals'] != 'bad') { - //$go1 .= " \n"; - $go1 = 'delete'; - $i = count($x); - } - }elseif($k[0]=='quest_only_one') { - // - $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$k[1].'" ORDER BY `id` DESC LIMIT 1')); - if(isset($qlst['id']) && ($qlst['vals'] == 'win' || $qlst['vals'] == 'bad')) { - //$go1 .= " \n"; - $go1 = 'delete'; - $i = count($x); - } - }elseif($k[0]=='quest_now') { - // - $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$k[1].'" ORDER BY `id` DESC LIMIT 1')); - if(isset($qlst['id']) && $qlst['vals'] != 'win' && $qlst['vals'] != 'end' && $qlst['vals'] != 'bad'){}else{ - $go1 = 'delete'; - $i = count($x); - } - }elseif($k[0]=='tr_itm') { - // - $qlst = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.$k[1].'" AND `inOdet` = 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if($qlst[0] < $k[2]){ - $go1 = 'delete'; - $i = count($x); - } - }elseif($k[0]=='tr_itmodet') { - // - $k[1] = str_replace(',','" OR `item_id` = "',$k[1]); - $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "'.$k[1].'") AND `inOdet` > 0 AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if(!isset($qlst['id'])){ - $go1 = 'delete'; - $i = count($x); - } - }elseif($k[0]=='tr_noitmodet') { - // - $k[1] = str_replace(',','" OR `item_id` = "',$k[1]); - $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "'.$k[1].'") AND `inTransfer` = 0 AND `inOdet` > 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if(isset($qlst['id'])){ - $go1 = 'delete'; - $i = count($x); - } - }elseif($k[0]=='tr_noitm') { - // - $k[1] = str_replace(',','" OR `item_id` = "',$k[1]); - $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "'.$k[1].'") AND `inTransfer` = 0 AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if(isset($qlst['id'])){ - $go1 = 'delete'; - $i = count($x); - } - } - $i++; - } - } - if($u->info['admin'] > 0) { - $a .= '(.)   '; - } - if($go1 == '') { - $a .= '• '.$pl['text'].'
    '; - }elseif($go1 == 'delete') { - if( $u->info['admin'] > 0 ) { - $a .= '• '.$pl['text'].'
    '; - } - }else{ - $a .= ''.$pl['text'].' [?]
    '; - } - } - - - if($u->info['admin'] > 0) { - $a .= ' '; - } - - $this->dText = $qpl['text'].'
    '.$txt; - $this->aText = $a; - }else{ - $this->aText = '
    ,
    '; - } - }else{ - $this->aText = '
    ,
    '.((int)$id).'
    '; - } - } - - public function dialog_act_update($data) { - global $u; - $r = array(false,''); - $x = explode('#',$data); - $i = 0; - while( $i < count($x) ) { - $k = explode('=',$x[$i]); - $var = $k[0]; - $val = $k[1]; - if( $var == 'take_item' ) { - // - $itms = array(); - $sp = mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `item_id` = "'.mysql_real_escape_string($val).'" AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = "0" AND `inShop` = "0" LIMIT 100'); - while($pl = mysql_fetch_array($sp)) { - $itms[$pl['item_id']]++; - } - - if($itms[$val] >= $k[2]) { - //$u->deleteItemID($val,$u->info['id'],$k[2]); - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `item_id` = "'.mysql_real_escape_string($val).'" AND `uid` = "'.$u->info['id'].'" AND `inShop` = 0 AND `inTransfer` = 0 AND (`delete` = "0" OR `delete` = "1000") AND `inOdet` = 0 LIMIT '.round($k[2])); - }else{ - $i = count($x); - $r[0] = false; - $itm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$val.'" LIMIT 1')); - $r[1] = ' ! "'.$itm['name'].'"'; - if( $k[2] > 1 ) { - $r[1] .= ' ('.$k[2].' .)'; - } - } - // - }elseif( $var == 'add_item' ) { - $data_itm = '|frompisher=1'; - $i1 = 0; - while( $i1 < $k[2] ) { - if( $val == 4797 ) { - // - if( $u->info['level'] >= 4 && $u->info['level'] <= 7 ) { - $val = 4797; - }elseif( $u->info['level'] >= 8 && $u->info['level'] <= 9 ) { - $val = 4798; - }else{ - $val = 4799; - } - } - $u->addItem($val,$u->info['id'],$data_itm); - $i1++; - } - }elseif( $var == 'up' ) { - $tqst = mysql_fetch_array(mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "'.$u->info['id'].'" AND `var` = "'.mysql_real_escape_string($val).'" ORDER BY `id` DESC LIMIT 1')); - if(!isset($tqst['id'])) { - mysql_query('INSERT INTO `dialog_act` ( - `uid`,`city`,`time`,`var`,`val` - ) VALUES ( - "'.$u->info['id'].'","'.$u->info['city'].'","'.time().'","'.mysql_real_escape_string($val).'","'.mysql_real_escape_string($k[2]).'" - )'); - }else{ - mysql_query('UPDATE `dialog_act` SET `val` = "'.mysql_real_escape_string($k[2]).'" WHERE `uid` = "'.$u->info['id'].'" AND `var` = "'.mysql_real_escape_string($val).'" ORDER BY `id` DESC LIMIT 1'); - } - }elseif( $var == 'finish' ) { - $r[0] = true; - $r[1] = $val; - } - $i++; - } - return $r; - } - - public function quest_act($data) { - global $u; - // - $r = true; - // - $f = explode('#',$data); - $ql = mysql_fetch_array(mysql_query('SELECT * FROM `dialog_act` WHERE `var` = "'.mysql_real_escape_string($f[3]).'" AND `uid` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1')); - if(isset($ql['id'])) { - //user_id # all # all # lukaqst1 # -1 - if( $f[0] == 'user_id' ) { - $f[0] = $u->info['id']; - } - // - if( $f[0] != $ql['uid'] && $f[0] != 'all' ) { - $r = false; - }elseif( $f[1] != $ql['city'] && $f[1] != 'all' ) { - $r = false; - }elseif( $f[2] != $ql['time'] && $f[2] != 'all' ) { - $r = false; - }elseif( $f[3] != $ql['var'] && $f[3] != 'all' ) { - $r = false; - }elseif( $f[4] == -1 ) { - // - $r = false; - }elseif( $f[4] != $ql['val'] ) { - $r = false; - }elseif( $f[5] == 1 && $ql['now'] < $ql['max'] ) { - $r = false; - } - }else{ - if( $f[4] != -1 ) { - $r = false; - } - } - // - return $r; - } - - public function ltr($v) - { - - return $v; - } - - public function infoBot($id) - { - global $c,$code; - $r = ''; - $bot = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.((int)$id).'" LIMIT 1')); - if(isset($bot['id'])) - { - // - $witm = array(); - $witm[1] = ''; - $witm[2] = ''; - $witm[3] = ''; - $witm[4] = ''; - $witm[7] = ''; - $witm[8] = ''; - $witm[9] = ''; - $witm[10] = ''; - $witm[11] = ''; - $witm[12] = ''; - $witm[13] = ''; - $witm[14] = ''; - $witm[16] = ''; - $witm[17] = ''; - //40-52 - $witm[53] = ''; - $witm[54] = ''; - $witm[55] = ''; - $witm[56] = ''; - $witm[57] = ''; - $witm[58] = ''; - - $pb = ''; - $hpmp = '?? '; - $eff = ''; - $anml = ''; - $oi = ''; - $msl = ''; - $witmg = ''; - - if( $bot['level'] < 0 ) { - $bot['level'] = '??'; - } - - $r = '
    '.$bot['login'].' ['.$bot['level'].']
    -
    -
    '.$pb.'
    - - - - - - -
    - - - - - - - - - - - - - - - - -
    '.$witm[1].'
    '.$witm[2].'
    '.$witm[3].'
    '.$witm[4].'
    '.$witm[7].'
    -
    - - - - - - - - - - -
    - - '.$hpmp.' - -
    -
    - -
    -
    '.$eff.'
    '.$anml.' -
    -
    '.$msl.'
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    '.$witm[8].'
    '.$witm[9].'
    - - - - - -
    '.$witm[10].''.$witm[11].''.$witm[12].'
    '.$witm[13].'
    '.$witm[14].'
    '.$witm[16].'
    '.$witm[17].'
    -
    '.$witmg.' -
    '; - }else{ - $r = 'No information'; - } - return $r; - } -} - -$dialog = new dialog; -?> \ No newline at end of file diff --git a/_incl_data/class/dnaction/_dungeon_replace.php.bac b/_incl_data/class/dnaction/_dungeon_replace.php.bac deleted file mode 100644 index d9453e6a..00000000 --- a/_incl_data/class/dnaction/_dungeon_replace.php.bac +++ /dev/null @@ -1,504 +0,0 @@ -info['battle'] != 0) { header('location: main.php'); die(); } - -if(isset($_POST['clip76_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4677" LIMIT 1')); - if($u->count_items(877, $u->info['id'], 1) > 0) { - if($u->count_items(882, $u->info['id'], 1) > 0) { - if($u->count_items(902, $u->info['id'], 1) > 0) { - if($u->count_items(903, $u->info['id'], 1) > 0) { - if($u->count_items(881, $u->info['id'], 1) > 0) { - if($u->count_items(878, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4677, $u->info['id'], $data, $obj); - $u->deleteItemID(877, $u->info['id'], 1); - $u->deleteItemID(882, $u->info['id'], 1); - $u->deleteItemID(902, $u->info['id'], 1); - $u->deleteItemID(903, $u->info['id'], 1); - $u->deleteItemID(881, $u->info['id'], 1); - $u->deleteItemID(878, $u->info['id'], 1); - $err = ' '; - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " """; - } -} elseif(isset($_POST['clip80_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4758" LIMIT 1')); - if($u->count_items(950, $u->info['id'], 1) > 0) { - if($u->count_items(907, $u->info['id'], 1) > 0) { - if($u->count_items(902, $u->info['id'], 1) > 0) { - if($u->count_items(878, $u->info['id'], 1) > 0) { - if($u->count_items(905, $u->info['id'], 1) > 0) { - if($u->count_items(903, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4758, $u->info['id'], $data, $obj); - $u->deleteItemID(950, $u->info['id'], 1); - $u->deleteItemID(907, $u->info['id'], 1); - $u->deleteItemID(902, $u->info['id'], 1); - $u->deleteItemID(878, $u->info['id'], 1); - $u->deleteItemID(905, $u->info['id'], 1); - $u->deleteItemID(903, $u->info['id'], 1); - $u->deleteItemID(905, $u->info['id'], 1); - $err = ' '; - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } -} elseif(isset($_POST['clip81_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4679" LIMIT 1')); - if($u->count_items(906, $u->info['id'], 1) > 0) { - if($u->count_items(907, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4679, $u->info['id'], $data, $obj); - $u->deleteItemID(906, $u->info['id'], 1); - $u->deleteItemID(907, $u->info['id'], 1); - $err = ' '; - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } -} elseif(isset($_POST['clip82_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4680" LIMIT 1')); - if($u->count_items(877, $u->info['id'], 1) > 0) { - if($u->count_items(890, $u->info['id'], 1) > 0) { - if($u->count_items(902, $u->info['id'], 1) > 0) { - if($u->count_items(903, $u->info['id'], 1) > 0) { - if($u->count_items(888, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4680, $u->info['id'], $data, $obj); - $u->deleteItemID(877, $u->info['id'], 1); - $u->deleteItemID(890, $u->info['id'], 1); - $u->deleteItemID(902, $u->info['id'], 1); - $u->deleteItemID(903, $u->info['id'], 1); - $u->deleteItemID(888, $u->info['id'], 1); - $err = ' '; - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " """; - } -} elseif(isset($_POST['clip89_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4681" LIMIT 1')); - if($u->count_items(900, $u->info['id'], 1) > 0) { - if($u->count_items(882, $u->info['id'], 1) > 0) { - if($u->count_items(903, $u->info['id'], 1) > 0) { - if($u->count_items(904, $u->info['id'], 1) > 0) { - if($u->count_items(908, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4681, $u->info['id'], $data, $obj); - $u->deleteItemID(900, $u->info['id'], 1); - $u->deleteItemID(882, $u->info['id'], 1); - $u->deleteItemID(903, $u->info['id'], 1); - $u->deleteItemID(904, $u->info['id'], 1); - $u->deleteItemID(908, $u->info['id'], 1); - $err = ' '; - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } -} elseif(isset($_POST['clip90_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4682" LIMIT 1')); - if($u->count_items(950, $u->info['id'], 1) > 0) { - if($u->count_items(889, $u->info['id'], 1) > 0) { - if($u->count_items(902, $u->info['id'], 1) > 0) { - if($u->count_items(903, $u->info['id'], 1) > 0) { - if($u->count_items(878, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4682, $u->info['id'], $data, $obj); - $u->deleteItemID(950, $u->info['id'], 1); - $u->deleteItemID(889, $u->info['id'], 1); - $u->deleteItemID(902, $u->info['id'], 1); - $u->deleteItemID(906, $u->info['id'], 1); - $u->deleteItemID(878, $u->info['id'], 1); - $err = ' '; - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } -} elseif(isset($_POST['clip91_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4683" LIMIT 1')); - if($u->count_items(907, $u->info['id'], 1) > 0) { - if($u->count_items(881, $u->info['id'], 1) > 0) { - if($u->count_items(905, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4683, $u->info['id'], $data, $obj); - $u->deleteItemID(907, $u->info['id'], 1); - $u->deleteItemID(881, $u->info['id'], 1); - $u->deleteItemID(905, $u->info['id'], 1); - $err = ' '; - } else { - $err = " """; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } -} elseif(isset($_POST['clip92_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4684" LIMIT 1')); - if($u->count_items(907, $u->info['id'], 1) > 0) { - if($u->count_items(881, $u->info['id'], 1) > 0) { - if($u->count_items(905, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4684, $u->info['id'], $data, $obj); - $u->deleteItemID(907, $u->info['id'], 1); - $u->deleteItemID(881, $u->info['id'], 1); - $u->deleteItemID(905, $u->info['id'], 1); - $err = ' '; - } else { - $err = " """; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } -} elseif(isset($_POST['clip93_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4685" LIMIT 1')); - if($u->count_items(901, $u->info['id'], 1) > 0) { - if($u->count_items(889, $u->info['id'], 1) > 0) { - if($u->count_items(890, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4685, $u->info['id'], $data, $obj); - $u->deleteItemID(901, $u->info['id'], 1); - $u->deleteItemID(889, $u->info['id'], 1); - $u->deleteItemID(890, $u->info['id'], 1); - $err = ' : [1]'; - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } -} elseif(isset($_POST['clip94_'])) { - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "4686" LIMIT 1')); - if($u->count_items(4685, $u->info['id'], 1) > 0) { - if($u->count_items(4688, $u->info['id'], 1) > 0) { - if($u->count_items(4689, $u->info['id'], 1) > 0) { - if($u->count_items(4690, $u->info['id'], 1) > 0) { - $data = '|frompisher=12'; - $u->addItem(4686, $u->info['id'], $data, $obj); - $u->deleteItemID(4685, $u->info['id'], 1); - $u->deleteItemID(4688, $u->info['id'], 1); - $u->deleteItemID(4689, $u->info['id'], 1); - $u->deleteItemID(4690, $u->info['id'], 1); - $err = ' : [2]'; - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " ""; - } - } else { - $err = " " : [1]""; - } -} - - -function getColor($id, $num) { - global $u; - $color = 'green'; - $ch = mysql_query("SELECT `id` FROM `items_users` WHERE `uid` = ".$u->info['id']." AND `delete` = 0 AND `item_id` = ".(int)$id." AND inShop = 0 AND inOdet = 0"); - if(mysql_num_rows($ch) < $num) { $color = 'red'; } - return $color; -} - -function getImg($id, $num) { - global $u; - $img = 'good.png'; - $ch = mysql_query("SELECT `id` FROM `items_users` WHERE `uid` = ".$u->info['id']." AND `delete` = 0 AND `item_id` = ".(int)$id." AND inShop = 0 AND inOdet = 0"); - if(mysql_num_rows($ch) < $num) { $img = 'i/clear.gif'; } - return $img; -} - -?> - - - - - - - - - - - - -
    - - - - -
    - - - -

    -
     
    - -".$err.""; } ?> - - - - -
    - -
    - - -
    getStats($u->info['id'],1); $st2 = $st[1]; $st = $st[0]; $rgd = $u->regen($u->info['id'],$st,1); $us = $u->getInfoPers($u->info['id'],1,$st); if($us!=false){ echo $us[0]; }else{ echo 'information is lost.'; } ?>
    -
    -
    -

    -
    -

    - - - - -
    -
    -
    - - -
    - - -
    - - -
    - - -
    - - -
    - - -
    - - - -
    - - - - : [1]
    - - - - : [2]
    - -
    - . () - -
    -
    -
    - - - - - -
    - - - - -
    - - -
    - -
    -
    - - - -
    -
    -
    -
    - -
    - - \ No newline at end of file diff --git a/_incl_data/class/magic/Elemental/Fire.php b/_incl_data/class/magic/Elemental/Fire.php index 8483dd29..179e79b0 100644 --- a/_incl_data/class/magic/Elemental/Fire.php +++ b/_incl_data/class/magic/Elemental/Fire.php @@ -2,7 +2,7 @@ namespace Magic\Elemental; -use battleClass; +use Battle; use Insallah\Math; class Fire @@ -11,7 +11,7 @@ class Fire private $color = '#a00'; private $colorCrit = '#f00'; private $colorMiss = '#909090'; - public function __construct(battleClass $btl) + public function __construct(Battle $btl) { $this->btl = $btl; } diff --git a/_incl_data/class/magic/addrep.php b/_incl_data/class/magic/addrep.php index a1539f13..6fe78e90 100644 --- a/_incl_data/class/magic/addrep.php +++ b/_incl_data/class/magic/addrep.php @@ -1,180 +1,180 @@ -info['twink'] != 0 ) - { - $u->error = ' "'.$itm['name'].'". !'; - } -elseif( $u->info['activ'] != 0 ) - { - $u->error = ' "'.$itm['name'].'". E-mail!'; - } -elseif( $itm['id'] > 0 && $itm['item_id']==10006 ) - { - $repc='repcapitalcity'; - if ($u->rep[$repc]<25000) - { - $st['expUpg'] += 0; - $u->rep[$repc] += $st['expUpg']; - if ($u->rep[$repc]>25000) - { - $u->rep[$repc]=25000; - } - $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; - //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - else - { - $u->error = ' "'.$itm['name'].'". 25000 .!'; - } - } - - -elseif( $itm['id'] > 0 && $itm['item_id']==10007 ) - { - $repc='repsandcity'; - if ($u->rep[$repc]<25000) - { - $st['expUpg'] += 0; - $u->rep[$repc] += $st['expUpg']; - if ($u->rep[$repc]>25000) - { - $u->rep[$repc]=25000; - } - $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; - //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - else - { - $u->error = ' "'.$itm['name'].'". 25000 .!'; - } - } - -elseif( $itm['id'] > 0 && $itm['item_id']==10008 ) - { - $repc='repemeraldscity'; - if ($u->rep[$repc]<25000) - { - $st['expUpg'] += 0; - $u->rep[$repc] += $st['expUpg']; - if ($u->rep[$repc]>25000) - { - $u->rep[$repc]=25000; - } - $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; - //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - else - { - $u->error = ' "'.$itm['name'].'". 25000 .!'; - } - } - -elseif( $itm['id'] > 0 && $itm['item_id']==10009 ) - { - $repc='repabandonedplain'; - if ($u->rep[$repc]<25000) - { - $st['expUpg'] += 0; - $u->rep[$repc] += $st['expUpg']; - if ($u->rep[$repc]>25000) - { - $u->rep[$repc]=25000; - } - $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; - //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - else - { - $u->error = ' "'.$itm['name'].'". 25000 .!'; - } - } - -elseif( $itm['id'] > 0 && $itm['item_id']==10010 ) - { - $repc='repangelscity'; - if ($u->rep[$repc]<25000) - { - $st['expUpg'] += 0; - $u->rep[$repc] += $st['expUpg']; - if ($u->rep[$repc]>25000) - { - $u->rep[$repc]=25000; - } - $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; - //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - else - { - $u->error = ' "'.$itm['name'].'". 25000 .!'; - } - } - -elseif( $itm['id'] > 0 && $itm['item_id']==10011 ) - { - $repc='repdemonscity'; - if ($u->rep[$repc]<25000) - { - $st['expUpg'] += 0; - $u->rep[$repc] += $st['expUpg']; - if ($u->rep[$repc]>25000) - { - $u->rep[$repc]=25000; - } - $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; - //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - else - { - $u->error = ' "'.$itm['name'].'". 25000 .!'; - } - } - - -elseif( $itm['id'] > 0 && $itm['item_id']==10012 ) - { - $repc='repsuncity'; - if ($u->rep[$repc]<25000) - { - $st['expUpg'] += 0; - $u->rep[$repc] += $st['expUpg']; - if ($u->rep[$repc]>25000) - { - $u->rep[$repc]=25000; - } - $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; - //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); - - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - else - { - $u->error = ' "'.$itm['name'].'". 25000 .!'; - } - } - - - - +info['twink'] != 0 ) + { + $u->error = ' "'.$itm['name'].'". !'; + } +elseif( $u->info['activ'] != 0 ) + { + $u->error = ' "'.$itm['name'].'". E-mail!'; + } +elseif( $itm['id'] > 0 && $itm['item_id']==10006 ) + { + $repc='repcapitalcity'; + if ($u->rep[$repc]<25000) + { + $st['expUpg'] += 0; + $u->rep[$repc] += $st['expUpg']; + if ($u->rep[$repc]>25000) + { + $u->rep[$repc]=25000; + } + $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; + //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); + } + else + { + $u->error = ' "'.$itm['name'].'". 25000 .!'; + } + } + + +elseif( $itm['id'] > 0 && $itm['item_id']==10007 ) + { + $repc='repsandcity'; + if ($u->rep[$repc]<25000) + { + $st['expUpg'] += 0; + $u->rep[$repc] += $st['expUpg']; + if ($u->rep[$repc]>25000) + { + $u->rep[$repc]=25000; + } + $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; + //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); + } + else + { + $u->error = ' "'.$itm['name'].'". 25000 .!'; + } + } + +elseif( $itm['id'] > 0 && $itm['item_id']==10008 ) + { + $repc='repemeraldscity'; + if ($u->rep[$repc]<25000) + { + $st['expUpg'] += 0; + $u->rep[$repc] += $st['expUpg']; + if ($u->rep[$repc]>25000) + { + $u->rep[$repc]=25000; + } + $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; + //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); + } + else + { + $u->error = ' "'.$itm['name'].'". 25000 .!'; + } + } + +elseif( $itm['id'] > 0 && $itm['item_id']==10009 ) + { + $repc='repabandonedplain'; + if ($u->rep[$repc]<25000) + { + $st['expUpg'] += 0; + $u->rep[$repc] += $st['expUpg']; + if ($u->rep[$repc]>25000) + { + $u->rep[$repc]=25000; + } + $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; + //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); + } + else + { + $u->error = ' "'.$itm['name'].'". 25000 .!'; + } + } + +elseif( $itm['id'] > 0 && $itm['item_id']==10010 ) + { + $repc='repangelscity'; + if ($u->rep[$repc]<25000) + { + $st['expUpg'] += 0; + $u->rep[$repc] += $st['expUpg']; + if ($u->rep[$repc]>25000) + { + $u->rep[$repc]=25000; + } + $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; + //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); + } + else + { + $u->error = ' "'.$itm['name'].'". 25000 .!'; + } + } + +elseif( $itm['id'] > 0 && $itm['item_id']==10011 ) + { + $repc='repdemonscity'; + if ($u->rep[$repc]<25000) + { + $st['expUpg'] += 0; + $u->rep[$repc] += $st['expUpg']; + if ($u->rep[$repc]>25000) + { + $u->rep[$repc]=25000; + } + $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; + //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); + } + else + { + $u->error = ' "'.$itm['name'].'". 25000 .!'; + } + } + + +elseif( $itm['id'] > 0 && $itm['item_id']==10012 ) + { + $repc='repsuncity'; + if ($u->rep[$repc]<25000) + { + $st['expUpg'] += 0; + $u->rep[$repc] += $st['expUpg']; + if ($u->rep[$repc]>25000) + { + $u->rep[$repc]=25000; + } + $u->error = ' "'.$itm['name'].'". '.$st['expUpg'].' .!'; + //mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + mysql_query('UPDATE `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" WHERE `id` = '.$u->info['id'].' LIMIT 1'); + + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); + } + else + { + $u->error = ' "'.$itm['name'].'". 25000 .!'; + } + } + + + + ?> \ No newline at end of file diff --git a/_incl_data/class/magic/hny2014.php b/_incl_data/class/magic/hny2014.php index 36862336..6b518f24 100644 --- a/_incl_data/class/magic/hny2014.php +++ b/_incl_data/class/magic/hny2014.php @@ -5,7 +5,7 @@ if(!defined('GAME')) } // , 00:00:00 01-01-2013 -if(date('Y')==2021) { +if(date('Y')==2023) { /* 2. ( . ) @@ -33,7 +33,7 @@ if(date('Y')==2021) { // (x1) $idit = $u->addItem(996,$u->info['id']); - mysql_query('UPDATE `items_users` SET `gift` = " " , `gtxt1` = " , 2021, !" WHERE `id` = "'.$idit.'" LIMIT 1'); + mysql_query('UPDATE `items_users` SET `gift` = " " , `gtxt1` = " , 2023, !" WHERE `id` = "'.$idit.'" LIMIT 1'); // @@ -50,11 +50,11 @@ if(date('Y')==2021) { mysql_query('UPDATE `items_users` SET `gift` = " ",`iznosMAX` = "100" WHERE `id` = "'.$idit.'" LIMIT 1'); - $u->error = ' "'.$itm['name'].'". . , 2021, !'; + $u->error = ' "'.$itm['name'].'". . , 2023, !'; mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE (`item_id` = "4009" OR `id` = "'.$itm['id'].'") AND `uid` = "'.$u->info['id'].'" LIMIT 10'); //2763 } }else{ - $u->error = ' 01.01.2021'; + $u->error = ' 01.01.2023'; } ?> \ No newline at end of file diff --git a/_incl_data/class/magic/propuskpsh.php.bac b/_incl_data/class/magic/propuskpsh.php.bac deleted file mode 100644 index 49dfc826..00000000 --- a/_incl_data/class/magic/propuskpsh.php.bac +++ /dev/null @@ -1,29 +0,0 @@ -info['id'].'" AND `vars` = "propuskpsh" AND `time` > "'.(time()-300).'" LIMIT 1')); - if( $u->info['align'] != 2 ) { - if( isset($test['id']) ) { - $u->error = ' , '.$u->timeOut($test['time']-time()+300); - }else{ - $u->addAction(time(),'propuskpsh',''); - $u->error = ' , .'; - if($itm['id'] == 4802) { - mysql_query('UPDATE `actions` SET `time` = "'.(time()-43200).'" WHERE `uid` = '.$u->info['id'].' AND `time` > "'.(time()-43200).'" AND `vars` LIKE "psh%" AND `vars` != "psh102" AND `vars` NOT LIKE "psh\_%"'); - }else{ - mysql_query('UPDATE `actions` SET `time` = "'.(time()-21600).'" WHERE `uid` = '.$u->info['id'].' AND `time` > "'.(time()-43200).'" AND `vars` LIKE "psh%" AND `vars` != "psh102" AND `vars` NOT LIKE "psh\_%"'); - } - // : - // 1) 12 . ( 4 , , ). - // 2) . - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); - } - }else{ - $u->error = ' !'; - } -} -?> \ No newline at end of file diff --git a/_incl_data/class/magic/sun_per_kr.php b/_incl_data/class/magic/sun_per_kr.php index 1ea9dccd..2b8afb00 100644 --- a/_incl_data/class/magic/sun_per_kr.php +++ b/_incl_data/class/magic/sun_per_kr.php @@ -5,71 +5,42 @@ if(!defined('GAME')) } $io .= ' , '; - $this->addItem(6361,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6361,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6364,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(5237,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5237,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5237,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5229,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5219,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5211,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5199,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5192,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5186,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5178,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5168,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5161,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5150,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5150,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2472,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $this->addItem(842,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(842,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(749,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(666,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2469,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(580,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(594,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(642,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(814,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(777,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(787,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(803,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(803,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(803,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $io .= ', ...., '; - $this->addItem(4935,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4944,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2712,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(2634,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(2634,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); + $io .= ' ...., '; + $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2621,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2621,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(871,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(994,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); ?> \ No newline at end of file diff --git a/_incl_data/class/magic/sun_per_ogn.php b/_incl_data/class/magic/sun_per_ogn.php index c81ec1cd..e26257de 100644 --- a/_incl_data/class/magic/sun_per_ogn.php +++ b/_incl_data/class/magic/sun_per_ogn.php @@ -3,70 +3,43 @@ if(!defined('GAME')) { die(); } - - $io .= ' , '; - $this->addItem(6406,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6409,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(5153,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5157,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5165,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5173,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2475,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5181,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5189,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5195,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5205,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5216,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5224,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5232,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5232,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5232,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' , '; + $this->addItem(850,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(751,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(669,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1176,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(822,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(583,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(597,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(644,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(810,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4983,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4543,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5003,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5003,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5003,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $io .= ', ...., '; - $this->addItem(4935,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4944,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2712,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(2702,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' ...., '; + $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2687,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(873,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // + $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4942,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1460,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2146,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // + $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); ?> \ No newline at end of file diff --git a/_incl_data/class/magic/sun_per_tk.php b/_incl_data/class/magic/sun_per_tk.php index 257b4e10..3b906f4e 100644 --- a/_incl_data/class/magic/sun_per_tk.php +++ b/_incl_data/class/magic/sun_per_tk.php @@ -3,72 +3,42 @@ if(!defined('GAME')) { die(); } - $io .= ' , '; - $this->addItem(6394,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6405,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6397,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6143,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6151,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6144,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6145,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2472,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6146,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6147,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6148,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6149,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6150,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6152,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6153,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6154,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6154,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6154,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $this->addItem(4648,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4654,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4647,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4651,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2469,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4962,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4968,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4650,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4653,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4652,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4987,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4646,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4649,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4649,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4649,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $io .= ', ...., '; - $this->addItem(4935,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4944,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2712,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(2612,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' ...., '; + $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2430,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(870,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(994,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); ?> \ No newline at end of file diff --git a/_incl_data/class/magic/sun_per_tp.php b/_incl_data/class/magic/sun_per_tp.php index 73f791da..83e721ab 100644 --- a/_incl_data/class/magic/sun_per_tp.php +++ b/_incl_data/class/magic/sun_per_tp.php @@ -4,72 +4,43 @@ if(!defined('GAME')) die(); } - $io .= ' , '; - $this->addItem(6383,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6383,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6386,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6142,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(6142,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5163,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5171,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2472,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5177,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5184,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5194,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5201,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5209,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5221,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5228,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5236,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5236,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5236,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' ( ), '; + $this->addItem(6483,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6483,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6484,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6485,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2469,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6486,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6487,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6488,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6489,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6490,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6491,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6492,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6493,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6493,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(6493,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $io .= ', ...., '; - $this->addItem(4935,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4944,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2712,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(2678,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2678,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' ...., '; + $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2665,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2665,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(870,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(994,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); ?> \ No newline at end of file diff --git a/_incl_data/class/magic/sun_per_uv.php b/_incl_data/class/magic/sun_per_uv.php index 693debd7..ade922cd 100644 --- a/_incl_data/class/magic/sun_per_uv.php +++ b/_incl_data/class/magic/sun_per_uv.php @@ -4,72 +4,43 @@ if(!defined('GAME')) die(); } - $io .= ' , '; - $this->addItem(6372,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6372,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6375,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(5146,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5146,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5162,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5170,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2472,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5179,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5187,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5193,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5200,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5210,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5220,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5230,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5238,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5238,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5238,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' , '; + $this->addItem(605,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(605,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(748,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(667,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2469,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(735,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(579,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(593,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(641,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(813,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(775,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(786,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(802,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(802,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(802,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $io .= ', ...., '; - $this->addItem(4935,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4944,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2712,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(2656,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2656,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' ...., '; + $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2643,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2643,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(872,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(994,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); ?> \ No newline at end of file diff --git a/_incl_data/class/magic/sun_per_vod.php b/_incl_data/class/magic/sun_per_vod.php index 0e17c331..54eee7c1 100644 --- a/_incl_data/class/magic/sun_per_vod.php +++ b/_incl_data/class/magic/sun_per_vod.php @@ -3,70 +3,43 @@ if(!defined('GAME')) { die(); } - - $io .= ' , '; - $this->addItem(6406,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6409,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(5155,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5158,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5166,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5175,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2475,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5182,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5191,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5196,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5206,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5217,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5225,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5233,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5233,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5233,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' , '; + $this->addItem(851,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(753,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(670,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1176,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(823,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(584,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(598,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(645,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(812,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4984,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4544,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5004,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5004,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5004,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $io .= ', ...., '; - $this->addItem(4935,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4944,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2712,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(2702,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' ...., '; + $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2687,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(873,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // + $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4942,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1460,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2147,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // + $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); ?> \ No newline at end of file diff --git a/_incl_data/class/magic/sun_per_voz.php b/_incl_data/class/magic/sun_per_voz.php index 73137744..d950467a 100644 --- a/_incl_data/class/magic/sun_per_voz.php +++ b/_incl_data/class/magic/sun_per_voz.php @@ -3,70 +3,43 @@ if(!defined('GAME')) { die(); } - - $io .= ' , '; - $this->addItem(6406,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6409,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(5152,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5156,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5164,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5172,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2475,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5180,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5188,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5197,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5204,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5215,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5223,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5231,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5231,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5231,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' , '; + $this->addItem(848,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(752,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(671,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1176,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(820,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(581,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(595,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(646,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(811,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4982,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4545,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5002,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5002,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5002,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $io .= ', ...., '; - $this->addItem(4935,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4944,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2712,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(2702,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' ...., '; + $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2687,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(873,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // + $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4942,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1460,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2148,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // + $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); ?> \ No newline at end of file diff --git a/_incl_data/class/magic/sun_per_zem.php b/_incl_data/class/magic/sun_per_zem.php index d399b0ee..fd36b3e0 100644 --- a/_incl_data/class/magic/sun_per_zem.php +++ b/_incl_data/class/magic/sun_per_zem.php @@ -3,70 +3,43 @@ if(!defined('GAME')) { die(); } - - $io .= ' , '; - $this->addItem(6406,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(6409,$this->info['id'],'|nosale=1|srok=604800|sudba='.$this->info['login']); - $this->addItem(5154,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5159,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5167,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5174,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2475,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5183,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5190,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5198,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5207,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5218,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5226,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5234,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5234,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(5234,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4401,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' , '; + $this->addItem(849,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(750,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(668,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1176,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(821,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(582,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(596,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(643,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(809,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4985,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4546,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5005,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5005,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5005,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4401,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); - $io .= ', ...., '; - $this->addItem(4935,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4944,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(2712,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(10038,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(4691,$this->info['id'],'|tr_lvl=10|nosale=1|sudba='.$this->info['login']); - $this->addItem(2702,$this->info['id'],'|nosale=1|sudba='.$this->info['login']); + $io .= ' ...., '; + $this->addItem(2712,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2687,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4736,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(873,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // + $this->addItem(2139,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2140,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(5046,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2390,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4941,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(4942,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(1460,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(2149,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); // + $this->addItem(1001,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); + $this->addItem(3102,$this->info['id'],'|nosale=1|srok=864000|sudba='.$this->info['login']); ?> \ No newline at end of file diff --git a/_incl_data/class/magic/sunduk_78.php b/_incl_data/class/magic/sunduk_78.php index 31f92f21..878aa9c3 100644 --- a/_incl_data/class/magic/sunduk_78.php +++ b/_incl_data/class/magic/sunduk_78.php @@ -42,7 +42,7 @@ if(!defined('GAME')) } $arts_1 = $arts_1[rand(0,count($arts_1)-1)]; if( $arts_1 > 0 ) { - $this->addItem($arts_1,$this->info['id'],'|nosale=1|srok='.(1*1209600).'',NULL,50); + $this->addItem($arts_1,$this->info['id'],'|nosale=1|srok='.(1*259200).'',NULL,50); } //echo '['.$arts_1[rand(0,count($arts_1)-1)].'!'.count($arts_1).'!'.$arts_lvl.']'; } diff --git a/_incl_data/class/magic/sunduk_78.php.bac b/_incl_data/class/magic/sunduk_78.php.bac deleted file mode 100644 index a225180d..00000000 --- a/_incl_data/class/magic/sunduk_78.php.bac +++ /dev/null @@ -1,121 +0,0 @@ -info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4461 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key3 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4462 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - $key4 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4463 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1')); - - if( isset($key1['id']) && isset($key2['id']) && isset($key3['id']) && isset($key4['id']) ) { - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = '.$key1['id'].' OR `id` = '.$key2['id'].' OR `id` = '.$key3['id'].' OR `id` = '.$key4['id'].' LIMIT 4'); - $trgos = true; - } - - if( $trgos == true ) { - if( rand(0,100) == 57 || $this->info['admin'] > 0 ) { - // - $io .= ' , '; - $arts_1 = array(); - $arts_lvl = $this->info['level']; - if( $arts_lvl < 4 ) { - $arts_lvl = 4; - }elseif( $arts_lvl > 10 ) { - $arts_lvl = 10; - } - $sp1 = mysql_query('SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl='.$arts_lvl.'%"'); - while( $pl1 = mysql_fetch_array($sp1) ) { - $arts_1[] = $pl1['items_id']; - } - $arts_1 = $arts_1[rand(0,count($arts_1)-1)]; - if( $arts_1 > 0 ) { - $this->addItem($arts_1,$this->info['id'],'|nosale=1|srok='.(1*86400).'',NULL,50); - } - //echo '['.$arts_1[rand(0,count($arts_1)-1)].'!'.count($arts_1).'!'.$arts_lvl.']'; - } - - $recr=rand(0,99); // 1% 4510 - 40 /3% 5021 - 20 /10% 5020 -10 / 20% 4465 -5 / 100% 5017 - 1 - $rcr=rand(0,99); // 5%4274 - 400 / 15% 4392/4392 - 100 / 30% 4392 -50 / 100% 4464 - 20 - - if( $recr > 98 ) { - // +40 . - $io .= ' 40 ., '; - $this->addItem(4510,$this->info['id'],'|sudba='.$this->info['login']); - }elseif( $recr > 96 ){ - // +20 . - $io .= ' 20 ., '; - $this->addItem(5021,$this->info['id'],'|sudba='.$this->info['login']); - }elseif( $recr > 89 ){ - // +10 . - $io .= ' 10 ., '; - $this->addItem(5020,$this->info['id'],'|sudba='.$this->info['login']); - }elseif( $recr > 79 ){ - // +5 . - $io .= ' 5 ., '; - $this->addItem(4465,$this->info['id'],'|sudba='.$this->info['login']); - }else{ - // +1 . - $io .= ' 1 ., '; - $this->addItem(5017,$this->info['id'],'|sudba='.$this->info['login']); - } - - if( $rcr > 94 ) { - // 400 . - $io .= ' 400 . '; - $this->addItem(4274,$this->info['id'],'|sudba='.$this->info['login']); - }elseif( $rcr > 84 ){ - // 100 . - $io .= ' 100 . '; - $this->addItem(4392,$this->info['id'],'|sudba='.$this->info['login']); - $this->addItem(4392,$this->info['id'],'|sudba='.$this->info['login']); - }elseif( $rcr > 69 ){ - // 50 . - $io .= ' 50 . '; - $this->addItem(4392,$this->info['id'],'|sudba='.$this->info['login']); - }else{ - // 20 . - $io .= ' 20 . '; - $this->addItem(4464,$this->info['id'],'|sudba='.$this->info['login']); - } - - - - - $elik_1 = array( - 4037,4038,4039,4040 - ); - $elik_1 = $elik_1[rand(0,3)]; - if( $elik_1 > 0 ) { - // 1 4 - $io .= ' +22 , '; - $this->addItem($elik_1,$this->info['id'],'|nosale=1|sudba='.$this->info['login'],NULL,1); - } - - - - // +200% - $io .= ' +100% , '; - $this->addItem(4466,$this->info['id'],''); - - }else{ - $no_open_itm = true; - $this->error = ' 4 .'; - } - - - } - unset($i5,$i3,$i4); -?> \ No newline at end of file diff --git a/_incl_data/class/magic/yarostzvezd.php b/_incl_data/class/magic/yarostzvezd.php index aabe48b3..6f5b7226 100644 --- a/_incl_data/class/magic/yarostzvezd.php +++ b/_incl_data/class/magic/yarostzvezd.php @@ -1,69 +1,50 @@ stats['hpNow'] < 1) { - $u->error = ' ...'; - } elseif ($u->info['tactic7'] < $pvr['trs7']) { - $u->error = ' , ' . $pvr['trs7'] . '...'; - } elseif (isset($btl->info['id'])) { - /* - $btl->priemAddLog( $id, 1, 2, $u->info['id'], $u->info['enemy'], - '', - '{tm1} {u1} "'.$itm['name'].'".', - ($btl->hodID) - ); - */ - - mysql_query('UPDATE `stats` SET `tactic7` = `tactic7` - "' . $pvr['trs7'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); - $u->info['tactic7'] = $u->info['tactic7'] - $pvr['trs7']; - $u->stats['tactic7'] = $u->stats['tactic7'] - $pvr['trs7']; - - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = 22 AND `v1` = "priem" AND `v2` = 325'); - 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, - '" . $u->info['id'] . "', - ' ', - 'add_acestar=1', - 0, - 77, - 0, - '" . $u->info['id'] . "', - 0, - 'priem', - 325, - 'elementalcrit.gif', 1, -1, '', 0, 0, '', 0, 0, 0, 1, 0); +if( $itm['magic_inci'] == 'yarostzvezd' ) { + + + + $pvr = array(); + + // + $pvr['trs7'] = 5; + if( $u->stats['hpNow'] < 1 ) { + $u->error = ' ...'; + }elseif( $u->info['tactic7'] < $pvr['trs7'] ) { + $u->error = ' , '.$pvr['trs7'].'...'; + }elseif( isset($btl->info['id']) ) { + /* + $btl->priemAddLog( $id, 1, 2, $u->info['id'], $u->info['enemy'], + '', + '{tm1} {u1} "'.$itm['name'].'".', + ($btl->hodID) + ); + */ + + mysql_query('UPDATE `stats` SET `tactic7` = `tactic7` - "'.$pvr['trs7'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); + $u->info['tactic7'] = $u->info['tactic7']-$pvr['trs7']; + $u->stats['tactic7'] = $u->stats['tactic7']-$pvr['trs7']; + + mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 22 AND `v1` = "priem" AND `v2` = 325'); + 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, '".$u->info['id']."', ' ', 'add_acestar=1', 0, 77, 0, '".$u->info['id']."', 0, 'priem', 325, 'elementalcrit.gif', 1, -1, '', 0, 0, '', 0, 0, 0, 1, 0); "); - - $u->error = ' ... '; - mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1'); - } else { - $u->error = ' '; - } - - // - //$this->mintr($pl); - - unset($pvr); + + $u->error = ' ... '; + mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1'); + + }else{ + $u->error = ' '; + } + + // + //$this->mintr($pl); + + unset($pvr); } ?> \ No newline at end of file diff --git a/_incl_data/class/mobile.php b/_incl_data/class/mobile.php deleted file mode 100644 index 6492a04c..00000000 --- a/_incl_data/class/mobile.php +++ /dev/null @@ -1,1231 +0,0 @@ -, Nick Ilyin - * Original author: Victor Stanciu - * - * @license Code and contributions have 'MIT License' - * More details: https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt - * - * @link Homepage: http://mobiledetect.net - * GitHub Repo: https://github.com/serbanghita/Mobile-Detect - * Google Code: http://code.google.com/p/php-mobile-detect/ - * README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md - * HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples - * - * @version 2.8.2 - */ - -class Mobile_Detect -{ - /** - * Mobile detection type. - * - * @deprecated since version 2.6.9 - */ - const DETECTION_TYPE_MOBILE = 'mobile'; - - /** - * Extended detection type. - * - * @deprecated since version 2.6.9 - */ - const DETECTION_TYPE_EXTENDED = 'extended'; - - /** - * A frequently used regular expression to extract version #s. - * - * @deprecated since version 2.6.9 - */ - const VER = '([\w._\+]+)'; - - /** - * Top-level device. - */ - const MOBILE_GRADE_A = 'A'; - - /** - * Mid-level device. - */ - const MOBILE_GRADE_B = 'B'; - - /** - * Low-level device. - */ - const MOBILE_GRADE_C = 'C'; - - /** - * Stores the version number of the current release. - */ - const VERSION = '2.8.2'; - - /** - * A type for the version() method indicating a string return value. - */ - const VERSION_TYPE_STRING = 'text'; - - /** - * A type for the version() method indicating a float return value. - */ - const VERSION_TYPE_FLOAT = 'float'; - - /** - * The User-Agent HTTP header is stored in here. - * @var string - */ - protected $userAgent = null; - - /** - * HTTP headers in the PHP-flavor. So HTTP_USER_AGENT and SERVER_SOFTWARE. - * @var array - */ - protected $httpHeaders = array(); - - /** - * The detection type, using self::DETECTION_TYPE_MOBILE or self::DETECTION_TYPE_EXTENDED. - * - * @deprecated since version 2.6.9 - * - * @var string - */ - protected $detectionType = self::DETECTION_TYPE_MOBILE; - - /** - * HTTP headers that trigger the 'isMobile' detection - * to be true. - * - * @var array - */ - protected static $mobileHeaders = array( - - 'HTTP_ACCEPT' => array('matches' => array( - // Opera Mini; @reference: http://dev.opera.com/articles/view/opera-binary-markup-language/ - 'application/x-obml2d', - // BlackBerry devices. - 'application/vnd.rim.html', - 'text/vnd.wap.wml', - 'application/vnd.wap.xhtml+xml' - )), - 'HTTP_X_WAP_PROFILE' => null, - 'HTTP_X_WAP_CLIENTID' => null, - 'HTTP_WAP_CONNECTION' => null, - 'HTTP_PROFILE' => null, - // Reported by Opera on Nokia devices (eg. C3). - 'HTTP_X_OPERAMINI_PHONE_UA' => null, - 'HTTP_X_NOKIA_GATEWAY_ID' => null, - 'HTTP_X_ORANGE_ID' => null, - 'HTTP_X_VODAFONE_3GPDPCONTEXT' => null, - 'HTTP_X_HUAWEI_USERID' => null, - // Reported by Windows Smartphones. - 'HTTP_UA_OS' => null, - // Reported by Verizon, Vodafone proxy system. - 'HTTP_X_MOBILE_GATEWAY' => null, - // Seend this on HTC Sensation. @ref: SensationXE_Beats_Z715e. - 'HTTP_X_ATT_DEVICEID' => null, - // Seen this on a HTC. - 'HTTP_UA_CPU' => array('matches' => array('ARM')), - ); - - /** - * List of mobile devices (phones). - * - * @var array - */ - protected static $phoneDevices = array( - 'iPhone' => '\biPhone.*Mobile|\biPod', // |\biTunes - 'BlackBerry' => 'BlackBerry|\bBB10\b|rim[0-9]+', - 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m', - 'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile', - // @todo: Is 'Dell Streak' a tablet or a phone? ;) - 'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b', - 'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925', - 'Samsung' => 'Samsung|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E', - 'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802)', - 'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i', - 'Asus' => 'Asus.*Galaxy|PadFone.*Mobile', - // @ref: http://www.micromaxinfo.com/mobiles/smartphones - // Added because the codes might conflict with Acer Tablets. - 'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b', - 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ; @todo - complete the regex. - 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;) - // @ref: http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA (PANTECH) - // Most of the VEGA devices are legacy. PANTECH seem to be newer devices based on Android. - 'Pantech' => 'PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790', - // @ref: http://www.fly-phone.com/devices/smartphones/ ; Included only smartphones. - 'Fly' => 'IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250', - 'iMobile' => 'i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)', - // Added simvalley mobile just for fun. They have some interesting devices. - // @ref: http://www.simvalley.fr/telephonie---gps-_22_telephonie-mobile_telephones_.html - 'SimValley' => '\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\b', - // @Tapatalk is a mobile app; @ref: http://support.tapatalk.com/threads/smf-2-0-2-os-and-browser-detection-plugin-and-tapatalk.15565/#post-79039 - 'GenericPhone' => 'Tapatalk|PDA;|SAGEM|\bmmp\b|pocket|\bpsp\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\bwap\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser' - ); - - /** - * List of tablet devices. - * - * @var array - */ - protected static $tabletDevices = array( - 'iPad' => 'iPad|iPad.*Mobile', // @todo: check for mobile friendly emails topic. - 'NexusTablet' => 'Android.*Nexus[\s]+(7|10)|^.*Android.*Nexus(?:(?!Mobile).)*$', - 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-I9205|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705C|SM-T535|SM-T331', // SCH-P709|SCH-P729|SM-T2558 - Samsung Mega - treat them like a regular phone. - // @reference: http://www.labnol.org/software/kindle-user-agent-string/20378/ - 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE)\b', - // Only the Surface tablets with Windows RT are considered mobile. - // @ref: http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx - 'SurfaceTablet' => 'Windows NT [0-9.]+; ARM;', - // @ref: http://shopping1.hp.com/is-bin/INTERSHOP.enfinity/WFS/WW-USSMBPublicStore-Site/en_US/-/USD/ViewStandardCatalog-Browse?CatalogCategoryID=JfIQ7EN5lqMAAAEyDcJUDwMT - 'HPTablet' => 'HP Slate 7|HP ElitePad 900|hp-tablet|EliteBook.*Touch', - // @note: watch out for PadFone, see #132 - 'AsusTablet' => '^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\bK00F\b|TX201LA', - 'BlackBerryTablet' => 'PlayBook|RIM Tablet', - 'HTCtablet' => 'HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200', - 'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617', - 'NookTablet' => 'Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2', - // @ref: http://www.acer.ro/ac/ro/RO/content/drivers - // @ref: http://www.packardbell.co.uk/pb/en/GB/content/download (Packard Bell is part of Acer) - // @ref: http://us.acer.com/ac/en/US/content/group/tablets - // @note: Can conflict with Micromax and Motorola phones codes. - 'AcerTablet' => 'Android.*; \b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810)\b|W3-810|\bA3-A10\b', - // @ref: http://eu.computers.toshiba-europe.com/innovation/family/Tablets/1098744/banner_id/tablet_footerlink/ - // @ref: http://us.toshiba.com/tablets/tablet-finder - // @ref: http://www.toshiba.co.jp/regza/tablet/ - 'ToshibaTablet' => 'Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO', - // @ref: http://www.nttdocomo.co.jp/english/service/developer/smart_phone/technical_info/spec/index.html - 'LGTablet' => '\bL-06C|LG-V900|LG-V500|LG-V909\b', - 'FujitsuTablet' => 'Android.*\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\b', - // Prestigio Tablets http://www.prestigio.com/support - 'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD', - // @ref: http://support.lenovo.com/en_GB/downloads/default.page?# - 'LenovoTablet' => 'IdeaTab|ThinkPad([ ]+)?Tablet|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A1000|A2107|A2109|A1107|B6000|B8000|B8080-F)', - // @ref: http://www.yarvik.com/en/matrix/tablets/ - 'YarvikTablet' => 'Android.*\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\b', - 'MedionTablet' => 'Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB', - 'ArnovaTablet' => 'AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT', - // http://www.intenso.de/kategorie_en.php?kategorie=33 - // @todo: http://www.nbhkdz.com/read/b8e64202f92a2df129126bff.html - investigate - 'IntensoTablet' => 'INM8002KP|INM1010FP|INM805ND|Intenso Tab', - // IRU.ru Tablets http://www.iru.ru/catalog/soho/planetable/ - 'IRUTablet' => 'M702pro', - 'MegafonTablet' => 'MegaFon V9|\bZTE V9\b|Android.*\bMT7A\b', - // @ref: http://www.e-boda.ro/tablete-pc.html - 'EbodaTablet' => 'E-Boda (Supreme|Impresspeed|Izzycomm|Essential)', - // @ref: http://www.allview.ro/produse/droseries/lista-tablete-pc/ - 'AllViewTablet' => 'Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)', - // @reference: http://wiki.archosfans.com/index.php?title=Main_Page - 'ArchosTablet' => '\b(101G9|80G9|A101IT)\b|Qilive 97R|ARCHOS 101G10', - // @ref: http://www.ainol.com/plugin.php?identifier=ainol&module=product - 'AinolTablet' => 'NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark', - // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER - // @ref: Readers http://www.atsuhiro-me.net/ebook/sony-reader/sony-reader-web-browser - // @ref: http://www.sony.jp/support/tablet/ - 'SonyTablet' => 'Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551', - // @ref: db + http://www.cube-tablet.com/buy-products.html - 'CubeTablet' => 'Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT', - // @ref: http://www.cobyusa.com/?p=pcat&pcat_id=3001 - 'CobyTablet' => 'MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010', - // @ref: http://www.match.net.cn/products.asp - 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733', - // @ref: http://pdadb.net/index.php?m=pdalist&list=SMiT (NoName Chinese Tablets) - // @ref: http://www.imp3.net/14/show.php?itemid=20454 - 'SMiTTablet' => 'Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)', - // @ref: http://www.rock-chips.com/index.php?do=prod&pid=2 - 'RockChipTablet' => 'Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A', - // @ref: http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/ - 'FlyTablet' => 'IQ310|Fly Vision', - // @ref: http://www.bqreaders.com/gb/tablets-prices-sale.html - 'bqTablet' => 'bq.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant)|Maxwell.*Lite|Maxwell.*Plus', - // @ref: http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290 - // @ref: http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets) - 'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim', - // Nec or Medias Tab - 'NecTablet' => '\bN-06D|\bN-08D', - // Pantech Tablets: http://www.pantechusa.com/phones/ - 'PantechTablet' => 'Pantech.*P4100', - // Broncho Tablets: http://www.broncho.cn/ (hard to find) - 'BronchoTablet' => 'Broncho.*(N701|N708|N802|a710)', - // @ref: http://versusuk.com/support.html - 'VersusTablet' => 'TOUCHPAD.*[78910]|\bTOUCHTAB\b', - // @ref: http://www.zync.in/index.php/our-products/tablet-phablets - 'ZyncTablet' => 'z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900', - // @ref: http://www.positivoinformatica.com.br/www/pessoal/tablet-ypy/ - 'PositivoTablet' => 'TB07STA|TB10STA|TB07FTA|TB10FTA', - // @ref: https://www.nabitablet.com/ - 'NabiTablet' => 'Android.*\bNabi', - 'KoboTablet' => 'Kobo Touch|\bK080\b|\bVox\b Build|\bArc\b Build', - // French Danew Tablets http://www.danew.com/produits-tablette.php - 'DanewTablet' => 'DSlide.*\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\b', - // Texet Tablets and Readers http://www.texet.ru/tablet/ - 'TexetTablet' => 'NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE', - // @note: Avoid detecting 'PLAYSTATION 3' as mobile. - 'PlaystationTablet' => 'Playstation.*(Portable|Vita)', - // @ref: http://www.trekstor.de/surftabs.html - 'TrekstorTablet' => 'ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2', - // @ref: http://www.pyleaudio.com/Products.aspx?%2fproducts%2fPersonal-Electronics%2fTablets - 'PyleAudioTablet' => '\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\b', - // @ref: http://www.advandigital.com/index.php?link=content-product&jns=JP001 - // @Note: because of the short codenames we have to include whitespaces to reduce the possible conflicts. - 'AdvanTablet' => 'Android.* \b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\b ', - // @ref: http://www.danytech.com/category/tablet-pc - 'DanyTechTablet' => 'Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1', - // @ref: http://www.galapad.net/product.html - 'GalapadTablet' => 'Android.*\bG1\b', - // @ref: http://www.micromaxinfo.com/tablet/funbook - 'MicromaxTablet' => 'Funbook|Micromax.*\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\b', - // http://www.karbonnmobiles.com/products_tablet.php - 'KarbonnTablet' => 'Android.*\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\b', - // @ref: http://www.myallfine.com/Products.asp - 'AllFineTablet' => 'Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide', - // @ref: http://www.proscanvideo.com/products-search.asp?itemClass=TABLET&itemnmbr= - 'PROSCANTablet' => '\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\b', - // @ref: http://www.yonesnav.com/products/products.php - 'YONESTablet' => 'BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026', - // @ref: http://www.cjshowroom.com/eproducts.aspx?classcode=004001001 - // China manufacturer makes tablets for different small brands (eg. http://www.zeepad.net/index.html) - 'ChangJiaTablet' => 'TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503', - // @ref: http://www.gloryunion.cn/products.asp - // @ref: http://www.allwinnertech.com/en/apply/mobile.html - // @ref: http://www.ptcl.com.pk/pd_content.php?pd_id=284 (EVOTAB) - // @todo: Softwiner tablets? - // aka. Cute or Cool tablets. Not sure yet, must research to avoid collisions. - 'GUTablet' => 'TX-A1301|TX-M9002|Q702|kf026', // A12R|D75A|D77|D79|R83|A95|A106C|R15|A75|A76|D71|D72|R71|R73|R77|D82|R85|D92|A97|D92|R91|A10F|A77F|W71F|A78F|W78F|W81F|A97F|W91F|W97F|R16G|C72|C73E|K72|K73|R96G - // @ref: http://www.pointofview-online.com/showroom.php?shop_mode=product_listing&category_id=118 - 'PointOfViewTablet' => 'TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10', - // @ref: http://www.overmax.pl/pl/katalog-produktow,p8/tablety,c14/ - // @todo: add more tests. - 'OvermaxTablet' => 'OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)', - // @ref: http://hclmetablet.com/India/index.php - 'HCLTablet' => 'HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync', - // @ref: http://www.edigital.hu/Tablet_es_e-book_olvaso/Tablet-c18385.html - 'DPSTablet' => 'DPS Dream 9|DPS Dual 7', - // @ref: http://www.visture.com/index.asp - 'VistureTablet' => 'V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10', - // @ref: http://www.mijncresta.nl/tablet - 'CrestaTablet' => 'CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989', - // MediaTek - http://www.mediatek.com/_en/01_products/02_proSys.php?cata_sn=1&cata1_sn=1&cata2_sn=309 - 'MediatekTablet' => '\bMT8125|MT8389|MT8135|MT8377\b', - // Concorde tab - 'ConcordeTablet' => 'Concorde([ ]+)?Tab|ConCorde ReadMan', - // GoClever Tablets - http://www.goclever.com/uk/products,c1/tablet,c5/ - 'GoCleverTablet' => 'GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042', - // Modecom Tablets - http://www.modecom.eu/tablets/portal/ - 'ModecomTablet' => 'FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003', - // Vonino Tablets - http://www.vonino.eu/tablets - 'VoninoTablet' => '\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\bQ8\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\b', - // ECS Tablets - http://www.ecs.com.tw/ECSWebSite/Product/Product_Tablet_List.aspx?CategoryID=14&MenuID=107&childid=M_107&LanID=0 - 'ECSTablet' => 'V07OT2|TM105A|S10OT1|TR10CS1', - // Storex Tablets - http://storex.fr/espace_client/support.html - // @note: no need to add all the tablet codes since they are guided by the first regex. - 'StorexTablet' => 'eZee[_\']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab', - // Generic Vodafone tablets. - 'VodafoneTablet' => 'SmartTab([ ]+)?[0-9]+|SmartTabII10', - // French tablets - Essentiel B http://www.boulanger.fr/tablette_tactile_e-book/tablette_tactile_essentiel_b/cl_68908.htm?multiChoiceToDelete=brand&mc_brand=essentielb - // Aka: http://www.essentielb.fr/ - 'EssentielBTablet' => 'Smart[ \']?TAB[ ]+?[0-9]+|Family[ \']?TAB2', - // Ross & Moor - http://ross-moor.ru/ - 'RossMoorTablet' => 'RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711', - // i-mobile http://product.i-mobilephone.com/Mobile_Device - 'iMobileTablet' => 'i-mobile i-note', - // @ref: http://www.tolino.de/de/vergleichen/ - 'TolinoTablet' => 'tolino tab [0-9.]+|tolino shine', - // AudioSonic - a Kmart brand - // http://www.kmart.com.au/webapp/wcs/stores/servlet/Search?langId=-1&storeId=10701&catalogId=10001&categoryId=193001&pageSize=72¤tPage=1&searchCategory=193001%2b4294965664&sortBy=p_MaxPrice%7c1 - 'AudioSonicTablet' => '\bC-22Q|T7-QC|T-17B|T-17P\b', - // AMPE Tablets - http://www.ampe.com.my/product-category/tablets/ - // @todo: add them gradually to avoid conflicts. - 'AMPETablet' => 'Android.* A78 ', - // Skk Mobile - http://skkmobile.com.ph/product_tablets.php - 'SkkTablet' => 'Android.* (SKYPAD|PHOENIX|CYCLOPS)', - // Tecno Mobile (only tablet) - http://www.tecno-mobile.com/index.php/product?filterby=smart&list_order=all&page=1 - 'TecnoTablet' => 'TECNO P9', - // JXD (consoles & tablets) - http://jxd.hk/products.asp?selectclassid=009008&clsid=3 - 'JXDTablet' => 'Android.*\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\b', - // i-Joy tablets - http://www.i-joy.es/en/cat/products/tablets/ - 'iJoyTablet' => 'Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)', - // @ref: http://www.tesco.com/direct/hudl/ - 'Hudl' => 'Hudl HT7S3', - // @ref: http://www.telstra.com.au/home-phone/thub-2/ - 'TelstraTablet' => 'T-Hub2', - 'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|ViewPad7|BNTV250A|MID-WCDMA|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|rk30sdk|\bEVOTAB\b|M758A|ET904|ALUMIUM10|Smartfren Tab', - ); - - /** - * List of mobile Operating Systems. - * - * @var array - */ - protected static $operatingSystems = array( - 'AndroidOS' => 'Android', - 'BlackBerryOS' => 'blackberry|\bBB10\b|rim tablet os', - 'PalmOS' => 'PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino', - 'SymbianOS' => 'Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\bS60\b', - // @reference: http://en.wikipedia.org/wiki/Windows_Mobile - 'WindowsMobileOS' => 'Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;', - // @reference: http://en.wikipedia.org/wiki/Windows_Phone - // http://wifeng.cn/?r=blog&a=view&id=106 - // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx - 'WindowsPhoneOS' => 'Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7', - 'iOS' => '\biPhone.*Mobile|\biPod|\biPad', - // http://en.wikipedia.org/wiki/MeeGo - // @todo: research MeeGo in UAs - 'MeeGoOS' => 'MeeGo', - // http://en.wikipedia.org/wiki/Maemo - // @todo: research Maemo in UAs - 'MaemoOS' => 'Maemo', - 'JavaOS' => 'J2ME/|\bMIDP\b|\bCLDC\b', // '|Java/' produces bug #135 - 'webOS' => 'webOS|hpwOS', - 'badaOS' => '\bBada\b', - 'BREWOS' => 'BREW', - ); - - /** - * List of mobile User Agents. - * - * @var array - */ - protected static $browsers = array( - // @reference: https://developers.google.com/chrome/mobile/docs/user-agent - 'Chrome' => '\bCrMo\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?', - 'Dolfin' => '\bDolfin\b', - 'Opera' => 'Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+|Coast/[0-9.]+', - 'Skyfire' => 'Skyfire', - 'IE' => 'IEMobile|MSIEMobile', // |Trident/[.0-9]+ - 'Firefox' => 'fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile', - 'Bolt' => 'bolt', - 'TeaShark' => 'teashark', - 'Blazer' => 'Blazer', - // @reference: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html#//apple_ref/doc/uid/TP40006517-SW3 - 'Safari' => 'Version.*Mobile.*Safari|Safari.*Mobile', - // @ref: http://en.wikipedia.org/wiki/Midori_(web_browser) - //'Midori' => 'midori', - 'Tizen' => 'Tizen', - 'UCBrowser' => 'UC.*Browser|UCWEB', - // @ref: https://github.com/serbanghita/Mobile-Detect/issues/7 - 'DiigoBrowser' => 'DiigoBrowser', - // http://www.puffinbrowser.com/index.php - 'Puffin' => 'Puffin', - // @ref: http://mercury-browser.com/index.html - 'Mercury' => '\bMercury\b', - // @reference: http://en.wikipedia.org/wiki/Minimo - // http://en.wikipedia.org/wiki/Vision_Mobile_Browser - 'GenericBrowser' => 'NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger' - ); - - /** - * Utilities. - * - * @var array - */ - protected static $utilities = array( - // Experimental. When a mobile device wants to switch to 'Desktop Mode'. - // @ref: http://scottcate.com/technology/windows-phone-8-ie10-desktop-or-mobile/ - // @ref: https://github.com/serbanghita/Mobile-Detect/issues/57#issuecomment-15024011 - 'DesktopMode' => 'WPDesktop', - 'TV' => 'SonyDTV|HbbTV', // experimental - 'WebKit' => '(webkit)[ /]([\w.]+)', - 'Bot' => 'Googlebot|DoCoMo|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|facebookexternalhit', - 'MobileBot' => 'Googlebot-Mobile|DoCoMo|YahooSeeker/M1A1-R2D2', - // @todo: Include JXD consoles. - 'Console' => '\b(Nintendo|Nintendo WiiU|PLAYSTATION|Xbox)\b', - 'Watch' => 'SM-V700', - ); - - /** - * All possible HTTP headers that represent the - * User-Agent string. - * - * @var array - */ - protected static $uaHttpHeaders = array( - // The default User-Agent string. - 'HTTP_USER_AGENT', - // Header can occur on devices using Opera Mini. - 'HTTP_X_OPERAMINI_PHONE_UA', - // Vodafone specific header: http://www.seoprinciple.com/mobile-web-community-still-angry-at-vodafone/24/ - 'HTTP_X_DEVICE_USER_AGENT', - 'HTTP_X_ORIGINAL_USER_AGENT', - 'HTTP_X_SKYFIRE_PHONE', - 'HTTP_X_BOLT_PHONE_UA', - 'HTTP_DEVICE_STOCK_UA', - 'HTTP_X_UCBROWSER_DEVICE_UA' - ); - - /** - * The individual segments that could exist in a User-Agent string. VER refers to the regular - * expression defined in the constant self::VER. - * - * @var array - */ - protected static $properties = array( - - // Build - 'Mobile' => 'Mobile/[VER]', - 'Build' => 'Build/[VER]', - 'Version' => 'Version/[VER]', - 'VendorID' => 'VendorID/[VER]', - - // Devices - 'iPad' => 'iPad.*CPU[a-z ]+[VER]', - 'iPhone' => 'iPhone.*CPU[a-z ]+[VER]', - 'iPod' => 'iPod.*CPU[a-z ]+[VER]', - //'BlackBerry' => array('BlackBerry[VER]', 'BlackBerry [VER];'), - 'Kindle' => 'Kindle/[VER]', - - // Browser - 'Chrome' => array('Chrome/[VER]', 'CriOS/[VER]', 'CrMo/[VER]'), - 'Coast' => array('Coast/[VER]'), - 'Dolfin' => 'Dolfin/[VER]', - // @reference: https://developer.mozilla.org/en-US/docs/User_Agent_Strings_Reference - 'Firefox' => 'Firefox/[VER]', - 'Fennec' => 'Fennec/[VER]', - // @reference: http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx - 'IE' => array('IEMobile/[VER];', 'IEMobile [VER]', 'MSIE [VER];'), - // http://en.wikipedia.org/wiki/NetFront - 'NetFront' => 'NetFront/[VER]', - 'NokiaBrowser' => 'NokiaBrowser/[VER]', - 'Opera' => array( ' OPR/[VER]', 'Opera Mini/[VER]', 'Version/[VER]' ), - 'Opera Mini' => 'Opera Mini/[VER]', - 'Opera Mobi' => 'Version/[VER]', - 'UC Browser' => 'UC Browser[VER]', - 'MQQBrowser' => 'MQQBrowser/[VER]', - 'MicroMessenger' => 'MicroMessenger/[VER]', - // @note: Safari 7534.48.3 is actually Version 5.1. - // @note: On BlackBerry the Version is overwriten by the OS. - 'Safari' => array( 'Version/[VER]', 'Safari/[VER]' ), - 'Skyfire' => 'Skyfire/[VER]', - 'Tizen' => 'Tizen/[VER]', - 'Webkit' => 'webkit[ /][VER]', - - // Engine - 'Gecko' => 'Gecko/[VER]', - 'Trident' => 'Trident/[VER]', - 'Presto' => 'Presto/[VER]', - - // OS - 'iOS' => ' \bOS\b [VER] ', - 'Android' => 'Android [VER]', - 'BlackBerry' => array('BlackBerry[\w]+/[VER]', 'BlackBerry.*Version/[VER]', 'Version/[VER]'), - 'BREW' => 'BREW [VER]', - 'Java' => 'Java/[VER]', - // @reference: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/08/29/introducing-the-ie9-on-windows-phone-mango-user-agent-string.aspx - // @reference: http://en.wikipedia.org/wiki/Windows_NT#Releases - 'Windows Phone OS' => array( 'Windows Phone OS [VER]', 'Windows Phone [VER]'), - 'Windows Phone' => 'Windows Phone [VER]', - 'Windows CE' => 'Windows CE/[VER]', - // http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/6be392da-4d2f-41b4-8354-8dcee20c85cd - 'Windows NT' => 'Windows NT [VER]', - 'Symbian' => array('SymbianOS/[VER]', 'Symbian/[VER]'), - 'webOS' => array('webOS/[VER]', 'hpwOS/[VER];'), - ); - - /** - * Construct an instance of this class. - * - * @param array $headers Specify the headers as injection. Should be PHP _SERVER flavored. - * If left empty, will use the global _SERVER['HTTP_*'] vars instead. - * @param string $userAgent Inject the User-Agent header. If null, will use HTTP_USER_AGENT - * from the $headers array instead. - */ - public function __construct( - array $headers = null, - $userAgent = null - ){ - $this->setHttpHeaders($headers); - $this->setUserAgent($userAgent); - } - - /** - * Get the current script version. - * This is useful for the demo.php file, - * so people can check on what version they are testing - * for mobile devices. - * - * @return string The version number in semantic version format. - */ - public static function getScriptVersion() - { - return self::VERSION; - } - - /** - * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers. - * - * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract - * the headers. The default null is left for backwards compatibilty. - */ - public function setHttpHeaders($httpHeaders = null) - { - //use global _SERVER if $httpHeaders aren't defined - if (!is_array($httpHeaders) || !count($httpHeaders)) { - $httpHeaders = $_SERVER; - } - - //clear existing headers - $this->httpHeaders = array(); - - //Only save HTTP headers. In PHP land, that means only _SERVER vars that - //start with HTTP_. - foreach ($httpHeaders as $key => $value) { - if (substr($key,0,5) == 'HTTP_') { - $this->httpHeaders[$key] = $value; - } - } - } - - /** - * Retrieves the HTTP headers. - * - * @return array - */ - public function getHttpHeaders() - { - return $this->httpHeaders; - } - - /** - * Retrieves a particular header. If it doesn't exist, no exception/error is caused. - * Simply null is returned. - * - * @param string $header The name of the header to retrieve. Can be HTTP compliant such as - * "User-Agent" or "X-Device-User-Agent" or can be php-esque with the - * all-caps, HTTP_ prefixed, underscore seperated awesomeness. - * - * @return string|null The value of the header. - */ - public function getHttpHeader($header) - { - //are we using PHP-flavored headers? - if (strpos($header, '_') === false) { - $header = str_replace('-', '_', $header); - $header = strtoupper($header); - } - - //test the alternate, too - $altHeader = 'HTTP_' . $header; - - //Test both the regular and the HTTP_ prefix - if (isset($this->httpHeaders[$header])) { - return $this->httpHeaders[$header]; - } elseif (isset($this->httpHeaders[$altHeader])) { - return $this->httpHeaders[$altHeader]; - } - } - - public function getMobileHeaders() - { - return self::$mobileHeaders; - } - - /** - * Get all possible HTTP headers that - * can contain the User-Agent string. - * - * @return array List of HTTP headers. - */ - public function getUaHttpHeaders() - { - return self::$uaHttpHeaders; - } - - /** - * Set the User-Agent to be used. - * - * @param string $userAgent The user agent string to set. - */ - public function setUserAgent($userAgent = null) - { - if (!empty($userAgent)) { - return $this->userAgent = $userAgent; - } else { - - $this->userAgent = null; - - foreach($this->getUaHttpHeaders() as $altHeader){ - if(!empty($this->httpHeaders[$altHeader])){ // @todo: should use getHttpHeader(), but it would be slow. (Serban) - $this->userAgent .= $this->httpHeaders[$altHeader] . " "; - } - } - - return $this->userAgent = (!empty($this->userAgent) ? trim($this->userAgent) : null); - - } - } - - /** - * Retrieve the User-Agent. - * - * @return string|null The user agent if it's set. - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Set the detection type. Must be one of self::DETECTION_TYPE_MOBILE or - * self::DETECTION_TYPE_EXTENDED. Otherwise, nothing is set. - * - * @deprecated since version 2.6.9 - * - * @param string $type The type. Must be a self::DETECTION_TYPE_* constant. The default - * parameter is null which will default to self::DETECTION_TYPE_MOBILE. - */ - public function setDetectionType($type = null) - { - if ($type === null) { - $type = self::DETECTION_TYPE_MOBILE; - } - - if ($type != self::DETECTION_TYPE_MOBILE && $type != self::DETECTION_TYPE_EXTENDED) { - return; - } - - $this->detectionType = $type; - } - - /** - * Retrieve the list of known phone devices. - * - * @return array List of phone devices. - */ - public static function getPhoneDevices() - { - return self::$phoneDevices; - } - - /** - * Retrieve the list of known tablet devices. - * - * @return array List of tablet devices. - */ - public static function getTabletDevices() - { - return self::$tabletDevices; - } - - /** - * Alias for getBrowsers() method. - * - * @return array List of user agents. - */ - public static function getUserAgents() - { - return self::getBrowsers(); - } - - /** - * Retrieve the list of known browsers. Specifically, the user agents. - * - * @return array List of browsers / user agents. - */ - public static function getBrowsers() - { - return self::$browsers; - } - - /** - * Retrieve the list of known utilities. - * - * @return array List of utilities. - */ - public static function getUtilities() - { - return self::$utilities; - } - - /** - * Method gets the mobile detection rules. This method is used for the magic methods $detect->is*(). - * - * @deprecated since version 2.6.9 - * - * @return array All the rules (but not extended). - */ - public static function getMobileDetectionRules() - { - static $rules; - - if (!$rules) { - $rules = array_merge( - self::$phoneDevices, - self::$tabletDevices, - self::$operatingSystems, - self::$browsers - ); - } - - return $rules; - - } - - /** - * Method gets the mobile detection rules + utilities. - * The reason this is separate is because utilities rules - * don't necessary imply mobile. This method is used inside - * the new $detect->is('stuff') method. - * - * @deprecated since version 2.6.9 - * - * @return array All the rules + extended. - */ - public function getMobileDetectionRulesExtended() - { - static $rules; - - if (!$rules) { - // Merge all rules together. - $rules = array_merge( - self::$phoneDevices, - self::$tabletDevices, - self::$operatingSystems, - self::$browsers, - self::$utilities - ); - } - - return $rules; - } - - /** - * Retrieve the current set of rules. - * - * @deprecated since version 2.6.9 - * - * @return array - */ - public function getRules() - { - if ($this->detectionType == self::DETECTION_TYPE_EXTENDED) { - return self::getMobileDetectionRulesExtended(); - } else { - return self::getMobileDetectionRules(); - } - } - - /** - * Retrieve the list of mobile operating systems. - * - * @return array The list of mobile operating systems. - */ - public static function getOperatingSystems() - { - return self::$operatingSystems; - } - - /** - * Check the HTTP headers for signs of mobile. - * This is the fastest mobile check possible; it's used - * inside isMobile() method. - * - * @return bool - */ - public function checkHttpHeadersForMobile() - { - - foreach($this->getMobileHeaders() as $mobileHeader => $matchType){ - if( isset($this->httpHeaders[$mobileHeader]) ){ - if( is_array($matchType['matches']) ){ - foreach($matchType['matches'] as $_match){ - if( strpos($this->httpHeaders[$mobileHeader], $_match) !== false ){ - return true; - } - } - return false; - } else { - return true; - } - } - } - - return false; - - } - - /** - * Magic overloading method. - * - * @method boolean is[...]() - * @param string $name - * @param array $arguments - * @return mixed - * @throws BadMethodCallException when the method doesn't exist and doesn't start with 'is' - */ - public function __call($name, $arguments) - { - //make sure the name starts with 'is', otherwise - if (substr($name, 0, 2) != 'is') { - throw new BadMethodCallException("No such method exists: $name"); - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - $key = substr($name, 2); - - return $this->matchUAAgainstKey($key); - } - - /** - * Find a detection rule that matches the current User-agent. - * - * @param null $userAgent deprecated - * @return boolean - */ - protected function matchDetectionRulesAgainstUA($userAgent = null) - { - // Begin general search. - foreach ($this->getRules() as $_regex) { - if (empty($_regex)) { - continue; - } - if ($this->match($_regex, $userAgent)) { - return true; - } - } - - return false; - } - - /** - * Search for a certain key in the rules array. - * If the key is found the try to match the corresponding - * regex agains the User-Agent. - * - * @param string $key - * @param null $userAgent deprecated - * @return mixed - */ - protected function matchUAAgainstKey($key, $userAgent = null) - { - // Make the keys lowercase so we can match: isIphone(), isiPhone(), isiphone(), etc. - $key = strtolower($key); - - //change the keys to lower case - $_rules = array_change_key_case($this->getRules()); - - if (array_key_exists($key, $_rules)) { - if (empty($_rules[$key])) { - return null; - } - - return $this->match($_rules[$key], $userAgent); - } - - return false; - } - - /** - * Check if the device is mobile. - * Returns true if any type of mobile device detected, including special ones - * @param null $userAgent deprecated - * @param null $httpHeaders deprecated - * @return bool - */ - public function isMobile($userAgent = null, $httpHeaders = null) - { - - if ($httpHeaders) { - $this->setHttpHeaders($httpHeaders); - } - - if ($userAgent) { - $this->setUserAgent($userAgent); - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - if ($this->checkHttpHeadersForMobile()) { - return true; - } else { - return $this->matchDetectionRulesAgainstUA(); - } - - } - - /** - * Check if the device is a tablet. - * Return true if any type of tablet device is detected. - * - * @param string $userAgent deprecated - * @param array $httpHeaders deprecated - * @return bool - */ - public function isTablet($userAgent = null, $httpHeaders = null) - { - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - foreach (self::$tabletDevices as $_regex) { - if ($this->match($_regex, $userAgent)) { - return true; - } - } - - return false; - } - - /** - * This method checks for a certain property in the - * userAgent. - * @todo: The httpHeaders part is not yet used. - * - * @param $key - * @param string $userAgent deprecated - * @param string $httpHeaders deprecated - * @return bool|int|null - */ - public function is($key, $userAgent = null, $httpHeaders = null) - { - // Set the UA and HTTP headers only if needed (eg. batch mode). - if ($httpHeaders) { - $this->setHttpHeaders($httpHeaders); - } - - if ($userAgent) { - $this->setUserAgent($userAgent); - } - - $this->setDetectionType(self::DETECTION_TYPE_EXTENDED); - - return $this->matchUAAgainstKey($key); - } - - /** - * Some detection rules are relative (not standard), - * because of the diversity of devices, vendors and - * their conventions in representing the User-Agent or - * the HTTP headers. - * - * This method will be used to check custom regexes against - * the User-Agent string. - * - * @param $regex - * @param string $userAgent - * @return bool - * - * @todo: search in the HTTP headers too. - */ - public function match($regex, $userAgent = null) - { - // Escape the special character which is the delimiter. - $regex = str_replace('/', '\/', $regex); - - return (bool) preg_match('/'.$regex.'/is', (!empty($userAgent) ? $userAgent : $this->userAgent)); - } - - /** - * Get the properties array. - * - * @return array - */ - public static function getProperties() - { - return self::$properties; - } - - /** - * Prepare the version number. - * - * @todo Remove the error supression from str_replace() call. - * - * @param string $ver The string version, like "2.6.21.2152"; - * - * @return float - */ - public function prepareVersionNo($ver) - { - $ver = str_replace(array('_', ' ', '/'), '.', $ver); - $arrVer = explode('.', $ver, 2); - - if (isset($arrVer[1])) { - $arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions. - } - - return (float) implode('.', $arrVer); - } - - /** - * Check the version of the given property in the User-Agent. - * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) - * - * @param string $propertyName The name of the property. See self::getProperties() array - * keys for all possible properties. - * @param string $type Either self::VERSION_TYPE_STRING to get a string value or - * self::VERSION_TYPE_FLOAT indicating a float value. This parameter - * is optional and defaults to self::VERSION_TYPE_STRING. Passing an - * invalid parameter will default to the this type as well. - * - * @return string|float The version of the property we are trying to extract. - */ - public function version($propertyName, $type = self::VERSION_TYPE_STRING) - { - if (empty($propertyName)) { - return false; - } - - //set the $type to the default if we don't recognize the type - if ($type != self::VERSION_TYPE_STRING && $type != self::VERSION_TYPE_FLOAT) { - $type = self::VERSION_TYPE_STRING; - } - - $properties = self::getProperties(); - - // Check if the property exists in the properties array. - if (array_key_exists($propertyName, $properties)) { - - // Prepare the pattern to be matched. - // Make sure we always deal with an array (string is converted). - $properties[$propertyName] = (array) $properties[$propertyName]; - - foreach ($properties[$propertyName] as $propertyMatchString) { - - $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString); - - // Escape the special character which is the delimiter. - $propertyPattern = str_replace('/', '\/', $propertyPattern); - - // Identify and extract the version. - preg_match('/'.$propertyPattern.'/is', $this->userAgent, $match); - - if (!empty($match[1])) { - $version = ( $type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1] ); - - return $version; - } - - } - - } - - return false; - } - - /** - * Retrieve the mobile grading, using self::MOBILE_GRADE_* constants. - * - * @return string One of the self::MOBILE_GRADE_* constants. - */ - public function mobileGrade() - { - $isMobile = $this->isMobile(); - - if ( - // Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1) - $this->isIOS() && $this->version('iPad', self::VERSION_TYPE_FLOAT)>=4.3 || - $this->isIOS() && $this->version('iPhone', self::VERSION_TYPE_FLOAT)>=3.1 || - $this->isIOS() && $this->version('iPod', self::VERSION_TYPE_FLOAT)>=3.1 || - - // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) - // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM - // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices - // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 - ( $this->version('Android', self::VERSION_TYPE_FLOAT)>2.1 && $this->is('Webkit') ) || - - // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 - $this->version('Windows Phone OS', self::VERSION_TYPE_FLOAT)>=7.0 || - - // Blackberry 7 - Tested on BlackBerry Torch 9810 - // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670 - $this->is('BlackBerry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)>=6.0 || - // Blackberry Playbook (1.0-2.0) - Tested on PlayBook - $this->match('Playbook.*Tablet') || - - // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) - ( $this->version('webOS', self::VERSION_TYPE_FLOAT)>=1.4 && $this->match('Palm|Pre|Pixi') ) || - // Palm WebOS 3.0 - Tested on HP TouchPad - $this->match('hp.*TouchPad') || - - // Firefox Mobile (12 Beta) - Tested on Android 2.3 device - ( $this->is('Firefox') && $this->version('Firefox', self::VERSION_TYPE_FLOAT)>=12 ) || - - // Chrome for Android - Tested on Android 4.0, 4.1 device - ( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT)>=4.0 ) || - - // Skyfire 4.1 - Tested on Android 2.3 device - ( $this->is('Skyfire') && $this->version('Skyfire', self::VERSION_TYPE_FLOAT)>=4.1 && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT)>=2.3 ) || - - // Opera Mobile 11.5-12: Tested on Android 2.3 - ( $this->is('Opera') && $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT)>11 && $this->is('AndroidOS') ) || - - // Meego 1.2 - Tested on Nokia 950 and N9 - $this->is('MeeGoOS') || - - // Tizen (pre-release) - Tested on early hardware - $this->is('Tizen') || - - // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser - // @todo: more tests here! - $this->is('Dolfin') && $this->version('Bada', self::VERSION_TYPE_FLOAT)>=2.0 || - - // UC Browser - Tested on Android 2.3 device - ( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android', self::VERSION_TYPE_FLOAT)>=2.3 ) || - - // Kindle 3 and Fire - Tested on the built-in WebKit browser for each - ( $this->match('Kindle Fire') || - $this->is('Kindle') && $this->version('Kindle', self::VERSION_TYPE_FLOAT)>=3.0 ) || - - // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet - $this->is('AndroidOS') && $this->is('NookTablet') || - - // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 - $this->version('Chrome', self::VERSION_TYPE_FLOAT)>=11 && !$isMobile || - - // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 - $this->version('Safari', self::VERSION_TYPE_FLOAT)>=5.0 && !$isMobile || - - // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 - $this->version('Firefox', self::VERSION_TYPE_FLOAT)>=4.0 && !$isMobile || - - // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 - $this->version('MSIE', self::VERSION_TYPE_FLOAT)>=7.0 && !$isMobile || - - // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 - // @reference: http://my.opera.com/community/openweb/idopera/ - $this->version('Opera', self::VERSION_TYPE_FLOAT)>=10 && !$isMobile - - ){ - return self::MOBILE_GRADE_A; - } - - if ( - $this->isIOS() && $this->version('iPad', self::VERSION_TYPE_FLOAT)<4.3 || - $this->isIOS() && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<3.1 || - $this->isIOS() && $this->version('iPod', self::VERSION_TYPE_FLOAT)<3.1 || - - // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 - $this->is('Blackberry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)>=5 && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<6 || - - //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 - ( $this->version('Opera Mini', self::VERSION_TYPE_FLOAT)>=5.0 && $this->version('Opera Mini', self::VERSION_TYPE_FLOAT)<=6.5 && - ($this->version('Android', self::VERSION_TYPE_FLOAT)>=2.3 || $this->is('iOS')) ) || - - // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) - $this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || - - // @todo: report this (tested on Nokia N71) - $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT)>=11 && $this->is('SymbianOS') - ){ - return self::MOBILE_GRADE_B; - } - - if ( - // Blackberry 4.x - Tested on the Curve 8330 - $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<5.0 || - // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) - $this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT)<=5.2 - - ){ - return self::MOBILE_GRADE_C; - } - - //All older smartphone platforms and featurephones - Any device that doesn't support media queries - //will receive the basic, C grade experience. - return self::MOBILE_GRADE_C; - } -} -?> \ No newline at end of file diff --git a/_incl_data/class/pay.php b/_incl_data/class/pay.php deleted file mode 100644 index 554d326e..00000000 --- a/_incl_data/class/pay.php +++ /dev/null @@ -1,243 +0,0 @@ - 'pay_operations', // - 'db_host' => 'localhost', - 'db_user' => 'newcom1_abk', - 'db_pass' => '4nWYsIM[c?}P', - 'db_base' => 'newcom1_abk', - /* */ - 'ip_list' => array('127,0,0,1,188.166.34.68,136.243.38.147,136.243.38.149,136.243.38.150,136.243.38.151,136.243.38.189,88.198.88.98'), // ( IP) - 'key' => 'qtzl0igb', //gamedealer key - 'id' => '65643' //ID - ), - $ip = '', - $BACK = array(); // - - // -8 - public function in($text) { - return iconv("UTF-8","cp1251",$text); - } - - // -8 - public function out($text) { - return iconv("cp1251","UTF-8",$text); - } - - // - public function add($type,$value,$money) { - mysql_query('INSERT INTO `'.$this->c['db_name'].'` (`time`,`type`,`ip`,`value`,`money`,`project`) VALUES ("'.time().'","'.mysql_real_escape_string($type).'","'.$_SERVER['HTTP_X_REAL_IP'].'","'.mysql_real_escape_string($value).'","'.mysql_real_escape_string($money).'","'.mysql_real_escape_string($this->id).'")'); - } - - // - public function connect_db() { - $db = mysql_connect($this->c['db_host'],$this->c['db_user'],$this->c['db_pass']) or die(' MySQL !'); - mysql_select_db($this->c['db_base'],$db) or die(' !'); - mysql_query('SET NAMES cp1251'); - } - - public function output($a,$v = NULL) { - $r = ''; - $i = 0; - while($i < count($a)) { - $rn = ''; - $tb = ''; - if($v != NULL) { - $rn = "\r\n"; - $tb = " "; - } - $r .= $rn.'<'.$a[$i][0].'>'; - if(!is_array($a[$i][1])) { - $rn = ''; - $tb = ''; - $r .= $rn.$tb.($this->out($a[$i][1])); - }else{ - if($i > 0) { - $r .= $rn; - } - $r .= $tb.($this->output($a[$i][1],1)); - } - $r .= $rn.''; - $i++; - } - return $r; - } - - // XML- - public function backInformation() { - header('Content-Type: text/html/force-download'); - echo ''; - echo $this->output($this->BACK,1); - } - - // - public function test_accaunt($nick) { - $r = false; - $nick = mysql_fetch_array(mysql_query('SELECT `id` FROM `bank` WHERE `id` = "'.mysql_real_escape_string($nick).'" LIMIT 1')); - if(isset($nick['id'])) { - $r = true; - } - return $r; - } - - // - public function getBank($nick) { - $nick = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($nick).'" LIMIT 1')); - $nick = mysql_fetch_array(mysql_query('SELECT `id` FROM `bank` WHERE `uid` = "'.mysql_real_escape_string($nick['id']).'" LIMIT 1')); - return $nick['id']; - } - - // - public function bank_user($nick) { - $nick = mysql_fetch_array(mysql_query('SELECT `id`,`uid FROM `bank` WHERE `id` = "'.mysql_real_escape_string($nick).'" LIMIT 1')); - $nick = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `login` = "'.mysql_real_escape_string($nick['uid']).'" LIMIT 1')); - return $nick['login']; - } - - // - public function start_session() { - - $this->ip = $_SERVER['HTTP_X_REAL_IP']; - - // - $this->connect_db(); - - // - //$xml = file_get_contents('php://input'); - - // XML - if(function_exists('simplexml_load_string')) { - $xml = simplexml_load_string($xml); - }else{ - $this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc',' ')))); - die($this->backInformation()); - } - - $this->id = $xml->projectid; - - if(!in_array($this->ip,$this->c['ip_list'])) { - $this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc',' IP')))); - die($this->backInformation()); - } - - // - if($xml->method == 'check_balance') { - //MD5(method+MD5(gdKey)) - - $sign = md5($xml->method.md5($this->c['key'])); - - if($sign == $xml->sign) { - // - $balance = 1000000; - $this->BACK = array(array('gdanswer',array(array('status','1'),array('desc',' : '.$balance),array('balance',$balance)))); - $this->add('4','check:'.$xml->nick.':1'.$r,0); - } - - }elseif($xml->method == 'check') { - /* - nick - MD5(nick+method+MD5(gdKey)) */ - - $sign = md5($xml->nick.$xml->method.md5($this->c['key'])); - - if($sign == $xml->sign) { - $xml->nick = $this->in($xml->nick); - if($this->test_accaunt($xml->nick) == true) { - // - $this->BACK = array(array('gdanswer',array(array('status','1'),array('desc',' ')))); - $this->add('3','check:'.$xml->nick.':1'.$r,0); - }else{ - // - $this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc',' . .')))); - $this->add('-1',' :pay:'.$xml->nick.':0',0); - } - } - }elseif($xml->method == 'pay') { - /* - nick - , projectid - id , sign , amount - , payid - id */ - - $sign = md5($xml->nick.$xml->projectid.$xml->amount.$xml->payid.$xml->method.md5($this->c['key'])); - - if($sign == $xml->sign) { - $xml->nick = $this->in($xml->nick); - if($this->test_accaunt($xml->nick) == true) { - // - $bank = $this->test_accaunt($xml->nick); - if($bank > 0) { - mysql_query('UPDATE `bank` SET `money2` = `money2` + '.mysql_real_escape_string($xml->amount).' WHERE `id` = "'.mysql_real_escape_string($xml->nick).'" LIMIT 1'); - $this->BACK = array(array('gdanswer',array(array('status','1'),array('desc',' '),array('id',$this->c['id'])))); - $this->add('2','pay:'.$xml->nick.':'.$xml->projectid.':'.$xml->sign.':'.$xml->amount.':'.$xml->payid.':'.$bank['id'],$xml->amount); - - $user = mysql_fetch_array(mysql_query('SELECT `id`,`uid` FROM `bank` WHERE `id` = "'.mysql_real_escape_string($xml->nick).'" LIMIT 1')); - $user = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`city`,`sex`,`room` FROM `users` WHERE `id` = "'.mysql_real_escape_string($user['uid']).'" LIMIT 1')); - - mysql_query('UPDATE `users` SET `catch` = `catch` + '.mysql_real_escape_string(floor($xml->amount)).' WHERE `id` = "'.mysql_real_escape_string($xml->nick).'" LIMIT 1'); - - $r = ''.date('d.m.Y H:i').' Enchanter / : '; - - if($user['sex'] == 1) { - $r .= ''; - }else{ - $r .= ''; - } - - $r .= ' '.$user['login'].', '.$bank.' '.$xml->amount.' Ekr. !'; - - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$user['city']."','".$user['room']."','','".$user['login']."','".$r."','-1','5','0')"); - - }else{ - $this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc',' '),array('id',$this->c['id'])))); - $this->add('-1',' :pay:'.$xml->nick.':'.$xml->projectid.':'.$xml->sign.':'.$xml->amount.':'.$xml->payid.':'.$bank['id'],$xml->amount); - } - }else{ - // - $this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc',' . .')))); - $this->add('-1',' :pay:'.$xml->nick.':0',0); - } - }else{ - // - $this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc',' ')))); - $this->add('-1',' :pay:'.$xml->nick.':0',0); - } - }elseif($xml->method == 'check_login') { - /* - nick - , projectid - id , sign */ - $sign = md5($xml->nick.$xml->method.md5($this->c['key'])); - - if($sign == $xml->sign) { - $xml->nick = $this->in($xml->nick); - if($this->test_accaunt($xml->nick) == true) { - // - $this->BACK = array(array('gdanswer',array(array('status','1'),array('desc',' '),array('addinfo',$this->bank_user($xml->nick))))); - $this->add('1','check_login:'.$xml->nick.':1'.$r,0); - }else{ - // - $this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc',' ')))); - $this->add('-1',' :check_login:'.$xml->nick.':0',0); - } - }else{ - // - $this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc',' ')))); - $this->add('-1',' :pay:'.$xml->nick.':0',0); - } - }else{ - $this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc',' ')))); - $this->add('-1',' :error_method:gamedealer',0); - } - - // - /* - $this->BACK = array( - array('gdanswer',array(array('status',-100),array('desc',' '))) - ); - */ - - // - $this->backInformation(); - } -} - -$pay = new GameDealerClass; -$pay->start_session(); -?> diff --git a/_incl_data/class/priem/104.php b/_incl_data/class/priem/104.php index 98b44c7b..690f4da7 100644 --- a/_incl_data/class/priem/104.php +++ b/_incl_data/class/priem/104.php @@ -24,8 +24,8 @@ if( isset($pr_momental_this)) { unset( $pr_used_this ); }else{ - $pvr['hp_0'] = 1; - $pvr['hp_1'] = 95; + $pvr['hp_0'] = 50; + $pvr['hp_1'] = 65; // $pvr['hp'] = floor(rand($pvr['hp_0'],$pvr['hp_1'])); diff --git a/_incl_data/class/priem/113.php b/_incl_data/class/priem/113.php index dca15d45..6b1a3318 100644 --- a/_incl_data/class/priem/113.php +++ b/_incl_data/class/priem/113.php @@ -7,7 +7,7 @@ if(!defined('GAME')) { */ $pvr = array(); // - $pvr['hp'] = rand(34,41); + $pvr['hp'] = rand(46,54); $pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], '', 1 ); $pvr['promah_type'] = $pvr['hp'][3]; $pvr['promah'] = $pvr['hp'][2]; diff --git a/_incl_data/class/priem/122.php b/_incl_data/class/priem/122.php index 8d31cdd8..47b1c4b5 100644 --- a/_incl_data/class/priem/122.php +++ b/_incl_data/class/priem/122.php @@ -126,7 +126,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) { }; unset( $pr_used_this ); }else{ - $pvr['hp'] = floor(rand(66,71)); + $pvr['hp'] = floor(rand(70,81)); $pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], '', 0 ); $pvr['promah_type'] = $pvr['hp'][3]; $pvr['promah'] = $pvr['hp'][2]; diff --git a/_incl_data/class/priem/128.php b/_incl_data/class/priem/128.php index c11ee20e..ed8b525a 100644 --- a/_incl_data/class/priem/128.php +++ b/_incl_data/class/priem/128.php @@ -6,7 +6,7 @@ if(!defined('GAME')) { : [8] */ $pvr = array(); - $pvr['hp_0'] = 13; + $pvr['hp_0'] = 30; // $pvr['hp'] = $pvr['hp_0']; $pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], '', 1 ); diff --git a/_incl_data/class/priem/134.php b/_incl_data/class/priem/134.php index 5df483bb..da36ceab 100644 --- a/_incl_data/class/priem/134.php +++ b/_incl_data/class/priem/134.php @@ -24,8 +24,8 @@ if( isset($pr_momental_this)) { unset( $pr_used_this ); }else{ - $pvr['hp_0'] = 25; - $pvr['hp_1'] = 51; + $pvr['hp_0'] = 30; + $pvr['hp_1'] = 50; // $pvr['hp'] = floor($pvr['hp_1']); diff --git a/_incl_data/class/priem/141.php.bac.php b/_incl_data/class/priem/141.php.bac.php deleted file mode 100644 index 41ef7b63..00000000 --- a/_incl_data/class/priem/141.php.bac.php +++ /dev/null @@ -1,127 +0,0 @@ -stats[$btl->uids[$uid]]['um_priem'][$j_id])) { - global $u, $btl; - $yron = $yron/4; - $btl->priemAddLogFast( $uid, 0, " ", - '{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$uid]]['sex'] , NULL).'', - 0, time() ); - if( $yron < 0 ) { - $yron = 1; - } - $btl->stats[$btl->uids[$uid]]['um_priem'][$j_id] = true; - } - return round($yron); - }; -}elseif( isset($pr_tested_this) ) { - $fx_priem = function( $id , $at , $uid, $j_id ) { - // -- - global $u, $btl; - // - // - $pvr['used'] = 0; - // - $uid1 = $btl->atacks[$id]['uid1']; - $uid2 = $btl->atacks[$id]['uid2']; - if( $uid == $uid2 ) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - }elseif( $uid == $uid1 ) { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - /* - if((!isset($btl->atacks[$id]['newsf5']) || $btl->atacks[$id]['newsf5'] == false) && (!isset($btl->atacks[$id]['stopfx']) || $btl->atacks[$id]['stopfx'] == false)) { - if( isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) { - mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][3].'" AND `uid` = "'.$uid.'" LIMIT 1'); - unset($btl->stats[$btl->uids[$uid]]['u_priem'][$j_id]); - $btl->stats[$btl->uids[$uid]]['u_priem'][$j_id] = false; - } - } - */ - // - // -- - return $at; - }; - unset( $pr_used_this ); -}elseif( isset($pr_used_this) ) { - $fx_priem = function( $id , $at , $uid, $j_id ) { - // -- - global $u, $btl; - // - // - $pvr['used'] = 0; - // - $uid1 = $btl->atacks[$id]['uid1']; - $uid2 = $btl->atacks[$id]['uid2']; - if( $uid == $uid2 ) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - }elseif( $uid == $uid1 ) { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - if( $a > 0 ) { - $j = 0; $k = 0; $wp = 3; - while($j < count($at['p'][$a]['atack'])) { - if( isset($at['p'][$a]['atack'][$j]['yron']) && ( - $at['p'][$a]['atack'][$j][1] == 1 || - $at['p'][$a]['atack'][$j][1] == 4 || - $at['p'][$a]['atack'][$j][1] == 5 )) { - //if( !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) { - // - $at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y']/4); - $at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r']/4); - $at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k']/4); - $at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k']/4); - $at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y']/4); - // - if( $at['p'][$a]['atack'][$j]['yron']['y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['y'] = 1; } - if( $at['p'][$a]['atack'][$j]['yron']['r'] >= 0 ) { $at['p'][$a]['atack'][$j]['yron']['r'] = -1; } - if( $at['p'][$a]['atack'][$j]['yron']['k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['k'] = 1; } - if( $at['p'][$a]['atack'][$j]['yron']['m_k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; } - if( $at['p'][$a]['atack'][$j]['yron']['m_y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1; } - // - if( $pvr['used'] == 0 ) { - $at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.', - " ", - "{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'", - '.($btl->hodID + 1).' );'; - } - // - $at['p'][$a]['atack'][$j]['yron']['used'][] = array($j_id,$uid,$pvr['used']); - $at['p'][$a]['atack'][$j]['yron']['kill'][] = array($j_id,$uid,$pvr['kill']); - // - $at['p'][$a]['priems']['kill'][$uid][$j_id] = true; - //} - } - $j++; - } - } - // -- - return $at; - }; - unset( $pr_used_this ); -}else{ - // - $this->addEffPr($pl,$id); -} -unset($pvr); -?> \ No newline at end of file diff --git a/_incl_data/class/priem/141.php.bac1 b/_incl_data/class/priem/141.php.bac1 deleted file mode 100644 index 7aca8200..00000000 --- a/_incl_data/class/priem/141.php.bac1 +++ /dev/null @@ -1,140 +0,0 @@ -stats[$btl->uids[$uid]]['um_priem'][$j_id])) { - global $u, $btl; - if( $btl->stats[$btl->uids[$u2]]['effects'][$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][0]]['name'] == '' ) { - //$yron = $yron/10; - }else{ - //$yron = $yron/4; - } - $btl->priemAddLogFast( $uid, 0, "".$btl->stats[$btl->uids[$u2]]['effects'][$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][0]]['name']."", - '{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$uid]]['sex'] , NULL).'', - 0, time() ); - if( $yron < 0 ) { - $yron = 1; - } - $btl->stats[$btl->uids[$uid]]['um_priem'][$j_id] = true; - } - return round($yron); - }; -}elseif( isset($pr_tested_this) ) { - $fx_priem = function( $id , $at , $uid, $j_id ) { - // -- - global $u, $btl; - // - // - $pvr['used'] = 0; - // - $uid1 = $btl->atacks[$id]['uid1']; - $uid2 = $btl->atacks[$id]['uid2']; - if( $uid == $uid2 ) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - }elseif( $uid == $uid1 ) { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - if( isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) { - mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][3].'" AND `uid` = "'.$uid.'" LIMIT 1'); - unset($btl->stats[$btl->uids[$uid]]['u_priem'][$j_id]); - } - // - // -- - return $at; - }; - unset( $pr_used_this ); -}elseif( isset($pr_used_this) ) { - $fx_priem = function( $id , $at , $uid, $j_id ) { - // -- - global $u, $btl; - // - // - $pvr['used'] = 0; - // - $uid1 = $btl->atacks[$id]['uid1']; - $uid2 = $btl->atacks[$id]['uid2']; - if( $uid == $uid2 ) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - }elseif( $uid == $uid1 ) { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - if( $a > 0 ) { - $j = 0; $k = 0; $wp = 3; - /*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->deleffm(141,'.(0+$uid).','.$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][3].'); - $this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.', - "'.$btl->stats[$btl->uids[$u2]]['effects'][$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][0]]['name'].'", - "{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'", - '.($btl->hodID + 1).' );';*/ - while($j < count($at['p'][$a]['atack'])) { - if( isset($at['p'][$a]['atack'][$j]['yron']) && ( - $at['p'][$a]['atack'][$j][1] == 1 || - $at['p'][$a]['atack'][$j][1] == 4 || - $at['p'][$a]['atack'][$j][1] == 5 )) { - //if( !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) { - // - /*if( $btl->stats[$btl->uids[$u2]]['effects'][$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][0]]['name'] == '' ) { - $at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y']/10); - $at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r']/10); - $at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k']/10); - $at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k']/10); - $at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y']/10); - }else{ - $at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y']/4); - $at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r']/4); - $at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k']/4); - $at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k']/4); - $at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y']/4); - } - // - if( $at['p'][$a]['atack'][$j]['yron']['y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['y'] = 1; } - if( $at['p'][$a]['atack'][$j]['yron']['r'] >= 0 ) { $at['p'][$a]['atack'][$j]['yron']['r'] = -1; } - if( $at['p'][$a]['atack'][$j]['yron']['k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['k'] = 1; } - if( $at['p'][$a]['atack'][$j]['yron']['m_k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; } - if( $at['p'][$a]['atack'][$j]['yron']['m_y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1; } - // - if( $pvr['used'] == 0 ) { - /*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->deleffm(141,'.(0+$uid).','.$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][3].'); - $this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.', - "'.$btl->stats[$btl->uids[$u2]]['effects'][$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][0]]['name'].'", - "{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'", - '.($btl->hodID + 1).' );';*/ - /*}*/ - // - $at['p'][$a]['atack'][$j]['yron']['used'][] = array($j_id,$uid,$pvr['used']); - $at['p'][$a]['atack'][$j]['yron']['kill'][] = array($j_id,$uid,$pvr['kill']); - // - $at['p'][$a]['priems']['kill'][$uid][$j_id] = true; - //} - } - $j++; - } - } - // -- - return $at; - }; - unset( $pr_used_this ); -}else{ - // - $this->addEffPr($pl,$id); -} -unset($pvr); -?> \ No newline at end of file diff --git a/_incl_data/class/priem/161.php b/_incl_data/class/priem/161.php index b3e2c835..266553f1 100644 --- a/_incl_data/class/priem/161.php +++ b/_incl_data/class/priem/161.php @@ -36,7 +36,7 @@ $pvr = array(); // $pvr['hp'] = $btl->testYronPriem( $u->info['id'], $pvr['uid'], 21, $pvr['hp'], 5, true ); - if(!$pvr['krit']) { + if( $pvr['krit'] == false ) { if( $pvr['hp'] > $pvr['lim'] ) { $pvr['hp'] = $pvr['lim']; } @@ -48,6 +48,7 @@ $pvr = array(); $pvr['hpSee'] = '-'.$pvr['hp']; $pvr['hpNow'] -= $pvr['hp']; $btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0); + if( $pvr['hpNow'] > $pvr['hpAll'] ) { @@ -61,8 +62,8 @@ $pvr = array(); mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$pvr['uid']]]['hpNow'].'" WHERE `id` = "'.$pvr['uid'].'" LIMIT 1'); // - if(!$pvr['promah']) { - if(!$pvr['krit']) { + if( $pvr['promah'] == false ) { + if( $pvr['krit'] == false ) { $prv['color2'] = '006699'; if(isset($btl->mcolor[$btl->mname['']])) { $prv['color2'] = $btl->mcolor[$btl->mname['']]; @@ -95,7 +96,12 @@ $pvr = array(); ($btl->hodID + 1) ); - + // + //$this->addEffPr($pl,$id); + //$this->addPriem($pvr['uid'],$pl['id'],'atgm='.floor($pvr['hp']/5).'',0,77,5,$u->info['id'],1,'',0,0,1); + + // + //$this->mintr($pl); // $pvr['xx']++; } @@ -104,6 +110,12 @@ $pvr = array(); $btl->delPriem($pvr['x5'],$btl->users[$btl->uids[$this->ue['id']]],2); // + // + //$this->addEffPr($pl,$id); + //$this->addPriem($this->ue['id'],$pl['id'],'atgm='.($pvr['hp']/16).'',2,77,4,$u->info['id'],3,'',0,0,1); + + // + //$this->mintr($pl); unset($pvr); ?> \ No newline at end of file diff --git a/_incl_data/class/priem/170.php b/_incl_data/class/priem/170.php index 31c32841..c4a97970 100644 --- a/_incl_data/class/priem/170.php +++ b/_incl_data/class/priem/170.php @@ -7,7 +7,7 @@ if(!defined('GAME')) { */ $pvr = array(); // - $pvr['hp'] = rand(40,80); + $pvr['hp'] = rand(50,90); //$pvr['hp'] = floor($pvr['hp']*0.95); //$pvr['hp'] = $this->magatackfiz( $u->info['id'], $this->ue['id'], $pvr['hp'], '' /* - 3 */, 1 , '' ); $pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], '', 1 ); // diff --git a/_incl_data/class/priem/180.php b/_incl_data/class/priem/180.php index 163e5c97..5853af34 100644 --- a/_incl_data/class/priem/180.php +++ b/_incl_data/class/priem/180.php @@ -11,7 +11,7 @@ $pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHE if( $pvr['x5']['x'] < 5 ) { $prv['x'] = ''; if( $pvr['x5']['x'] > 0 ) { - $prv['x'] = ' x'.($pvr['x5']['x']+1); + $prv['x'] = ' x'.($pvr['x5']['x']+1).''; } // $this->addEffPr($pl,$id); diff --git a/_incl_data/class/priem/193.php.bac b/_incl_data/class/priem/193.php.bac deleted file mode 100644 index eca72ee9..00000000 --- a/_incl_data/class/priem/193.php.bac +++ /dev/null @@ -1,116 +0,0 @@ -atacks[$id]['uid1']; - $uid2 = $btl->atacks[$id]['uid2']; - if( $uid == $uid1 ) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - }elseif( $uid == $uid2 ) { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - if( isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) { - mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][3].'" AND `uid` = "'.$uid.'" LIMIT 1'); - unset($btl->stats[$btl->uids[$uid]]['u_priem'][$j_id]); - } - // - // -- - return $at; - }; - unset( $pr_used_this ); -}elseif( isset($pr_used_this) ) { - $fx_priem = function( $id , $at , $uid, $j_id ) { - // -- - global $u, $btl; - // - // - $pvr['used'] = 0; - // - $uid1 = $btl->atacks[$id]['uid1']; - $uid2 = $btl->atacks[$id]['uid2']; - if( $uid == $uid1 ) { - $a = 1; - $b = 2; - $u1 = ${'uid1'}; - $u2 = ${'uid2'}; - }elseif( $uid == $uid2 ) { - $a = 2; - $b = 1; - $u1 = ${'uid2'}; - $u2 = ${'uid1'}; - } - if( $a > 0 ) { - $j = 0; $k = 0; $wp = 3; - while($j < count($at['p'][$a]['atack'])) { - if( isset($at['p'][$a]['atack'][$j]['yron']) && ( - $at['p'][$a]['atack'][$j][1] == 1 || - $at['p'][$a]['atack'][$j][1] == 4 || - $at['p'][$a]['atack'][$j][1] == 5 )) { - //if( $pvr['used'] == 0 && !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) { - // - $pvr['hp'] = 6 * $btl->users[$btl->uids[$u1]]['level']; - $pvr['hp'] = $btl->testYronPriem( $u1, $u2, 12, $pvr['hp'], -1, true, false, 0 ); - if( $pvr['hp'] <= 1 ) { - $pvr['hp'] = 0; - $at['p'][$a]['atack'][$j]['yron']['y'] = 1; - $at['p'][$a]['atack'][$j]['yron']['r'] = -1; - $at['p'][$a]['atack'][$j]['yron']['k'] = 1; - $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; - $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1; - } - else - { - $at['p'][$a]['atack'][$j]['yron']['y'] += $pvr['hp']; - $at['p'][$a]['atack'][$j]['yron']['r'] -= $pvr['hp']; - $at['p'][$a]['atack'][$j]['yron']['k'] += $pvr['hp']; - $at['p'][$a]['atack'][$j]['yron']['m_y'] += $pvr['hp']; - $at['p'][$a]['atack'][$j]['yron']['m_k'] += $pvr['hp']; - } - //$at['p'][$a]['atack'][$j]['yron'] = $btl->testYronPriemAttack( 193 , $u1 , $u2 , $at['p'][$a]['atack'][$j]['yron'] ); - // - if( $pvr['used'] == 0 && !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) { - $at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$a.', '.$b.', '.$u1.', '.$u2.', - " ", - "{tm1} '.$btl->addlt($a , 17 , $btl->users[$btl->uids[$u1]]['sex'] , NULL).'", - '.($btl->hodID + 1).' );'; - // - $at['p'][$a]['atack'][$j]['yron']['used'][] = array($j_id,$uid,$pvr['used']); - $at['p'][$a]['atack'][$j]['yron']['kill'][] = array($j_id,$uid,$pvr['kill']); - } - // - $at['p'][$a]['priems']['kill'][$uid][$j_id] = true; - //} - } - $j++; - } - } - // - // -- - return $at; - }; - unset( $pr_used_this ); -}else{ - // - $this->addEffPr($pl,$id); -} -unset($pvr); -?> \ No newline at end of file diff --git a/_incl_data/class/priem/232.php.bac b/_incl_data/class/priem/232.php.bac deleted file mode 100644 index 64f0b365..00000000 --- a/_incl_data/class/priem/232.php.bac +++ /dev/null @@ -1,72 +0,0 @@ -users[$btl->uids[$u->info['id']]]['tactic1']+$btl->users[$btl->uids[$u->info['id']]]['tactic2']+$btl->users[$btl->uids[$u->info['id']]]['tactic3']+$btl->users[$btl->uids[$u->info['id']]]['tactic4']+$btl->users[$btl->uids[$u->info['id']]]['tactic5']+$btl->users[$btl->uids[$u->info['id']]]['tactic6']*0.5 ); -if( $pvr['hp'] > 25 ) { - $pvr['hp'] = 25; -} -$pvr['hp'] = round($btl->stats[$btl->uids[$u->info['id']]]['hpAll']/100*$pvr['hp']); -$pvr['hpSee'] = '--'; -$pvr['hpNow'] = floor($btl->stats[$btl->uids[$this->ue['id']]]['hpNow']); -$pvr['hpAll'] = $btl->stats[$btl->uids[$u->info['id']]]['hpAll']; -$pvr['hp'] = $btl->hphe( $u->info['id'] , $pvr['hp'] , true ); -$pvr['hpTr'] = $pvr['hpAll'] - $pvr['hpNow']; -if( $pvr['hpTr'] > 0 ) { - // - if( $pvr['hpTr'] < $pvr['hp'] ) { - $pvr['hp'] = $pvr['hpTr']; - } - $pvr['hpSee'] = '+'.$pvr['hp']; - $pvr['hpNow'] += $pvr['hp']; -} - -if( $pvr['hpNow'] > $pvr['hpAll'] ) { - $pvr['hpNow'] = $pvr['hpAll']; -}elseif( $pvr['hpNow'] < 0 ) { - $pvr['hpNow'] = 0; -} - -$btl->users[$btl->uids[$u->info['id']]]['last_hp'] = $pvr['hp']; - -$u->info['hpNow'] = $pvr['hpNow']; -$u->stats['hpNow'] = $pvr['hpNow']; -$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow']; - -$pvr['i']=1; -while($pvr['i'] <= 6) { - $btl->users[$btl->uids[$u->info['id']]]['tactic'.$pvr['i']] = 0; - $btl->stats[$btl->uids[$u->info['id']]]['tactic'.$pvr['i']] = 0; - $u->info['tactic'.$pvr['i']] = 0; - $u->stats['tactic'.$pvr['i']] = 0; - $pvr['i']++; -} - -mysql_query('UPDATE `stats` SET -`last_hp` = "'.$btl->users[$btl->uids[$u->info['id']]]['last_hp'].'", -`hpNow` = "'.$pvr['hpNow'].'", -`tactic1` = "0", -`tactic2` = "0", -`tactic3` = "0", -`tactic4` = "0", -`tactic5` = "0", -`tactic6` = "0" -WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - -$btl->priemAddLog( $id, 1, 2, $u->info['id'], $u->info['enemy'], - '', - '{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL).' '.$pvr['hpSee'].' ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']', - ($btl->hodID) -); - -// -$this->mintr($pl); - -unset($pvr); -?> \ No newline at end of file diff --git a/_incl_data/class/priem/244.php b/_incl_data/class/priem/244.php index 30adf7f4..2991e7d4 100644 --- a/_incl_data/class/priem/244.php +++ b/_incl_data/class/priem/244.php @@ -1,13 +1,7 @@ -stats[$btl->uids[$this->ue['id']]]['hpNow'] > round($btl->stats[$btl->uids[$this->ue['id']]]['hpAll'] / 100 * 33) ) { - echo ' 33%'; + echo ' 33%'; $cup = true; } elseif (!isset($pvr['mg']['id'])) { - echo ' ( )'; + echo ' ( )'; $cup = true; } else { // @@ -30,6 +24,25 @@ if ( // = 150% ( * * 150/100). $pvr['hp'] = floor($pvr['data']['atgm'] * $pvr['mg']['hod'] * 1.5); +// $pvr['di'] = 0; +// $pvr['dc'] = count($pvr['data']['atgm']); +// $pvr['rd'] = 0; +// $pvr['redata'] = ''; +// while ($pvr['di'] < 4) { +// if (isset($pvr['data']['atgm'][($pvr['dc'] - $pvr['di'])])) { +// if ($pvr['rd'] < 3) { +// $pvr['hp'] += $pvr['data']['atgm'][($pvr['dc'] - $pvr['di'])]; +// $pvr['redata'] = 'atgm=' . $pvr['data']['atgm'][($pvr['dc'] - $pvr['di'])] . '|' . $pvr['redata']; +// $pvr['rd']++; +// } +// } +// $pvr['di']++; +// } + +// $pvr['hp23'] = $pvr['hp']; +// $pvr['hp'] = 450; +// $pvr['hp24'] = $pvr['hp']; + // , ! $pvr['hp_test'] = $this->magatack($u->info['id'], $this->ue['id'], $pvr['hp'], '', 1); @@ -64,13 +77,25 @@ if ( $prv['text'] = $btl->addlt(1, 19, $btl->users[$btl->uids[$u->info['id']]]['sex'], null); - - $prv['color'] = $pvr['krit'] ? "f00" : "a00"; + // + if (!$pvr['krit']) { + $prv['color2'] = '006699'; + if (isset($btl->mcolor[$btl->mname['']])) { + $prv['color2'] = $btl->mcolor[$btl->mname['']]; + } + $prv['color'] = '000000'; + if (isset($btl->mncolor[$btl->mname['']])) { + $prv['color'] = $btl->mncolor[$btl->mname['']]; + } + } else { + $prv['color2'] = 'FF0000'; + $prv['color'] = 'FF0000'; + } $prv['text2'] = '{tm1} ' . $prv['text'] . '. ' . $pvr['hpSee'] . ' [' . $pvr['hpNow'] . '/' . $pvr['hpAll'] . ']'; $btl->priemAddLog($id, 1, 2, $u->info['id'], $this->ue['id'], - ' ', + ' ', $prv['text2'], ($btl->hodID + 1) ); @@ -83,3 +108,4 @@ if ( $this->mintr($pl); } unset($pvr); +?> \ No newline at end of file diff --git a/_incl_data/class/priem/246.php b/_incl_data/class/priem/246.php index cc3c953c..03cf441f 100644 --- a/_incl_data/class/priem/246.php +++ b/_incl_data/class/priem/246.php @@ -32,7 +32,7 @@ if( isset($pr_momental_this)) { ); */ // - $pvr['mp'] = round($u->stats['mpAll']*0.05); + $pvr['mp'] = round($u->stats['mpAll']*0.15); $pvr['mpSee'] = 0; $pvr['mpNow'] = floor($u->stats['mpNow']); $pvr['mpAll'] = $u->stats['mpAll']; @@ -66,7 +66,7 @@ if( isset($pr_momental_this)) { $btl->stats[$btl->uids[$u->info['id']]]['mpNow'] = $pvr['mpNow']; $btl->users[$btl->uids[$u->info['id']]]['mpNow'] = $pvr['mpNow']; // - $pvr['hp'] = round($u->stats['hpAll']*0.05); + $pvr['hp'] = round($u->stats['hpAll']*0.15); $pvr['hpSee'] = 0; $pvr['hpNow'] = floor($u->stats['hpNow']); $pvr['hpAll'] = $u->stats['hpAll']; diff --git a/_incl_data/class/priem/250.php b/_incl_data/class/priem/250.php index 2f05b58f..1bfd9060 100644 --- a/_incl_data/class/priem/250.php +++ b/_incl_data/class/priem/250.php @@ -11,14 +11,14 @@ $pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHE if( $pvr['x5']['x'] < 5 ) { $prv['x'] = ''; if( $pvr['x5']['x'] > 0 ) { - $prv['x'] = ' x'.($pvr['x5']['x']+1); + $prv['x'] = ' x'.($pvr['x5']['x']+1).''; } // $this->addEffPr($pl,$id); // $prv['effx'] = ''; if( $pvr['x5']['x'] > 0 ) { - $prv['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id` = '.$pvr['x5']['id'])); + $prv['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id` = "'.$pvr['x5']['id'].'" LIMIT 1')); if( isset($prv['eff']['id']) ) { // $prv['eff']['data'] $prv['eda'] = $prv['eff']['data']; @@ -34,7 +34,7 @@ if( $pvr['x5']['x'] < 5 ) { $prv['v'] = $u->lookKeys($this->redate($prv['eda'],$u->info['id']),0); // 2 $prv['i'] = 0; $prv['inf'] = ''; while($prv['i']is[$prv['vi']]!='') { if($prv['j'][$prv['v'][$prv['i']]]>0) { diff --git a/_incl_data/class/priem/255.php b/_incl_data/class/priem/255.php index 563d5683..5c811279 100644 --- a/_incl_data/class/priem/255.php +++ b/_incl_data/class/priem/255.php @@ -99,8 +99,7 @@ if( isset($pr_momental_this)) { // //if( $at['p'][$a]['atack'][$j]['yron']['y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['y'] = 0; } if( $at['p'][$a]['atack'][$j]['yron']['r'] >= 0 ) { $at['p'][$a]['atack'][$j]['yron']['r'] = -1; } - $priem->addAirStaticPoints($u1); - + $priem->mg2static_points( $u1 , $btl->stats[$btl->uids[$u1]] ); /* if( $at['p'][$a]['atack'][$j]['yron']['k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['k'] = 1; } if( $at['p'][$a]['atack'][$j]['yron']['m_k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; } diff --git a/_incl_data/class/priem/263.php b/_incl_data/class/priem/263.php index 151c5b8b..5c526eed 100644 --- a/_incl_data/class/priem/263.php +++ b/_incl_data/class/priem/263.php @@ -1,113 +1,74 @@ -users[$btl->uids[$this->ue['id']]]['id'].'" AND `v2` = "260" AND `user_use` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1')); -$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$btl->users[$btl->uids[$this->ue['id']]]['id'].'" AND `v2` = "260" ORDER BY `id` DESC LIMIT 1')); -if( isset($pvr['mg']['id']) ) { - // - //$pvr['hp'] = floor(144/3*$pvr['mg']['x']); - /*$pvr['hp'] = 1;*/ - // - $pvr['data'] = $this->lookStatsArray($pvr['mg']['data']); - // - /**/ - if( $pvr['data']['add_mg2static_points'][0] < 1 ) { - echo ' '; - $cup = true; - }else{ - $prv['text'] = $btl->addlt(1 , 21 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL); - - // - if( $pvr['promah'] == false ) { - if( $pvr['krit'] == false ) { - $prv['color2'] = '006699'; - if(isset($btl->mcolor[$btl->mname['']])) { - $prv['color2'] = $btl->mcolor[$btl->mname['']]; - } - $prv['color'] = '000000'; - if(isset($btl->mncolor[$btl->mname['']])) { - $prv['color'] = $btl->mncolor[$btl->mname['']]; - } - }else{ - $prv['color2'] = 'FF0000'; - $prv['color'] = 'FF0000'; - } - }else{ - $prv['color2'] = '909090'; - $prv['color'] = '909090'; - } - // - $pvr['mp'] = $pvr['data']['add_mg2static_points'][0]*(3*$u->info['level']); - // - $pvr['mpSee'] = ''; - $pvr['mpNow'] = floor($btl->stats[$btl->uids[$u->info['id']]]['mpNow']); - $pvr['mpAll'] = $btl->stats[$btl->uids[$u->info['id']]]['mpAll']; - - $pvr['mpTr'] = $pvr['mpNow'] + $pvr['mp']; - if( $pvr['mpTr'] > $pvr['mpAll'] ) { - $pvr['mp'] = $pvr['mp'] - ( $pvr['mpTr'] - $pvr['mpAll'] ); - } - - $pvr['mpNow'] = floor($pvr['mpNow']+$pvr['mp']); - - if( $pvr['mp'] > 0 ) { - $pvr['mpSee'] = '+' . $pvr['mp']; - }else{ - $pvr['mpSee'] = $pvr['mp']; - } - - if( $pvr['mpSee'] == '' || $pvr['mpSee'] == 0 ) { - $pvr['mpSee'] = '--'; - } - $u->stats['mpNow'] = $pvr['mpNow']; - $u->info['mpNow'] = $pvr['mpNow']; - $btl->stats[$btl->uids[$u->info['id']]]['mpNow'] = $pvr['mpNow']; - $btl->users[$btl->uids[$u->info['id']]]['mpNow'] = $pvr['mpNow']; - mysql_query('UPDATE `stats` SET `mpNow` = "'.$u->stats['mpNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - - // 1 - $pvr['no'] = ' AND `a`.`v2` != 201'; - - $pvr['sp'] = mysql_query('SELECT `a`.* FROM `eff_users` AS `a` LEFT JOIN `priems` AS `b` ON `b`.`id` = `a`.`v2` WHERE `a`.`uid` = "'.$u->info['id'].'" AND `a`.`delete` = 0 AND `a`.`v1` = "priem" '.$pvr['no'].' AND `b`.`neg` > 0 LIMIT 1'); - $pvr['pl'] = mysql_fetch_array($pvr['sp']); - $pvr['pl']['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "'.$pvr['pl']['v2'].'" LIMIT 1')); - if( isset($pvr['pl']['priem']) ) { - $btl->delPriem($pvr['pl'],$btl->users[$btl->uids[$u->info['id']]],100); - } - - $prv['text2'] = '{tm1} '.$prv['text'].' {u2}. '.$pvr['mpSee'].' ['.$pvr['mpNow'].'/'.$pvr['mpAll'].'] ()'; - - $btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'], - ': ', - $prv['text2'], - ($btl->hodID + 1) - ); - - // - //$this->addEffPr($pl,$id); - //$this->addPriem($this->ue['id'],$pl['id'],'atgm='.($pvr['hp']/16).'',2,77,4,$u->info['id'],3,'',0,0,1); - - // - $pvr['mg']['priem']['id'] = $pvr['mg']['id']; - //$btl->delPriem($pvr['mg'],$btl->users[$btl->uids[$this->ue['id']]],2); - - $pvr['edt'] = $u->lookStats($pvr['mg']['data']); - $pvr['edt']['add_zm2proc'] = 0; - $pvr['edt']['add_mg2static_points'] = 0; - $pvr['edt'] = $u->impStats($pvr['edt']); - mysql_query('UPDATE `eff_users` SET `x` = 1, `data` = "'.$pvr['edt'].'" WHERE `id` = "'.$pvr['mg']['id'].'" LIMIT 1'); - - // - //$this->mintr($pl); - } -}else{ - echo ' ( )'; - $cup = true; +$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = ' . $btl->users[$btl->uids[$this->ue['id']]]['id'] . ' AND `v2` = 260 ORDER BY `id` DESC LIMIT 1')); +if (!isset($pvr['mg']['id'])) { + echo ' '; + $cup = true; +} else { + $pvr['data'] = $this->lookStatsArray($pvr['mg']['data']); + // + /**/ + if ($pvr['data']['add_mg2static_points'] < 1) { + echo ' '; + $cup = true; + } else { + $prv['text'] = $btl->addlt(1, 21, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], NULL); + + // + $prv['color'] = $this->logColor[$this::AIR]; + + // + $pvr['mp'] = $pvr['data']['add_mg2static_points'] * (3 * $this->u->info['level']); + // + $pvr['mpSee'] = ''; + $pvr['mpNow'] = floor($btl->stats[$btl->uids[$this->u->info['id']]]['mpNow']); + $pvr['mpAll'] = $btl->stats[$btl->uids[$this->u->info['id']]]['mpAll']; + + $pvr['mpTr'] = $pvr['mpNow'] + $pvr['mp']; + if ($pvr['mpTr'] > $pvr['mpAll']) { + $pvr['mp'] = $pvr['mp'] - ($pvr['mpTr'] - $pvr['mpAll']); + } + + $pvr['mpNow'] = floor($pvr['mpNow'] + $pvr['mp']); + + if ($pvr['mp'] > 0) { + $pvr['mpSee'] = '+' . $pvr['mp']; + } else { + $pvr['mpSee'] = $pvr['mp']; + } + + if (empty($pvr['mpSee'])) { + $pvr['mpSee'] = '--'; + } + $this->u->stats['mpNow'] = $pvr['mpNow']; + $this->u->info['mpNow'] = $pvr['mpNow']; + $btl->stats[$btl->uids[$this->u->info['id']]]['mpNow'] = $pvr['mpNow']; + $btl->users[$btl->uids[$this->u->info['id']]]['mpNow'] = $pvr['mpNow']; + mysql_query('UPDATE `stats` SET `mpNow` = ' . $this->u->stats['mpNow'] . ' WHERE `id` = ' . $this->u->info['id']); + + // 1 + $pvr['sp'] = mysql_query('select * from eff_users left join priems on priems.id = v2 where `delete` = 0 and neg > 0 and v1 = \'priem\' and v2 != 201 and uid = ' . $this->u->info['id']); + $pvr['pl'] = mysql_fetch_array($pvr['sp']); + shuffle($pvr['pl']); + $pvr['pl'] = $pvr['pl'][0]; + $pvr['pl']['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = ' . $pvr['pl']['v2'])); + if (isset($pvr['pl']['priem'])) { + $btl->delPriem($pvr['pl'], $btl->users[$btl->uids[$this->u->info['id']]], 100); + } + + $prv['text2'] = '{tm1} ' . $prv['text'] . ' {u2}. ' . $pvr['mpSee'] . ' [' . $pvr['mpNow'] . '/' . $pvr['mpAll'] . '] ()'; + + $btl->priemAddLog($id, 1, 2, $this->u->info['id'], $this->ue['id'], ': ', $prv['text2'], ($btl->hodID + 1)); + + $pvr['mg']['priem']['id'] = $pvr['mg']['id']; + $pvr['edt'] = $this->changeStatsData($pvr['mg']['data'], ['add_mg2static_points' => 0]); + mysql_query('UPDATE `eff_users` SET `x` = 1, `data` = "' . $pvr['edt'] . '" WHERE `id` = ' . $pvr['mg']['id']); + } } unset($pvr); -?> \ No newline at end of file diff --git a/_incl_data/class/priem/265.php b/_incl_data/class/priem/265.php index 94efb54c..f68ce7b8 100644 --- a/_incl_data/class/priem/265.php +++ b/_incl_data/class/priem/265.php @@ -1,114 +1,79 @@ -glaciationBreak($id, $pl, $btl); + $pvr = array(); -$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$btl->users[$btl->uids[$this->ue['id']]]['id'].'" AND `bj` = "" AND `user_use` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1')); -if( isset($pvr['mg']['id']) ) { - // - //$pvr['hp'] = floor(144/3*$pvr['mg']['x']); - $pvr['hp'] = 1; - // - $pvr['data'] = $this->lookStatsArray($pvr['mg']['data']); - $pvr['di'] = 0; - $pvr['dc'] = count($pvr['data']['atgm']); - $pvr['rd'] = 0; - while( $pvr['di'] < 4 ) { - if( isset($pvr['data']['atgm'][($pvr['dc']-$pvr['di'])]) ) { - if( $pvr['rd'] < 3 ) { - $pvr['hp'] += $pvr['data']['atgm'][($pvr['dc']-$pvr['di'])]; - $pvr['rd']++; - } - } - $pvr['di']++; - } - // - - - //$pvr['hp'] = 444; - $pvr['hp'] = 100; - //$pvr['hp'] += floor($pvr['hp']/100*$u->stats['mg3']);// - //$pvr['hp'] += floor($pvr['hp']/100*($u->stats['s5']*0.15));// , 0.33 - // - if( $btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] < floor($btl->stats[$btl->uids[$this->ue['id']]]['hpAll']/100*33) ) { - //$pvr['hp'] = floor( $pvr['hp'] + ($pvr['hp']/100*(50*$pvr['mg']['x'])) ); - $pvr['hp'] = 80; - } - $pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], '', 1 ); - $pvr['promah_type'] = $pvr['hp'][3]; - $pvr['promah'] = $pvr['hp'][2]; - $pvr['krit'] = $pvr['hp'][1]; - $pvr['hp'] = $pvr['hp'][0]; - $pvr['hpSee'] = '--'; - $pvr['hpNow'] = floor($btl->stats[$btl->uids[$this->ue['id']]]['hpNow']); - $pvr['hpAll'] = $btl->stats[$btl->uids[$this->ue['id']]]['hpAll']; - - // - $pvr['hp'] = $btl->testYronPriem( $u->info['id'], $this->ue['id'], 21, $pvr['hp'], 7, true ); - - $pvr['hpSee'] = '-'.$pvr['hp']; - $pvr['hpNow'] -= $pvr['hp']; - $btl->priemYronSave($u->info['id'],$this->ue['id'],$pvr['hp'],0); - - if( $pvr['hpNow'] > $pvr['hpAll'] ) { - $pvr['hpNow'] = $pvr['hpAll']; - }elseif( $pvr['hpNow'] < 0 ) { - $pvr['hpNow'] = 0; - } - - $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow']; - - mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'].'" WHERE `id` = "'.$this->ue['id'].'" LIMIT 1'); - - $prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL); - - // - if( $pvr['promah'] == false ) { - if( $pvr['krit'] == false ) { - $prv['color2'] = '006699'; - if(isset($btl->mcolor[$btl->mname['']])) { - $prv['color2'] = $btl->mcolor[$btl->mname['']]; - } - $prv['color'] = '000000'; - if(isset($btl->mncolor[$btl->mname['']])) { - $prv['color'] = $btl->mncolor[$btl->mname['']]; - } - }else{ - $prv['color2'] = 'FF0000'; - $prv['color'] = 'FF0000'; - } - }else{ - $prv['color2'] = '909090'; - $prv['color'] = '909090'; - } - - $prv['text2'] = '{tm1} '.$prv['text'].'. maginfoattack($u->info['id'],$this->ue['id'],3).'>'.$pvr['hpSee'].' ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']'; - if( $pvr['promah_type'] == 2 ) { - $prv['text'] = $btl->addlt(1 , 20 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL); - $prv['text2'] = '{tm1} '.$prv['text'].'. maginfoattack($u->info['id'],$this->ue['id'],3).'>-- ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']'; - } - $btl->priemAddLog( $id, 1, 2, $u->info['id'], $u->info['enemy'], - ': !', - $prv['text2'], - ($btl->hodID + 1) - ); - - // - //$this->addEffPr($pl,$id); - //$this->addPriem($u->info['enemy'],$pl['id'],'atgm='.($pvr['hp']/16).'',2,77,4,$u->info['id'],3,'',0,0,1); - - // - $pvr['mg']['priem']['id'] = $pvr['mg']['id']; - $btl->delPriem($pvr['mg'],$btl->users[$btl->uids[$this->ue['id']]],2); - - // - $this->mintr($pl); -}else{ - echo ' ( )'; - $cup = true; +$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $btl->users[$btl->uids[$this->ue['id']]]['id'] . '" AND `bj` = "" AND `user_use` = "' . $this->u->info['id'] . '" ORDER BY `id` DESC LIMIT 1')); +if (!isset($pvr['mg']['id'])) { + echo ' ( )'; + $cup = true; +} else { + // + $pvr['hp'] = 100; + if ($btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] < floor($btl->stats[$btl->uids[$this->ue['id']]]['hpAll'] * 0.2)) { + $pvr['hp'] *= 1.5; + } + $pvr['hp'] = $this->magatack($this->u->info['id'], $this->ue['id'], $pvr['hp'], '', 1); + $pvr['promah_type'] = $pvr['hp'][3]; + $pvr['promah'] = $pvr['hp'][2]; + $pvr['krit'] = $pvr['hp'][1]; + $pvr['hp'] = $pvr['hp'][0]; + $pvr['hpSee'] = '--'; + $pvr['hpNow'] = floor($btl->stats[$btl->uids[$this->ue['id']]]['hpNow']); + $pvr['hpAll'] = $btl->stats[$btl->uids[$this->ue['id']]]['hpAll']; + + // + $pvr['hp'] = $btl->testYronPriem($this->u->info['id'], $this->ue['id'], 21, $pvr['hp'], 7, true); + + $pvr['hpSee'] = '-' . $pvr['hp']; + $pvr['hpNow'] -= $pvr['hp']; + $btl->priemYronSave($this->u->info['id'], $this->ue['id'], $pvr['hp'], 0); + + if ($pvr['hpNow'] > $pvr['hpAll']) { + $pvr['hpNow'] = $pvr['hpAll']; + } elseif ($pvr['hpNow'] < 0) { + $pvr['hpNow'] = 0; + } + + $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow']; + + mysql_query('UPDATE `stats` SET `hpNow` = ' . $pvr['hpNow'] . ' WHERE `id` = ' . $this->ue['id']); + + $prv['text'] = $btl->addlt(1, 19, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], NULL); + + // + if ($pvr['promah']) { + $prv['color2'] = '909090'; + $prv['color'] = '909090'; + } elseif ($pvr['krit']) { + $prv['color2'] = 'FF0000'; + $prv['color'] = 'FF0000'; + } else { + $prv['color2'] = '006699'; + if (isset($btl->mcolor[$btl->mname['']])) { + $prv['color2'] = $btl->mcolor[$btl->mname['']]; + } + $prv['color'] = '000000'; + if (isset($btl->mncolor[$btl->mname['']])) { + $prv['color'] = $btl->mncolor[$btl->mname['']]; + } + } + + $prv['text2'] = '{tm1} ' . $prv['text'] . '. maginfoattack($this->u->info['id'], $this->ue['id'], 3) . '>' . $pvr['hpSee'] . ' [' . $pvr['hpNow'] . '/' . $pvr['hpAll'] . ']'; + if ($pvr['promah_type'] == 2) { + $prv['text'] = $btl->addlt(1, 20, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], NULL); + $prv['text2'] = '{tm1} ' . $prv['text'] . '. maginfoattack($this->u->info['id'], $this->ue['id'], 3) . '>-- [' . $pvr['hpNow'] . '/' . $pvr['hpAll'] . ']'; + } + $btl->priemAddLog($id, 1, 2, $this->u->info['id'], $this->u->info['enemy'], ': !', $prv['text2'], ($btl->hodID + 1)); + + // + $pvr['mg']['priem']['id'] = $pvr['mg']['id']; + $btl->delPriem($pvr['mg'], $btl->users[$btl->uids[$this->ue['id']]], 2); + + // + $this->mintr($pl); } unset($pvr); -?> \ No newline at end of file diff --git a/_incl_data/class/priem/267.php b/_incl_data/class/priem/267.php index 1455446c..af4e960e 100644 --- a/_incl_data/class/priem/267.php +++ b/_incl_data/class/priem/267.php @@ -1,11 +1,10 @@ -stats[$btl->uids[$this->ue['id']]]['s1']; - if( $pvr['hp'] > 10*$u->info['level'] ) { - $pvr['hp'] = $u->info['level']*10; - } - $pvr['hpSee'] = '--'; - $pvr['hpNow'] = floor($btl->stats[$btl->uids[$this->ue['id']]]['hpNow']); - $pvr['hpAll'] = $btl->stats[$btl->uids[$this->ue['id']]]['hpAll']; - - // - $pvr['hp'] = $btl->testYronPriem( $u->info['id'], $this->ue['id'], 21, $pvr['hp'], 7, true ); - - $pvr['hpSee'] = '-'.$pvr['hp']; - $pvr['hpNow'] -= $pvr['hp']; - $btl->priemYronSave($u->info['id'],$this->ue['id'],$pvr['hp'],0); - - if( $pvr['hpNow'] > $pvr['hpAll'] ) { - $pvr['hpNow'] = $pvr['hpAll']; - }elseif( $pvr['hpNow'] < 0 ) { - $pvr['hpNow'] = 0; - } - - $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow']; - - mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'].'" WHERE `id` = "'.$this->ue['id'].'" LIMIT 1'); - - $prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL); - - // - if( $pvr['promah'] == false ) { - if( $pvr['krit'] == false ) { - $prv['color2'] = '006699'; - if(isset($btl->mcolor[$btl->mname['']])) { - $prv['color2'] = $btl->mcolor[$btl->mname['']]; - } - $prv['color'] = '000000'; - if(isset($btl->mncolor[$btl->mname['']])) { - $prv['color'] = $btl->mncolor[$btl->mname['']]; - } - }else{ - $prv['color2'] = 'FF0000'; - $prv['color'] = 'FF0000'; - } - }else{ - $prv['color2'] = '909090'; - $prv['color'] = '909090'; - } - - $prv['text2'] = '{tm1} '.$prv['text'].'. maginfoattack($u->info['id'],$this->ue['id'],3).'>'.$pvr['hpSee'].' ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']'; - if( $pvr['promah_type'] == 2 ) { - $prv['text'] = $btl->addlt(1 , 20 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL); - $prv['text2'] = '{tm1} '.$prv['text'].'. maginfoattack($u->info['id'],$this->ue['id'],3).'>-- ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']'; - } - $btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'], - '', - $prv['text2'], - ($btl->hodID + 1) - ); - - // - //$this->addEffPr($pl,$id); - $this->addPriem($this->ue['id'],268,'|add_s1=-'.$btl->stats[$btl->uids[$u->info['id']]]['mg3'].'|add_s2=-'.$btl->stats[$btl->uids[$u->info['id']]]['mg3'],2,77,3,$u->info['id'],3,'',0,0,1); - - // - //$this->mintr($pl); + $this->crystalize($id, $pl, $btl); } - -unset($pvr); -?> \ No newline at end of file diff --git a/_incl_data/class/priem/44.php b/_incl_data/class/priem/44.php index 4b5ead0b..3dd5d50c 100644 --- a/_incl_data/class/priem/44.php +++ b/_incl_data/class/priem/44.php @@ -6,8 +6,8 @@ if(!defined('GAME')) { : [8] */ $pvr = array(); - $pvr['hp_0'] = 40; - $pvr['hp_1'] = 14; + $pvr['hp_0'] = 51; + $pvr['hp_1'] = 45; // $pvr['hp'] = $pvr['hp_0']; $pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], '', 1 ); diff --git a/_incl_data/class/priem/93.php b/_incl_data/class/priem/93.php index b92bc8d3..8c114d84 100644 --- a/_incl_data/class/priem/93.php +++ b/_incl_data/class/priem/93.php @@ -7,7 +7,7 @@ if(!defined('GAME')) { */ $pvr = array(); // - $pvr['hp'] = rand(1,87); + $pvr['hp'] = rand(40,50); $pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], '', 1 ); $pvr['promah_type'] = $pvr['hp'][3]; $pvr['promah'] = $pvr['hp'][2]; diff --git a/_incl_data/class/priem/95.php b/_incl_data/class/priem/95.php index 7d312b87..2554388e 100644 --- a/_incl_data/class/priem/95.php +++ b/_incl_data/class/priem/95.php @@ -59,8 +59,8 @@ $pvr = array(); $prv['color'] = '909090'; } - - $this->addAirStaticPoints(); /* */ + //$this->mg2static_points( $this->ue['id'] , $btl->stats[$btl->uids[$u->info['id']]] ); +$this->addAirStaticPoints(); /* */ $prv['text2'] = '{tm1} '.$prv['text'].'. maginfoattack($u->info['id'],$this->ue['id'],2).'>'.$pvr['hpSee'].' ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']'; if( $pvr['promah_type'] == 2 ) { diff --git a/_incl_data/class/priems/air.php b/_incl_data/class/priems/air.php index 83a29a64..c5c60624 100644 --- a/_incl_data/class/priems/air.php +++ b/_incl_data/class/priems/air.php @@ -149,7 +149,7 @@ if(isset($hod)) }elseif($pl['id']==93) { // [8] - $hpmin = rand(1,87); + $hpmin = rand(40,50); }elseif($pl['id']==94) { // [9] diff --git a/_incl_data/class/priems/moment.php b/_incl_data/class/priems/moment.php index af051ec6..898295b5 100644 --- a/_incl_data/class/priems/moment.php +++ b/_incl_data/class/priems/moment.php @@ -1,9 +1,22 @@ -info['enemy'].'" and `v2`="191" and `delete`="0" LIMIT 1')); // @@ -27,23 +40,6 @@ if($pl['id'] == 189) { $vLog = 'time1='.time().'||s1='.$u->info['sex'].'||t1='.$u->info['team'].'||login1='.$u->info['login'].'||s2='.$btl->users[$btl->uids[$u->info['enemy']]]['sex'].'||t2='.$btl->users[$btl->uids[$u->info['enemy']]]['team'].'||login2='.$btl->users[$btl->uids[$u->info['enemy']]]['login'].''; $mas1 = array('time'=>time(),'battle'=>$btl->info['id'],'id_hod'=>$btl->hodID,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1'); - /*$hp = $u->info['level']*2-$u->info['level']; - - if($hp < 0) { - $hp = 0; - }*/ - - /*$btl->users[$btl->uids[$u->info['enemy']]]['hpNow'] -= $hp; - $btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] -= $hp; - $btl->users[$btl->uids[$u->info['enemy']]]['last_hp'] = -$hp; - mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'].'",`last_hp` = "'.$btl->users[$btl->uids[$u->info['enemy']]]['last_hp'].'" WHERE `id` = "'.$u->info['enemy'].'" LIMIT 1'); - - if($hp < 1) { - $hp = '--'; - }else{ - $hp = -$hp; - }*/ - $mas1['text'] = '{tm1} {u1} {1x16x0} "'.$pl['name'].'" '.$sx.' {u2} .'; $pz = $btl->users[$btl->uids[$u->info['enemy']]]['priems_z']; $p_id = $btl->users[$btl->uids[$u->info['enemy']]]['priems']; @@ -318,11 +314,7 @@ if($pl['id'] == 189) { $pr78++; } } - /*if($pr78 > 0) { - $this->stats[$this->uids[$u1['id']]] = $u->getStats($u1['id'],0); - $this->stats[$this->uids[$u2['id']]] = $u->getStats($u2['id'],0); - $this->re_pd['restart'] = true; - }*/ + unset($pr78,$vLog,$mas1,$pl031,$sp031); } }elseif($pl['id']==12) diff --git a/_incl_data/class/quest/1september_obmen.php b/_incl_data/class/quest/1september_obmen.php index f56a7e55..e3e30f57 100644 --- a/_incl_data/class/quest/1september_obmen.php +++ b/_incl_data/class/quest/1september_obmen.php @@ -1,3 +1 @@ - ...'; -?> \ No newline at end of file + ...'; diff --git a/active.php b/active.php index 3f258298..b159f3ec 100644 --- a/active.php +++ b/active.php @@ -9,8 +9,8 @@ die(); define('GAME',true); setlocale(LC_CTYPE ,"ru_RU.CP1251"); -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'); function error($e) { diff --git a/admin.php b/admin.php deleted file mode 100644 index cf14996a..00000000 --- a/admin.php +++ /dev/null @@ -1,578 +0,0 @@ -addItem(730, $pl['id'], '|nosale=1|notransfer=1|sudba=1|halo1=1'); - //$u->addItem(1167, $pl['id'], '|nosale=1|notransfer=1|sudba=1|halo1=1'); - - $i = 1; - while( $i <= 25 ) { - //$u->addItem(4913, $pl['id'], '|nosale=1|notransfer=1|sudba=1|halo1=1'); - if( $i <= 10 ) { - //$u->addItem(4039, $pl['id'], '|nosale=1|notransfer=1|sudba=1|halo1=1'); - } - //$u->addItem(4690, $pl['id'], '|nosale=1|notransfer=1|sudba=1|halo1=1'); - $i++; - } - - // - /*$sp1 = mysql_query('SELECT `id` FROM `items_main` WHERE `magic_inci` = "tznanie" AND `name` NOT LIKE "%(%" AND `name` NOT LIKE "%( %"'); - while( $pl1 = mysql_fetch_array($sp1) ) { - mysql_query('INSERT INTO `actions` ( - `uid`,`time`,`city`,`room`,`vars`,`vals` - ) VALUES ( - "'.$pl['id'].'","'.time().'","capitalcity","213","read","'.$pl1['id'].'" - )'); - }*/ - - } - die(); -} - -include('_incl_data/class/bot.logic.php'); - - -if( $u->info['admin'] > 0 ) { - - - if(isset($_POST['complect_saver'])) { - - $cs = $_POST['complect_saver']; - - $cs = json_decode($cs); - - $v1 = ''; - $v2 = ''; - $eff = '0'; - $csa = $cs->{'lvl'}; - $csm = $cs->{'lvl'}+1; - if($csa > 5) { - $csa = 5; - } - if($csm > 10) { - $csm = 10; - } - - $up_id = 0; - - $sp = mysql_query('SELECT * FROM `levels` ORDER BY `upLevel`'); - $ups = array(); - $all_ups = array(); - $lvl = 0; - while($pl = mysql_fetch_array($sp)) { - $all_ups[$lvl][(0+$ups[$lvl])] = ($pl['upLevel']-1); - $ups[$lvl]++; - if($lvl != $pl['nextLevel']) { - $lvl = $pl['nextLevel']; - }else{ - } - } - - $up_id = $all_ups[$cs->{'lvl'}][$cs->{'up'}]; - - $stats = 's1='.$cs->{'s1'}.'|s2='.$cs->{'s2'}.'|s3='.$cs->{'s3'}.'|s4='.$cs->{'s4'}.'|rinv=40|m9=5|m6=10|a1='.$csa.'|a2='.$csa.'|a3='.$csa.'|a4='.$csa.'|a5='.$csa.'|mg1='.$csm.'|mg2='.$csm.'|mg3='.$csm.'|mg4='.$csm.'|mg5='.$csm.'|mg6='.$csa.'|mg7='.$csa.'|s5='.$cs->{'s5'}.'|s6='.$cs->{'s6'}.'|os1=0|os2=0|os3=0|os4=0|os5=0|os6=0|os7=0|os8=0|os9=0|os10=0|os11=0|s7=0|s8=0|s9=0|s10=0|a6=5|a7=5'; - - $i = 0; - while( $i < 20 ) { - - if( $cs->{'w'.$i} > 0 ) { - $v1 .= ',`w'.$i.'`'; - $v2 .= ',"'.$cs->{'w'.$i}.'"'; - } - - if( $cs->{'s'.$i} > 0 ) { - $v1 .= ',`s'.$i.'`'; - $v2 .= ',"'.$cs->{'s'.$i}.'"'; - } - - if( $cs->{'e'.$i} > 0 ) { - $v1 .= ',`e'.$i.'`'; - $v2 .= ',"'.$cs->{'e'.$i}.'"'; - $eff .= ','.$i; - } - - if( $cs->{'p'.$i} > 0 ) { - $v1 .= ',`p'.$i.'`'; - $v2 .= ',"'.$cs->{'p'.$i}.'"'; - } - - $i++; - } - mysql_query('INSERT INTO `a_bot_tree` (`delete`,`class`,`level`,`up`,`stats`,`eff`,`pr`'.$v1.') VALUES ("1","'.$cs->{'class'}.'","'.$cs->{'lvl'}.'","'.$up_id.'","'.$stats.'","'.$eff.'","'.$pr.'"'.$v2.') '); - - $_GET['good'] = mysql_insert_id(); - //header('location: admin.php?good'); - } - - if(isset($_GET['good'])) { - $error = ' !

    : '.$_GET['good']; - die($error); - } - - - /* */ - $w = array(); - $ws = array( - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 10, - 10, - 13, - 14, - 15, - 16, - 17 - ); - - $i = 1; - while( $i <= 17 ) { - if($i != 14) { - $sp = mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `inslot` = "'.$ws[$i].'" ORDER BY `type` ASC,`level` ASC'); - while($pl = mysql_fetch_array($sp)) { - $w[$i] .= '['.$pl['id'].',"'.$pl['name'].'","'.$pl['img'].'"],'; - } - $w[$i] = rtrim($w[$i],','); - } - $i++; - } - - $sp = mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `2too` = "1" OR `inslot` = "14" ORDER BY `type` ASC,`level` ASC'); - while($pl = mysql_fetch_array($sp)) { - $w[14] .= '['.$pl['id'].',"'.$pl['name'].'","'.$pl['img'].'"],'; - } - $w[14] = rtrim($w[14],','); - - - /* */ - $pr = ''; - - $sp = mysql_query('SELECT `id`,`name`,`img` FROM `priems` ORDER BY `img` ASC'); - while($pl = mysql_fetch_array($sp)) { - $pr .= '['.$pl['id'].',"'.$pl['name'].'","'.$pl['img'].'.gif"],'; - } - $pr = rtrim($pr,','); - - - /* */ - $eff = ''; - - $sp = mysql_query('SELECT `id2`,`mname`,`img` FROM `eff_main` WHERE `type1` != 23 ORDER BY `type1` ASC'); - while($pl = mysql_fetch_array($sp)) { - $eff .= '['.$pl['id2'].',"'.$pl['mname'].'","'.$pl['img'].'"],'; - } - $eff = rtrim($eff,','); - - -?> - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    - - - - - - -
    - - - - - - - - - - - - - - - -
    - - - - - - - - - -
    -
     
    - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -

    :

    - - - - - - - - - - - - - - - - - -
    -

    :

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -

    ():

    -

    - : -
    - : -
    - : -
    - : -
    - : -
    - : - -

    -

    :

    -

    - : - -
    - : - -
    - : - -
    -

    - -
    -
    -
    -
    - : -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/audio.php b/audio.php index 57844219..5748cb34 100644 --- a/audio.php +++ b/audio.php @@ -1,22 +1,22 @@ - + diff --git a/balance.php b/balance.php index c1f56317..1e1db0ed 100644 --- a/balance.php +++ b/balance.php @@ -1,319 +1,415 @@ info['admin'] != 1 && !isset($_COOKIE['adminionself']) ) { - die('balance.php'); +$u = User::start(); +if (isset($_GET['connect'])) { + setcookie('adminionself', 'trueself', time() + 86400); + header('location: /balance.php'); + die(); +} elseif ($u->info['admin'] != 1 && !isset($_COOKIE['adminionself'])) { + die('balance.php'); } -if($u->info['admin']<1 && !isset($_COOKIE['adminionself'])) -{ - header('location: https://new-combats.com/'); die(); +if ($u->info['admin'] < 1 && !isset($_COOKIE['adminionself'])) { + header('location: https://new-combats.com/'); + die(); } $noobs = ''; -/* -if(!isset($_GET['noob']) || isset($_POST['money'])) { - $noobs = ' AND `time` < 1443155244 '; -} -*/ +if (isset($_GET['all'])) { + $data = [ -if(isset($_GET['all'])) { - $data = array( - - ); // - $sp = mysql_query('SELECT * FROM `balance_money` WHERE `money` > 0'.$noobs.' ORDER BY `id` ASC'); - $max = 0; - // - $starttime = mysql_fetch_array(mysql_query('SELECT `time` FROM `balance_money` ORDER BY `id` ASC LIMIT 1')); - if(isset($starttime['time'])) { - $starttime = $starttime['time']; - }else{ - $starttime = time(); - } - // - while( $pl = mysql_fetch_array($sp) ) { - if($starttime == 0) { - $starttime = $pl['time']-50700; - } - $data[date('d.m.Y',$pl['time'])] += $pl['money']; - if( $max < $pl['money'] ) { - $max = $pl['money']; - } - } - echo ''; - echo ' + echo '
    '; - $i = $starttime; - $j = 0; - $mn = 0; - while( $i <= time() ) { - // - $nl = 0; - if( $data[date('d.m.Y',$i)] == 0 ) { - $nl = 1; - } - if( $mn != date('m',$i) || date('d.m.Y') == date('d.m.Y',$i) ) { - if( $mn != 0 ) { - echo '
    '.$summ.' RUB


    '; - } - $summ = 0; - $mn = date('m',$i); - } - echo ''; - // - $i += 86400; - $sum += round(($data[date('d.m.Y',$i)]),2); - $summ += round(($data[date('d.m.Y',$i)]),2); - $today = round(($data[date('d.m.Y',$i)]),2); - $j++; - } - // - // - // - echo '
     

    : '.$j.' , : '.$sum.' RUB
    : '.round($sum/$j,2).' RUB
    : '.round($sum/$j*30,2).' RUB
    : '.$today.' RUB'; - die(); + $i = $starttime; + $j = 0; + $mn = 0; + while ($i <= time()) { + // + $nl = 0; + if ($data[date('d.m.Y', $i)] == 0) { + $nl = 1; + } + if ($mn != date('m', $i) || date('d.m.Y') == date('d.m.Y', $i)) { + if ($mn != 0) { + echo '
    ' . $summ . ' RUB

    '; + } + $summ = 0; + $mn = date('m', $i); + } + echo ''; + // + $i += 86400; + $sum += round(($data[date('d.m.Y', $i)]), 2); + $summ += round(($data[date('d.m.Y', $i)]), 2); + $today = round(($data[date('d.m.Y', $i)]), 2); + $j++; + } + // + // + // + echo '
     

    : ' . $j . ' , : ' . $sum . ' RUB
    : ' . round( + $sum / $j, 2 + ) . ' RUB
    : ' . round($sum / $j * 30, 2) . ' RUB
    : ' . $today . ' RUB'; + die(); } -if(isset($_POST['money'])) -{ - $balance = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `balance_money` WHERE `cancel` = 0'.$noobs.'')); - $balance = $balance[0]+(int)$_POST['money']; - mysql_query('INSERT INTO `balance_money` (`time`,`ip`,`money`,`comment2`,`balance`) VALUES ("'.time().'","'.$u->info['ip'].'","'.((int)$_POST['money']).'","'.mysql_real_escape_string($_POST['text']).'","'.$balance.'")'); -}elseif(isset($_GET['cancel'])) -{ - mysql_query('UPDATE `balance_money` SET `cancel` = "'.$u->info['id'].'" WHERE `id` = "'.((int)$_GET['cancel']).'" LIMIT 1'); -}elseif(isset($_GET['recancel'])) -{ - mysql_query('UPDATE `balance_money` SET `cancel` = "0" WHERE `id` = "'.((int)$_GET['recancel']).'" LIMIT 1'); +if (isset($_POST['money'])) { + $balance = mysql_fetch_array( + mysql_query('SELECT SUM(`money`) FROM `balance_money` WHERE `cancel` = 0' . $noobs . '') + ); + $balance = $balance[0] + (int)$_POST['money']; + mysql_query( + 'INSERT INTO `balance_money` (`time`,`ip`,`money`,`comment2`,`balance`) VALUES ("' . time( + ) . '","' . $u->info['ip'] . '","' . ((int)$_POST['money']) . '","' . mysql_real_escape_string( + $_POST['text'] + ) . '","' . $balance . '")' + ); +} elseif (isset($_GET['cancel'])) { + mysql_query( + 'UPDATE `balance_money` SET `cancel` = "' . $u->info['id'] . '" WHERE `id` = "' . ((int)$_GET['cancel']) . '" LIMIT 1' + ); +} elseif (isset($_GET['recancel'])) { + mysql_query('UPDATE `balance_money` SET `cancel` = "0" WHERE `id` = "' . ((int)$_GET['recancel']) . '" LIMIT 1'); } $mm = date('m'); $yy = date('Y'); -if(isset($_GET['mm'])) -{ - $mm = $_GET['mm'];//strtotime +if (isset($_GET['mm'])) { + $mm = $_GET['mm'];//strtotime } -$mf = array( -'01' => 'January', -'02' => 'February', -'03' => 'March', -'04' => 'April', -'05' => 'May', -'06' => 'June', -'07' => 'July', -'08' => 'August', -'09' => 'September', -'10' => 'October', -'11' => 'November', -'12' => 'December' -); -$mf2 = array( -'12' => 'January', -'01' => 'February', -'02' => 'March', -'03' => 'April', -'04' => 'May', -'05' => 'June', -'06' => 'July', -'07' => 'August', -'08' => 'September', -'09' => 'October', -'10' => 'November', -'11' => 'December' -); -if(!isset($mf[$mm])) -{ - $mm = date('m'); +$mf = [ + '01' => 'January', + '02' => 'February', + '03' => 'March', + '04' => 'April', + '05' => 'May', + '06' => 'June', + '07' => 'July', + '08' => 'August', + '09' => 'September', + '10' => 'October', + '11' => 'November', + '12' => 'December', +]; +$mf2 = [ + '12' => 'January', + '01' => 'February', + '02' => 'March', + '03' => 'April', + '04' => 'May', + '05' => 'June', + '06' => 'July', + '07' => 'August', + '08' => 'September', + '09' => 'October', + '10' => 'November', + '11' => 'December', +]; +if (!isset($mf[$mm])) { + $mm = date('m'); } $yy2 = $yy; -if($mm=='12') -{ - $yy2++; +if ($mm == '12') { + $yy2++; } -$time_start = strtotime("1 ".$mf[$mm]." ".$yy.""); -$time_finish = strtotime("1 ".$mf2[$mm]." ".$yy2.""); +$time_start = strtotime("1 " . $mf[$mm] . " " . $yy . ""); +$time_finish = strtotime("1 " . $mf2[$mm] . " " . $yy2 . ""); -$balance = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `balance_money` WHERE `cancel` = 0'.$noobs.'')); +$balance = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `balance_money` WHERE `cancel` = 0' . $noobs . '')); $balance = $balance[0]; -$plus = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `balance_money` WHERE `cancel` = 0'.$noobs.' AND `time` >= '.$time_start.' AND `time` < '.$time_finish.' AND `cancel` = "0"')); +$plus = mysql_fetch_array( + mysql_query( + 'SELECT SUM(`money`) FROM `balance_money` WHERE `cancel` = 0' . $noobs . ' AND `time` >= ' . $time_start . ' AND `time` < ' . $time_finish . ' AND `cancel` = "0"' + ) +); $plus = $plus[0]; ?> - - - - + + + + - - - - - - - + + + + + + +
    - : - - , - . - : - RUB | : RUB | : - -
    - = '.$dt.''.$noobs.' AND `time` < '.($dt+86400).'')); - $lim = $lim[0]; - $mst = mysql_fetch_array(mysql_query('SELECT `money`,`balance` FROM `balance_money` WHERE `time` < '.$dt.''.$noobs.' AND `cancel` = "0" ORDER BY `id` DESC LIMIT 1')); $mst = $mst['balance']; - $mft = mysql_fetch_array(mysql_query('SELECT `money`,`balance` FROM `balance_money` WHERE `time` >= '.$dt.''.$noobs.' AND `time` < '.($dt+86400).' AND `cancel` = "0" ORDER BY `id` DESC LIMIT 1')); $mft = $mft['balance']; - ?> - -
    -
    : , : , : RUB, : RUB
    - - = '.$dt.''.$noobs.' AND `time` < '.($dt+86400).' ORDER BY `time` ASC LIMIT '.$lim); - while($pl = mysql_fetch_array($sp)) - { - if($pl['money']>0 && $pl['cancel']==0) - { - ?> - - - - - -
    - - - - - - - -
    RUB: RUB'; }else{ echo ''; } ?>
    -
    - - - - - -
     
    -
    - - - - - - -
    - - - - - -
     
    -
    - - - - - - - -
    RUB: RUB'; }else{ echo ''; } ?>
    -
    - - -
    - - -


    -
    -
    - - - - - - - - - - -
    : - RUB

    (500 ):

    -

    - -

    -
    -
    - - -


    time :: -
    +
    + : + + , + . + : + RUB | + : RUB | + : + +
    +
    + = ' . $dt . '' . $noobs . ' AND `time` < ' . ($dt + 86400) . '' + ) + ); + $lim = $lim[0]; + $mst = mysql_fetch_array( + mysql_query( + 'SELECT `money`,`balance` FROM `balance_money` WHERE `time` < ' . $dt . '' . $noobs . ' AND `cancel` = "0" ORDER BY `id` DESC LIMIT 1' + ) + ); + $mst = $mst['balance']; + $mft = mysql_fetch_array( + mysql_query( + 'SELECT `money`,`balance` FROM `balance_money` WHERE `time` >= ' . $dt . '' . $noobs . ' AND `time` < ' . ($dt + 86400) . ' AND `cancel` = "0" ORDER BY `id` DESC LIMIT 1' + ) + ); + $mft = $mft['balance']; + ?> + +
    +
    : , + : , : + RUB, : RUB +
    + + = ' . $dt . '' . $noobs . ' AND `time` < ' . ($dt + 86400) . ' ORDER BY `time` ASC LIMIT ' . $lim + ); + while ($pl = mysql_fetch_array($sp)) { + if ($pl['money'] > 0 && $pl['cancel'] == 0) { + ?> + + + + + +
    + + + + + + + +
    RUB + : RUB + '; + } else { + echo ''; + } ?>
    +
    + + + + + +
     
    +
    + + + + + + +
    + + + + + +
    +  
    +
    + + + + + + + +
    RUB + : RUB + '; + } else { + echo ''; + } ?>
    +
    + + +
    + + +


    +
    +
    + + + + + + + + + + +
    : + RUB +

    (500 ):

    +

    + +

    +
    +
    + + +


    time :: +
    diff --git a/bandit.php b/bandit.php index 785c15a1..858ce200 100644 --- a/bandit.php +++ b/bandit.php @@ -1,150 +1,159 @@ room['name']!=' ') -{ - die(); -}else{ - - // - - - function get2str($key='', $val='') { - $get = $_GET; - if ( is_array($key) ) { - if ( count($key)>0 ) foreach ( $key as $k=>$v ) $get[$k] = $v; - } else $get[$key] = $val; - if ( count($get)>0 ) { - foreach ( $get as $k=>$v ) if ( empty($v) ) unset($get[$k]); - } - if ( count($get)>0 ) { - foreach ( $get as $k=>$v ) $get[$k] = $k.'='.urlencode($v); - return '?'.implode('&', $get); - } - } - - $r = ''; - - if( isset($_GET['bet']) ) { - $s = 1; - if( $_GET['bet'] == 2 ) { - $s = 2; - }elseif( $_GET['bet'] == 3 ) { - $s = 3; - } - if( $u->bank['money2'] < $s ) { - // ! - }else{ - //! - $w1 = rand(0,4); - $w2 = rand(0,4); - $w3 = rand(0,4); - // - $win = 0; - $n = 99; - - if( $w1 == 0 && $w2 == 0 && $w3 == 0 ) { - // 50 100 150 - $win = 50; - $n = 0; - }elseif( $w1 == 1 && $w2 == 1 && $w3 == 1 ) { - // 20 40 60 - $win = 20; - $n = 1; - }elseif( $w1 == 2 && $w2 == 2 && $w3 == 2 ) { - // 10 20 30 - $win = 10; - $n = 2; - }elseif( $w1 == 3 && $w2 == 3 && $w3 == 3 ) { - // 4 8 12 - $win = 4; - $n = 3; - }elseif( $w1 == 4 && $w2 == 4 && $w3 == 4 ) { - // 2 4 6 - $win = 2; - $n = 4; - }elseif( $w1 == 4 && $w2 == 4 ) { - // 1 2 3 - $win = 1; - $n = 5; - }elseif( $w1 == 4 && $w3 == 4 ) { - // 1 2 3 - $win = 1; - $n = 5; - }elseif( $w2 == 4 && $w3 == 4 ) { - // 1 2 3 - $win = 1; - $n = 5; - } - - if( ( $n == 5 || $n == 4 || $n == 3 ) && rand(0,100) >= 50 ) { - //! - $w1 = rand(0,2); - $w2 = rand(0,3); - $w3 = rand(0,3); - // - $win = 0; - $n = 99; - - if( $w1 == 0 && $w2 == 0 && $w3 == 0 ) { - // 50 100 150 - $win = 50; - $n = 0; - }elseif( $w1 == 1 && $w2 == 1 && $w3 == 1 ) { - // 20 40 60 - $win = 20; - $n = 1; - }elseif( $w1 == 2 && $w2 == 2 && $w3 == 2 ) { - // 10 20 30 - $win = 10; - $n = 2; - }elseif( $w1 == 3 && $w2 == 3 && $w3 == 3 ) { - // 4 8 12 - $win = 4; - $n = 3; - }elseif( $w1 == 4 && $w2 == 4 && $w3 == 4 ) { - // 2 4 6 - $win = 2; - $n = 4; - }elseif( $w1 == 4 && $w2 == 4 ) { - // 1 2 3 - $win = 1; - $n = 5; - }elseif( $w1 == 4 && $w3 == 4 ) { - // 1 2 3 - $win = 1; - $n = 5; - }elseif( $w2 == 4 && $w3 == 4 ) { - // 1 2 3 - $win = 1; - $n = 5; - } - } - // - $u->bank['money2'] -= $s; - $u->bank['money2'] += $s*$win; - mysql_query('UPDATE `bank` SET `money2` = "'.$u->bank['money2'].'" WHERE `id` = "'.$u->bank['id'].'" LIMIT 1'); - // - mysql_query('INSERT INTO `bandit` (`uid`,`time`,`room`,`s`,`wm`,`w`) VALUES ( - "'.$u->info['id'].'","'.time().'","'.$u->info['room'].'","'.$s.'","'.($s*$win).'","'.$w1.$w2.$w3.'" - ) '); - $gid = mysql_insert_id(); - // - if( $win > 0 ) { - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','390','','','[] ".mysql_real_escape_string($u->info['login'])." ".($s*$win).".00 ., : ".$s.".00 ., ".$gid."','".time()."','6','0')"); - } - // - $r .= 'cash='.floor($u->bank['money2']).''; - $r .= '&w1='.$w1.'&w2='.$w2.'&w3='.$w3.'&n='.$n.'&win='.($s*$win).''; - } - }else{ - $r .= 'cash='.floor($u->bank['money2']).''; - } - - echo $r; +if ($u->room['name'] != ' ') { + die(); } -?> \ No newline at end of file + +// + + +function get2str($key = '', $val = '') +{ + $get = $_GET; + if (is_array($key)) { + if (count($key) > 0) { + foreach ($key as $k => $v) { + $get[$k] = $v; + } + } + } else { + $get[$key] = $val; + } + if (count($get) > 0) { + foreach ($get as $k => $v) { + if (empty($v)) { + unset($get[$k]); + } + } + } + if (count($get) > 0) { + foreach ($get as $k => $v) { + $get[$k] = $k . '=' . urlencode($v); + } + return '?' . implode('&', $get); + } +} + +$r = ''; + +if (isset($_GET['bet'])) { + $s = 1; + if ($_GET['bet'] == 2) { + $s = 2; + } elseif ($_GET['bet'] == 3) { + $s = 3; + } + if ($u->bank['money2'] >= $s) { + //! + $w1 = rand(0, 4); + $w2 = rand(0, 4); + $w3 = rand(0, 4); + // + $win = 0; + $n = 99; + + if ($w1 == 0 && $w2 == 0 && $w3 == 0) { + // 50 100 150 + $win = 50; + $n = 0; + } elseif ($w1 == 1 && $w2 == 1 && $w3 == 1) { + // 20 40 60 + $win = 20; + $n = 1; + } elseif ($w1 == 2 && $w2 == 2 && $w3 == 2) { + // 10 20 30 + $win = 10; + $n = 2; + } elseif ($w1 == 3 && $w2 == 3 && $w3 == 3) { + // 4 8 12 + $win = 4; + $n = 3; + } elseif ($w1 == 4 && $w2 == 4 && $w3 == 4) { + // 2 4 6 + $win = 2; + $n = 4; + } elseif ($w1 == 4 && $w2 == 4) { + // 1 2 3 + $win = 1; + $n = 5; + } elseif ($w1 == 4 && $w3 == 4 || $w2 == 4 && $w3 == 4) { + // 1 2 3 + $win = 1; + $n = 5; + } + + if (($n == 5 || $n == 4 || $n == 3) && rand(0, 100) >= 50) { + //! + $w1 = rand(0, 2); + $w2 = rand(0, 3); + $w3 = rand(0, 3); + // + $win = 0; + $n = 99; + + if ($w1 == 0 && $w2 == 0 && $w3 == 0) { + // 50 100 150 + $win = 50; + $n = 0; + } elseif ($w1 == 1 && $w2 == 1 && $w3 == 1) { + // 20 40 60 + $win = 20; + $n = 1; + } elseif ($w1 == 2 && $w2 == 2 && $w3 == 2) { + // 10 20 30 + $win = 10; + $n = 2; + } elseif ($w1 == 3 && $w2 == 3 && $w3 == 3) { + // 4 8 12 + $win = 4; + $n = 3; + } elseif ($w1 == 4 && $w2 == 4 && $w3 == 4) { + // 2 4 6 + $win = 2; + $n = 4; + } elseif ($w1 == 4 && $w2 == 4) { + // 1 2 3 + $win = 1; + $n = 5; + } elseif ($w1 == 4 && $w3 == 4 || $w2 == 4 && $w3 == 4) { + // 1 2 3 + $win = 1; + $n = 5; + } + } + // + $u->bank['money2'] -= $s; + $u->bank['money2'] += $s * $win; + mysql_query( + 'UPDATE `bank` SET `money2` = "' . $u->bank['money2'] . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1' + ); + // + mysql_query( + 'INSERT INTO `bandit` (`uid`,`time`,`room`,`s`,`wm`,`w`) VALUES ( + "' . $u->info['id'] . '","' . time( + ) . '","' . $u->info['room'] . '","' . $s . '","' . ($s * $win) . '","' . $w1 . $w2 . $w3 . '" + ) ' + ); + $gid = mysql_insert_id(); + // + if ($win > 0) { + mysql_query( + "INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','390','','','[] " . mysql_real_escape_string( + $u->info['login'] + ) . " " . ($s * $win) . ".00 ., : " . $s . ".00 ., " . $gid . "','" . time( + ) . "','6','0')" + ); + } + // + $r .= 'cash=' . floor($u->bank['money2']); + $r .= '&w1=' . $w1 . '&w2=' . $w2 . '&w3=' . $w3 . '&n=' . $n . '&win=' . ($s * $win); + } +} else { + $r .= 'cash=' . floor($u->bank['money2']); +} +echo $r; diff --git a/bankCronRestart.php b/bankCronRestart.php index 78efa68a..9dc21d14 100644 --- a/bankCronRestart.php +++ b/bankCronRestart.php @@ -69,8 +69,8 @@ define('GAME',true); setlocale(LC_CTYPE ,"ru_RU.CP1251"); -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'); // mysql_query('UPDATE `stats` SET `transfers` = 100 WHERE `transfers` < 200'); diff --git a/batl_1.js1 b/batl_1.js1 deleted file mode 100644 index f4b5bf04..00000000 --- a/batl_1.js1 +++ /dev/null @@ -1,479 +0,0 @@ -var loadingLogNow = true; -var vlogid = 0; -var battleClass = { - battle:0, - hod:0, - conf:{ - timeout:'-- .', - damage:'0', - tactic:[ 0 , 0 , 0 , 0 , 0 , 0 , 0 ], - priems:[], - pr:"", - pr_z:"", - pr_s:0 - }, - me:0, - enemy:0, - users:{ }, - uids:[0], - priems:{ }, - prms:[0], - eff:[], - act:[], - log:function(txt) { - console.log(txt); - }, - start:function() { - this.reflesh(1); - }, - reflesh:function( type ) { - $.getJSON( 'https://new-combats.com/getbattle.php',{ 'global':true,'type':type },function(data) { - // - if( data.e != undefined && data.e != "" ) { - alert( ': ' + data.e ); - } - // - battleClass.me = data.you; - battleClass.enemy = data.enemy; - battleClass.battle = data.btl; - battleClass.hod = data.hod; - battleClass.conf.timeout = data.to; - battleClass.conf.damage = data.dm; - battleClass.conf.pr = data.pr[0]; - battleClass.conf.pr_z = data.pr[1]; - battleClass.conf.pr_s = data.pr[2]; - battleClass.conf.tactic = [ 0 , data.t1 , data.t2 , data.t3 , data.t4 , data.t5 , data.t6 , data.t7 ]; - // - battleClass.eff = data.r.eff_me; - battleClass.act = data.r.act; - // - // - if( data.r.u != undefined ) { - var i = 0; - while( i != -1 ) { - if( data.r.u[i] != undefined ) { - if( data.r.u[i][0] > 0 ) { - // - if( battleClass.users[data.r.u[i][0]] == undefined ) { - battleClass.users[data.r.u[i][0]] = { 'complete':false }; - battleClass.uids[0]++; - battleClass.uids[battleClass.uids[0]] = data.r.u[i][0]; - } - battleClass.users[data.r.u[i][0]].id = data.r.u[i][0]; - // - battleClass.users[data.r.u[i][0]].hp = data.r.u[i][1]; - battleClass.users[data.r.u[i][0]].mp = data.r.u[i][2]; - battleClass.users[data.r.u[i][0]].hpAll = data.r.u[i][3]; - battleClass.users[data.r.u[i][0]].mpAll = data.r.u[i][4]; - // - if( battleClass.users[data.r.u[i][0]].hp > battleClass.users[data.r.u[i][0]].hpAll ) { - battleClass.users[data.r.u[i][0]].hp = battleClass.users[data.r.u[i][0]].hpAll; - } - if( battleClass.users[data.r.u[i][0]].mp > battleClass.users[data.r.u[i][0]].mpAll ) { - battleClass.users[data.r.u[i][0]].mp = battleClass.users[data.r.u[i][0]].mpAll; - } - // - }else{ - battleClass.log( ', ...' ); - } - }else{ - i = -2; - } - i++; - } - battleClass.loadingGlobaldata(); - } - // - }); - }, - loadingGlobaldata:function() { - var r = { - 'load':0, - 'users':"0", - 'priems':"0" - }; - // - /* - , , , , - */ - var i = 1; - while( i <= battleClass.uids[0] ) { - if( battleClass.users[ battleClass.uids[i] ].complete == false ) { - // - r.load++; - r.users = r.users + "," + battleClass.users[ battleClass.uids[i] ].id; - }else{ - // - - } - i++; - } - - // - var pr = battleClass.conf.pr.split('|'); - var prz = battleClass.conf.pr_z.split('|'); - var i = 0; - while( i < battleClass.conf.pr_s ) { - if( pr[i] != undefined && pr[i] > 0 ) { - if( battleClass.priems[pr[i]] == undefined ) { - // - r.load++; - r.priems += ',' + pr[i]; - }else{ - // - } - } - i++; - } - - // - - if( r.load > 0 ) { - - $.getJSON( 'https://new-combats.com/getbattle.php',{ 'loading':true , 'uload':r.users , 'pload':r.priems },function(data) { - // - if( data.e != undefined && data.e != "" ) { - alert( ': ' + data.e ); - } - // - if( data.r != undefined ) { - //+++++++++++++++++++++++++++++ - - battleClass.log(data); - - - // - if( data.r.ul != undefined ) { - // - var i = 0; - while( i != -1 ) { - if( data.r.ul[i] != undefined ) { - if( data.r.ul[i].id > 0 ) { - // - if( battleClass.users[data.r.ul[i].id] == undefined ) { - battleClass.users[data.r.ul[i].id] = { }; - battleClass.uids[0]++; - battleClass.uids[battleClass.uids[0]] = data.r.ul[i].id; - } - battleClass.users[data.r.ul[i].id] = data.r.ul[i]; - // - battleClass.users[data.r.ul[i].id].complete = true; - // - }else{ - battleClass.log( ', ...' ); - } - }else{ - i = -2; - } - i++; - } - // - } - - // - if( data.r.pl != undefined ) { - // - var i = 0; - while( i != -1 ) { - if( data.r.pl[i] != undefined ) { - if( data.r.pl[i].id > 0 ) { - // - if( battleClass.priems[data.r.pl[i].id] == undefined ) { - battleClass.priems[data.r.pl[i].id] = { }; - battleClass.prms[0]++; - battleClass.prms[battleClass.prms[0]] = data.r.pl[i].id; - } - battleClass.priems[data.r.pl[i].id] = data.r.pl[i]; - // - battleClass.priems[data.r.pl[i].id].complete = true; - // - }else{ - battleClass.log( ', ...' ); - } - }else{ - i = -2; - } - i++; - } - // - } - - battleClass.generate(); - - //+++++++++++++++++++++++++++++ - } - // - }); - }else{ - battleClass.generate(); - } - // - - }, - loadLog:function(url) { - var loadingLogNow = false; - $('#battle_log').remove(); - var e = document.createElement("script"); - e.src = url; - e.id = 'battle_log'; - e.type="text/javascript"; - document.getElementsByTagName("head")[0].appendChild(e); - }, - testAct:function(uid1,uid2) { - var r = false; - var i = 0; - while( i != -1 ) { - if( this.act[i] != undefined ) { - if( this.act[i][1] == uid1 && this.act[i][2] == uid2 ) { - r = true; - } - }else{ - i = -2; - } - i++; - } - return r; - }, - userInfoItems:function(id,t) { - var i = 0; - while( i != - 1 ) { - if( this.users[id].itm[i] != undefined ) { - // - title = '
    '+this.users[id].itm[i][3]+''; - title += '
    ( )'; - title += '
    '; - // - var cvs = ''; - if( id == this.me ) { - cvs = this.users[id].itm[i][5]; - } - // - abitms(t,id,this.users[id].itm[i][0],this.users[id].itm[i][2],this.users[id].itm[i][3],title,this.users[id].itm[i][4],cvs); - }else{ - i = -2; - } - i++; - } - }, - userInfoEffects:function(id,t) { - var i = 0; - var html = ''; - if( this.eff != undefined ) { - while( i != - 1 ) { - if( this.eff[i] != undefined ) { - if( this.eff[i][0] == id ) { - var title_eff = ''+this.eff[i][3]+''; - var eff_types = '()'; - if( this.eff[i][5] > 0 && this.eff[i][5] < 7 ) { - var eff_types = '()'; - }else if( (this.eff[i][5] > 6 && this.eff[i][5] < 11) || this.eff[i][5] == 16 ) { - var eff_types = '()'; - }else if( this.eff[i][5] == 14 ) { - var eff_types = '()'; - }else if( this.eff[i][5] == 15 ) { - var eff_types = '()'; - }else if( this.eff[i][5] == 17 ) { - var eff_types = '()'; - }else if( this.eff[i][5] == 18 || this.eff[i][5] == 17 ) { - var eff_types = '()'; - }else if( this.eff[i][5] == 20 ) { - var eff_types = '()'; - }else if( this.eff[i][5] == 22 ) { - var eff_types = '()'; - } - title_eff += ' ' + eff_types; - html = '
    '+html; - } - }else{ - i = -2; - } - i++; - } - } - return html; - }, - userInfo:function(id,t) { - var stats_title = ''; - stats_title += ''+this.users[id].login+'
    '; - stats_title += ': --
    '; - stats_title += ': --
    '; - stats_title += ': --
    '; - stats_title += ': --
    '; - - var eff_data = this.userInfoEffects(id,t); - - return info_reflesh(t,id,'',this.users[id].obraz,this.users[id].hp,this.users[id].hpAll,this.users[id].mp,this.users[id].mpAll,0,0,eff_data,stats_title,0,''); - }, - generate:function() { - - // - $('#nabito').html( this.conf.damage ); - - // - $('#timer_out').html( this.conf.timeout ); - - // - var i = 1; - while( i <= 7 ) { - $('#tac'+i).html( ( 0 + parseInt(this.conf.tactic[i]) )); - i++; - } - $('#tac7t').attr( { 'title':' : ' + this.conf.tactic[7] } ); - - // - $('#player1').html( this.userInfo(this.me,1) ); - $('#player1_login').html( this.microLogin(this.me,0) ); - this.userInfoItems(this.me,1); - - // - if( this.enemy > 0 ) { - $('#player2').html( this.userInfo(this.enemy,2) ); - $('#player2_login').html( this.microLogin(this.enemy,0) + ' ' ); - this.userInfoItems(this.enemy,2); - }else{ - $('#player2_login').html(''); - $('#player2').html(' ...'); - } - - //. - shpb(); - - // - var pr_see = ''; - var pr = battleClass.conf.pr.split('|'); - var prz = battleClass.conf.pr_z.split('|'); - var i = 0; - while( i < battleClass.conf.pr_s ) { - if( pr[i] != undefined && pr[i] > 0 ) { - if( battleClass.priems[pr[i]] != undefined ) { - prm = battleClass.priems[pr[i]]; - cl = ''; - if( prm.type == 1 ) { - var onuser = ''; - if( prm.onUser > 0 ) { - cl = 'href="javascript:void(0);" onClick="top.priemOnUser('+i+',1,\''+prm.name+'\',\''+onuser+'\',\''+prm.img+'\');"'; - }else{ - cl = 'href="javascript:void(0);" onClick="usepriem('+i+',1,\''+prm.img+'\');"'; - } - }else if( prm.type == 2 ) { - cl = 'href="javascript:void(0);" onClick="usepriem('+i+',1,\''+prm.img+'\');"'; - }else if( prm.type == 3 ) { - cl = 'href="javascript:void(0);" onClick="alert(\' ?\');"'; - } - }else{ - prm = { - 'id':pr[i], - 'name':"* "+pr[i]+"*", - 'img':"clearPriem.gif" - }; - cl = 'href="javascript:void(0);" onclick="alert(\' \');"'; - } - pr_see += ''; - }else{ - pr_see += ''; - } - i++; - } - $('#priems').html( pr_see ); - delete pr_see; - - // - var rd = ''; - var tms = []; - var tmr = [0]; - var i = 1; - while( i <= this.uids[0] ) { - if( tms[this.users[ this.uids[i] ].team] == undefined ) { - tmr[0]++; - tms[this.users[ this.uids[i] ].team] = ''; - tmr[tmr[0]] = this.users[ this.uids[i] ].team; - } - if( this.users[ this.uids[i] ].hp > 0 ) { - if( tms[this.users[ this.uids[i] ].team] != '' ) { - tms[this.users[ this.uids[i] ].team] += ', '; - } - tms[this.users[ this.uids[i] ].team] += this.teamLogin(this.users[ this.uids[i] ].id,1); - } - i++; - } - var i = 1; - while( i <= tmr[0] ) { - if( tms[tmr[i]] != '' ) { - if( rd != '' ) { - rd += '      '; - } - rd += ' ' + tms[tmr[i]]; - } - i++; - } - $('#teams').html( rd ); - // - // - this.loadLog('https://new-combats.com/battle_logs/btl_'+this.battle+'.js?'+this.hod); - this.logTimerX = 0; - this.logUpdateNow(); - // - // - if( this.testAct( this.me , this.enemy ) == true ) { - mainstatus(2); - }else{ - mainstatus(1); - } - // - }, - lastvlogid:0, - logTimer:null, - logTimerX:0, - logUpdateNow:function() { - clearTimeout(this.logTimer); - if( typeof logRefleshedCache == 'function' && loadingLogNow == true && this.lastvlogid < vlogid) { - this.lastvlogid = vlogid; - this.logTimerX = 0; - $('#battle_logg').html(''); - logRefleshedCache(); - }else{ - this.logTimerX++; - this.log('logUpdateNow-cycles'); - if( this.logTimerX < 101 ) { - this.logTimer = setTimeout('battleClass.logUpdateNow();',20); - }else{ - this.logTimerX = 0; - } - } - }, - teamLogin:function(id,type) { - var r = ''; - if( this.users[id].align != undefined && this.users[id].align > 0 ) { - // r += ''; - } - if( this.users[id].clan != undefined && this.users[id].clan > 0 ) { - // r += ''; - } - var stl = ''; - if( this.testAct(this.me,id) != false ) { - // - stl = ''; - } - if( this.testAct(id,this.me) != false ) { - //, - stl = 'text-decoration:underline;'; - } - r += ''+this.users[id].login+''; - // - r += ' ['+this.users[id].hp+'/'+this.users[id].hpAll+']'; - // - return r; - }, - microLogin:function(id,type) { - var r = ''; - if( this.users[id].align != undefined && this.users[id].align > 0 ) { - r += ''; - } - if( this.users[id].clan != undefined && this.users[id].clan > 0 ) { - r += ''; - } - r += ''+this.users[id].login+' ['+this.users[id].level+']'; - r += ''; - return r; - } -}; \ No newline at end of file diff --git a/bonuss.php b/bonuss.php index dba4b2fa..f25ab081 100644 --- a/bonuss.php +++ b/bonuss.php @@ -1,46 +1,46 @@ -"; - } +const GAME = true; +require_once('_incl_data/__config.php'); +require_once('_incl_data/class/__db_connect.php'); +$u = User::start(); +$d = new Dungeon; +$d->start(); + +if ($_POST['code'] == $_SESSION['code'] && $_POST['code'] != '') { + echo ""; +} ?> - - - + + +
    - +
    - -
    - + +
    +
    \ No newline at end of file diff --git a/breakchaos.php b/breakchaos.php index a913c7c3..446d5eeb 100644 --- a/breakchaos.php +++ b/breakchaos.php @@ -1,158 +1,133 @@ - -1 -SeDuCeR [12] -243 -47748 -»» - -*/ +$u = User::start(); $r1 = ''; $r2 = ''; $lvl = 8; $lvl_name = ''; -if( $_GET['level'] == 9 ) { - $lvl = 9; - $lvl_name = ''; -}elseif( $_GET['level'] == 10 ) { - $lvl = 10; - $lvl_name = ''; -}elseif( $_GET['level'] == 11 ) { - $lvl = 11; - $lvl_name = ''; +if ($_GET['level'] == 9) { + $lvl = 9; + $lvl_name = ''; +} elseif ($_GET['level'] == 10) { + $lvl = 10; + $lvl_name = ''; +} elseif ($_GET['level'] == 11) { + $lvl = 11; + $lvl_name = ''; } $i = 1; $j = 1; -$sp = mysql_query('SELECT `id`,`uid`,`level`,`time` FROM `izlom_rating` WHERE `level` = "' . $lvl . '" GROUP BY `uid` ORDER BY SUM(`obr`) DESC'); -while( $pl = mysql_fetch_array($sp) ) { - // - $ret = mysql_fetch_array(mysql_query('SELECT SUM(`obr`) FROM `izlom_rating` WHERE `uid` = "'.$pl['uid'].'" AND `level` = "'.$pl['level'].'" LIMIT 1')); - $ret = round($ret[0]*(154.97)); - // - $pl2 = mysql_fetch_array(mysql_query('SELECT * FROM `izlom_rating` WHERE `uid` = "'.$pl['uid'].'" AND `level` = "'.$pl['level'].'" ORDER BY `time` DESC LIMIT 1')); - // - $r1 .= ' +$sp = mysql_query( + 'SELECT `id`,`uid`,`level`,`time` FROM `izlom_rating` WHERE `level` = "' . $lvl . '" GROUP BY `uid` ORDER BY SUM(`obr`) DESC' +); +while ($pl = mysql_fetch_array($sp)) { + // + $ret = mysql_fetch_array( + mysql_query( + 'SELECT SUM(`obr`) FROM `izlom_rating` WHERE `uid` = "' . $pl['uid'] . '" AND `level` = "' . $pl['level'] . '" LIMIT 1' + ) + ); + $ret = round($ret[0] * (154.97)); + // + $pl2 = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `izlom_rating` WHERE `uid` = "' . $pl['uid'] . '" AND `level` = "' . $pl['level'] . '" ORDER BY `time` DESC LIMIT 1' + ) + ); + // + $r1 .= ' ' . $i . ' -' . $u->microLogin($pl['uid'],1) . ' +' . $u->microLogin($pl['uid'], 1) . ' ' . $pl2['voln'] . ' -'.$ret.' -»» -'; - // - if( date('d.m.Y') == date('d.m.Y',$pl2['time']) ) { - $r2 .= ' -' . $j . ' -' . $u->microLogin($pl['uid'],1) . ' -' . $pl2['voln'] . ' -'.$ret.' -»» -'; - $j++; - } - $i++; -} - -/*$sp = mysql_query('SELECT * FROM `izlom_rating` WHERE `level` = "' . $lvl . '" GROUP BY `uid` ORDER BY MAX(`time`) DESC'); -while( $pl = mysql_fetch_array($sp) ) { - // - $ret = mysql_fetch_array(mysql_query('SELECT SUM(`obr`) FROM `izlom_rating` WHERE `uid` = "'.$pl['uid'].'" AND `level` = "'.$pl['level'].'" LIMIT 1')); - $ret = round($ret[0]*(154.97)); - // - $r1 .= ' -' . $i . ' -' . $u->microLogin($pl['uid'],1) . ' -' . $pl['voln'] . ' -'.$ret.' -»» -'; - -if( $pl['uid'] == 1000000 ) { - echo date('d.m.Y',$pl['time']).'
    '; -} - if( date('d.m.Y') == date('d.m.Y',$pl['time']) ) { - $r2 .= ' -' . $j . ' -' . $u->microLogin($pl['uid'],1) . ' -' . $pl['voln'] . ' ' . $ret . ' »» '; - $j++; - } - $i++; -}*/ + // + if (date('d.m.Y') == date('d.m.Y', $pl2['time'])) { + $r2 .= ' +' . $j . ' +' . $u->microLogin($pl['uid'], 1) . ' +' . $pl2['voln'] . ' +' . $ret . ' +»» +'; + $j++; + } + $i++; +} + ?> - -: - + + : +

    -
    - - - - - - - - -
    - -
    -
    -
    - - - - - - - - - - - - -
    - -
    - -
    -
    -
    - - - - - - - - - - - - -
    - -
    -
    +
    + + + + + + + + +
    +
    + +
    -
    +
    + + + + + + + + + + + + +
    + +
    +
    +
    + +
    -
    +
    + + + + + + + + + + + + +
    + +
    +
    +

    \ No newline at end of file diff --git a/buttons.php b/buttons.php index 5d6a6084..167a8f97 100644 --- a/buttons.php +++ b/buttons.php @@ -1,30 +1,17 @@

    :

    ' . $e . '


    (c) ' . $c[1] . '

    '); + exit('

    :

    ' . $e . '


    (c) ' . $c[1] . '

    '); } -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()); - include_once('_incl_data/__config.php'); include_once('_incl_data/class/__db_connect.php'); -include_once('_incl_data/class/__user.php'); -include_once('_incl_data/class/__filter_class.php'); -include_once('_incl_data/class/__chat_class.php'); +define('IP', UserIp::get()); +$u = User::start(); +$filter = new Filter(); +$chat = new Chat(); ini_set('max_execution_time', '120'); @@ -47,8 +34,11 @@ if ($u->info['joinIP'] == 1 && $u->info['ip'] != IP) { } 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"); + $filter->setOnline($u->info['online'], $u->info['id']); + mysql_query( + "UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time( + ) . "' WHERE `id`='" . $u->info['id'] . "' LIMIT 1" + ); } $u->stats = $u->getStats($u->info['id'], 0); @@ -59,743 +49,752 @@ if ($u->info['activ'] > 0) { } ?> - - - - - Acombats - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer'); + $_COOKIE['d1c'] = $deviceType; + setcookie('d1c', $deviceType, (time() + 86400)); + } else { + $deviceType = $_COOKIE['d1c']; } - - - - - - - - + if ($deviceType == 'tablet' || $deviceType == 'phone') { + echo ''; + ?> + - - - - isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer'); - $_COOKIE['d1c'] = $deviceType; - setcookie('d1c', $deviceType, (time() + 86400)); - } else { - $deviceType = $_COOKIE['d1c']; - } - - if ($deviceType == 'tablet' || $deviceType == 'phone') { - echo ''; + + + + + - - - - - - - - - - - - -info['bithday'] == '01.01.1800') { - ?> - + + + + info['active'] != '' && $u->info['mail'] == 'No E-mail') { - if ($error != '') { - echo ''; + if ($u->info['bithday'] == '01.01.1800') { + ?> + + + + info['active'] != '' && $u->info['mail'] == 'No E-mail') { + if ($error != '') { + echo ''; + } + ?> + + - - - + -
    - - - -
    -
    -
    -
    -
    - :
    -
    : -
    -
    -
    + #mini_qsst { + position: absolute; + z-index: 100; + cursor: default; + display: none; + bottom: 10px; + right: 18px; + } + +
    + - -
         + -
    - -
    + +
    +
    +
    +
    +
    + :
    +
    : +
    +
    +
    +
    + +
         +
    +
    + +
    -
    +
    - - -
    -
    - -
    -
    - -
    - - - - - - - - + + + + + + + +
    - - - - - - -
    - - - - - - - - -
    - - -
    -
    -
    - - - - - - - - +
    - - - - - - - - - info['level'] > 9) { ?> + +
    - 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=""> -   - - - - - - - - -
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + - - - - - - - -
     
    +
    + +
    +
    + + + + + +
    + +
    +
    +
    + + + + + + +
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + - - - - - - - - - - - - info['level'] > 7) { ?> - + + + + + + + + - + info['level'] > 7) { ?> + + - info['align'] == 50 || $u->info['align2'] == 50 || $u->info['admin'] == 1) { ?> - - info['align'] >= 1.1 && $u->info['align'] < 2) { ?> - - info['align'] >= 3.01 && $u->info['align'] < 4) { ?> - - info['vip'] > time() || $u->stats['silvers'] > 0 || $u->stats['bronze'] > 0 || $u->stats['gold'] > 0) { ?> - - + info['align'] == 50 || $u->info['align2'] == 50 || $u->info['admin'] == 1) { ?> + + info['align'] >= 1.1 && $u->info['align'] < 2) { ?> + + info['align'] >= 3.01 && $u->info['align'] < 4) { ?> + + info['vip'] > time( + ) || $u->stats['silvers'] > 0 || $u->stats['bronze'] > 0 || $u->stats['gold'] > 0) { ?> + + - + - info['align'] >= 1 && $u->info['align'] < 2) { ?> - - info['align'] >= 3 && $u->info['align'] < 4) { ?> - - info['align'] == 7) { ?> - - info['bukmeker'] == 1 || $u->info['admin'] == 1) { ?> - - info['align'] >= 1 && $u->info['align'] < 2) { ?> + + info['align'] >= 3 && $u->info['align'] < 4) { ?> + + info['align'] == 7) { ?> + + info['bukmeker'] == 1 || $u->info['admin'] == 1) { ?> + + info['clan'] > 0) { ?> - - info['admin'] > 0) { ?> - - - + if ($u->info['clan'] > 0) { ?> + + info['admin'] > 0) { ?> + + + - - - + + + - -
    + 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=""> +   + + + + + + + + +   - +   + + - - + +
    -
    -
    - +
    +
    +
    + - - + + 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'); + } } + ?> + - $button.addEventListener("mouseover", function (event) { - - 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` - - everySecondsUpdate() - - intervalClear = setInterval(() => everySecondsUpdate(), 1000) - }, 550) - }) - - $button.addEventListener("mouseout", function (event) { - $div.hidden = true - clearInterval(intervalClear) - clearTimeout(timeoutClear) - }) - + + + 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'); - } -} -?> - - - - - - - +unset($db); \ No newline at end of file diff --git a/cgi-bin/buttons.php b/cgi-bin/buttons.php deleted file mode 100644 index a24d3d9e..00000000 --- a/cgi-bin/buttons.php +++ /dev/null @@ -1,986 +0,0 @@ -

    :

    '.$e.'


    (c) '.$c[1].'

    '); -} - -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()); - -include_once('_incl_data/__config.php'); -include_once('_incl_data/class/__db_connect.php'); -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' ); - -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(''); -}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
    .'); -} - -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); - -if($u->info['activ']>0) { - include('activnew.php'); - die(); -} - -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -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 ''; -}*/ -// -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 ''; -?> - - - - - - - - - - - - -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 '
    -
    - ?
    :


    -  , ! ? , , - " " .., , , . - , . - , ! ! , , , - - . - !
    -  - ! , . -



    - , ! ! ;-) -
    ';*/ -//} -?> - -info['bithday'] == '01.01.1800') { -?> - - - -info['active']!='' && $u->info['mail']=='No E-mail') { - if($error!='') { - echo ''; - } -?> - - - - -
    - - - -
    -
    -
    -
    -
    - :
    -
    : -
    -
    -
    - -
        
    -
    - - -
    - -
    - - - -
    -
    - -
    -
    - -
    - - - - - - - - - -
    - - - - - -
    - - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
    -
    - -
    -
    - - - - - -
    -
    -
    -
    - - - - - - -
    -
    -
    */ ?> - -
    - -
    - - - -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    - -
    -
    - -
    - info['admin'] > 0 ) { ?> - -
    - -
    -
    -
    -
    - - - - - - - - - info['level']>9){ ?> - - - - - - - - - - - - - info['level']>7){ ?> - - info['level']>=0){ ?> - - - info['align']==50 || $u->info['align2']==50 || $u->info['admin'] == 1) {?> - - info['align']>=1.1 && $u->info['align']<2 ){ ?> - - info['align']>=3.01 && $u->info['align']<4){ ?> - - info['vip']>time() || $u->stats['silvers']>0 || $u->stats['bronze']>0 || $u->stats['gold']>0 ){ ?> - - - - info['level']>= 0){ ?> - - info['align']>=1 && $u->info['align']<2){ ?> - - info['align']>=3 && $u->info['align']<4){ ?> - - info['align']==7) { ?> - - info['bukmeker']==1 || $u->info['admin']==1){ ?> - - info['admin'] > 0 || $u->info['align'] == 50){ ?> - - info['level']>-1){ ?> - - info['clan']>0){ ?> - - info['admin']>0){ ?> - - - - - - - -
    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="">  - - - - - - - - -  
    -
    -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 ''; - //$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(''); - } - } - */ -} -?> - - - - \ No newline at end of file diff --git a/clans_inf.php b/clans_inf.php index 67c9a0de..fd86c157 100644 --- a/clans_inf.php +++ b/clans_inf.php @@ -1,29 +1,34 @@ - +$uplogin = explode('&', $_SERVER['QUERY_STRING']); +$uplogin = $uplogin[0]; +$uplogin = preg_replace('/%20/', " ", $uplogin); +if (!isset($_GET['id'])) { + $_GET['id'] = 0; +} +if (!isset($upLogin)) { + $upLogin = ''; +} +$utf8Login = ''; +$utf8Login2 = ''; +$utf8Login = iconv("utf-8", "windows-1251", $uplogin); +if ($uplogin != 'delete' && $utf8Login != 'delete' && $utf8Login2 != 'delete') { + $clan = mysql_fetch_array( + mysql_query( + 'SELECT `u`.* FROM `clan` AS `u` WHERE (`u`.`id`="' . mysql_real_escape_string( + $_GET['id'] + ) . '" OR `u`.`id`="' . mysql_real_escape_string( + $uplogin + ) . '" OR `u`.`name`="' . mysql_real_escape_string($uplogin) . '") LIMIT 1' + ) + ); +} +if (!isset($clan['id'])) { + die( + ' @@ -31,239 +36,323 @@ define('UPPERCASE',1); :
       ...


    -

    (c) '.$c['title'].'

    - '.$c['counters'].' - '); - } - - $xu = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `real` = 1 AND `clan` = "'.$clan['id'].'" LIMIT 1')); - $xu = 0 + $xu[0]; - $r1 = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "'.$clan['id'].'" AND `date` = "'.date('dmY').'" LIMIT 1')); - $r2 = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "'.$clan['id'].'" AND `date` != "'.date('dmY').'" ORDER BY `id` DESC LIMIT 1')); - - $vid = ''; - if( isset($r2['pos']) ) { - if( $r2['pos'] < $r1['pos'] ) { - $vid = '-'.($r1['pos']-$r2['pos']).''; - }elseif( $r2['pos'] > $r1['pos'] ) { - $vid = '+'.($r2['pos']-$r1['pos']).''; - } - } - - $clan_info = mysql_fetch_array(mysql_query('SELECT * FROM `clan_info` WHERE `id` = "'.$clan['id'].'" LIMIT 1')); - if( $clan_info['info'] == '' ) { - $clan_info['info'] = ' .'; - } - - $vid1 = ''; - if( isset($r2['pos']) ) { - if( round($r2['global']/(15678+$r2['level']),3) < round($r1['global']/(15678+$r1['level']),3) ) { - $vid1 = ' +'.(round($r1['global']/(15678+$r1['level']),3) - round($r2['global']/(15678+$r2['level']),3)).''; - }elseif( round($r2['global']/(15678+$r2['level']),3) > round($r1['global']/(15678+$r1['level']),3) ) { - $vid1 = ' -'.(round($r2['global']/(15678+$r2['level']),3) - round($r1['global']/(15678+$r1['level']),3)).''; - } - } - - $vid2 = ''; - if( isset($r2['pos']) ) { - if( $r2['exp_real'] < $r1['exp_real'] ) { - $vid2 = ' +'.($r1['exp_real']-$r2['exp_real']).''; - }elseif( $r2['exp_real'] > $r1['exp_real'] ) { - $vid2 = ' -'.($r2['exp_real']-$r1['exp_real']).''; - } - } - - $vid3 = ''; - if( isset($r2['pos']) ) { - if( $r2['win'] < $r1['win'] ) { - $vid3 = ' +'.($r1['win']-$r2['win']).''; - }elseif( $r2['win'] > $r1['win'] ) { - $vid3 = ' -'.($r2['win']-$r1['win']).''; - } - } - - $vid4 = ''; - if( isset($r2['pos']) ) { - if( $r2['lose'] < $r1['lose'] ) { - $vid4 = ' +'.($r1['lose']-$r2['lose']).''; - }elseif( $r2['lose'] > $r1['lose'] ) { - $vid4 = ' -'.($r2['lose']-$r1['lose']).''; - } - } - - $vid5 = ''; - if( isset($r2['pos']) ) { - if( $r2['nich'] < $r1['nich'] ) { - $vid5 = ' +'.($r1['nich']-$r2['nich']).''; - }elseif( $r2['nich'] > $r1['nich'] ) { - $vid5 = ' -'.($r2['nich']-$r1['nich']).''; - } - } +

    (c) ' . $c['title'] . '

    + ' . $c['counters'] . ' + ' + ); +} + +$xu = mysql_fetch_array( + mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `real` = 1 AND `clan` = "' . $clan['id'] . '" LIMIT 1') +); +$xu = 0 + $xu[0]; +$r1 = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "' . $clan['id'] . '" AND `date` = "' . date( + 'dmY' + ) . '" LIMIT 1' + ) +); +$r2 = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "' . $clan['id'] . '" AND `date` != "' . date( + 'dmY' + ) . '" ORDER BY `id` DESC LIMIT 1' + ) +); + +$vid = ''; +if (isset($r2['pos'])) { + if ($r2['pos'] < $r1['pos']) { + $vid = '-' . ($r1['pos'] - $r2['pos']) . ''; + } elseif ($r2['pos'] > $r1['pos']) { + $vid = '+' . ($r2['pos'] - $r1['pos']) . ''; + } +} + +$clan_info = mysql_fetch_array(mysql_query('SELECT * FROM `clan_info` WHERE `id` = "' . $clan['id'] . '" LIMIT 1')); +if ($clan_info['info'] == '') { + $clan_info['info'] = ' .'; +} + +$vid1 = ''; +if (isset($r2['pos'])) { + if (round($r2['global'] / (15678 + $r2['level']), 3) < round($r1['global'] / (15678 + $r1['level']), 3)) { + $vid1 = ' +' . (round($r1['global'] / (15678 + $r1['level']), 3) - round( + $r2['global'] / (15678 + $r2['level']), 3 + )) . ''; + } elseif (round($r2['global'] / (15678 + $r2['level']), 3) > round($r1['global'] / (15678 + $r1['level']), 3)) { + $vid1 = ' -' . (round($r2['global'] / (15678 + $r2['level']), 3) - round( + $r1['global'] / (15678 + $r1['level']), 3 + )) . ''; + } +} + +$vid2 = ''; +if (isset($r2['pos'])) { + if ($r2['exp_real'] < $r1['exp_real']) { + $vid2 = ' +' . ($r1['exp_real'] - $r2['exp_real']) . ''; + } elseif ($r2['exp_real'] > $r1['exp_real']) { + $vid2 = ' -' . ($r2['exp_real'] - $r1['exp_real']) . ''; + } +} + +$vid3 = ''; +if (isset($r2['pos'])) { + if ($r2['win'] < $r1['win']) { + $vid3 = ' +' . ($r1['win'] - $r2['win']) . ''; + } elseif ($r2['win'] > $r1['win']) { + $vid3 = ' -' . ($r2['win'] - $r1['win']) . ''; + } +} + +$vid4 = ''; +if (isset($r2['pos'])) { + if ($r2['lose'] < $r1['lose']) { + $vid4 = ' +' . ($r1['lose'] - $r2['lose']) . ''; + } elseif ($r2['lose'] > $r1['lose']) { + $vid4 = ' -' . ($r2['lose'] - $r1['lose']) . ''; + } +} + +$vid5 = ''; +if (isset($r2['pos'])) { + if ($r2['nich'] < $r1['nich']) { + $vid5 = ' +' . ($r1['nich'] - $r2['nich']) . ''; + } elseif ($r2['nich'] > $r1['nich']) { + $vid5 = ' -' . ($r2['nich'] - $r1['nich']) . ''; + } +} + +$timday = strtotime('now 00:00:00'); +$clanw = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`id`) FROM `battle` WHERE `type` = 250 AND `time_over` > "' . $timday . '" AND ((`team_win`=1 AND `clan1` = "' . $clan['id'] . '") OR (`team_win`=2 AND `clan2` = "' . $clan['id'] . '")) LIMIT 1' + ) +); +$clanw = $clanw[0]; + +$clanl = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(`id`) FROM `battle` WHERE `type` = 250 AND `time_over` > "' . $timday . '" AND ((`team_win`=2 AND `clan1` = "' . $clan['id'] . '") OR (`team_win`=1 AND `clan2` = "' . $clan['id'] . '")) LIMIT 1' + ) +); +$clanl = $clanl[0]; + +$clanwar = mysql_query( + 'SELECT * FROM `clan_wars` WHERE (`clan1`="' . $clan['id'] . '" OR `clan2`="' . $clan['id'] . '") AND `time_finish` > "' . time( + ) . '"' +); +$clwe = ""; +while ($clanwa = mysql_fetch_array($clanwar)) { + if ($clanwa['clan1'] == $clan['id']) { + $clw = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $clanwa['clan2'] . '" LIMIT 1')); + + $clwe .= '' . $clw['name'] . ' '; + } else { + $clw = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $clanwa['clan1'] . '" LIMIT 1')); + $clwe .= '' . $clw['name'] . ' '; + + } +} + - $timday=strtotime('now 00:00:00'); - $clanw = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `battle` WHERE `type` = 250 AND `time_over` > "'.$timday.'" AND ((`team_win`=1 AND `clan1` = "'.$clan['id'].'") OR (`team_win`=2 AND `clan2` = "'.$clan['id'].'")) LIMIT 1')); - $clanw = $clanw[0]; - - $clanl = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `battle` WHERE `type` = 250 AND `time_over` > "'.$timday.'" AND ((`team_win`=2 AND `clan1` = "'.$clan['id'].'") OR (`team_win`=1 AND `clan2` = "'.$clan['id'].'")) LIMIT 1')); - $clanl = $clanl[0]; - - $clanwar = mysql_query('SELECT * FROM `clan_wars` WHERE (`clan1`="'.$clan['id'].'" OR `clan2`="'.$clan['id'].'") AND `time_finish` > "'.time().'"'); - $clwe = ""; - while($clanwa = mysql_fetch_array($clanwar)) - { - if ($clanwa['clan1'] == $clan['id']) - { - $clw = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$clanwa['clan2'].'" LIMIT 1')); - - $clwe .= ''.$clw['name'].' '; - } - else - { - $clw = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$clanwa['clan1'].'" LIMIT 1')); - $clwe .= ''.$clw['name'].' '; - - } - } - - - - ?> - - <?=$clan['name']?> - - - - - - - - + + <?= $clan['name'] ?> + + + + + + + +
    - - -
    -

    -

    :

    -

    :

    -
    - - - - - -
    -
    -
    - - -
    -
    - : - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    :
     
    :
    :
     
    :
    :
    :
    :
     
    :
    :
    :
    :
     
    :
     
    :
    + + + +
    +

    +

    : +

    +

    :

    +
    + + + + +
    +
    +
    + + + +
    +
    + : + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
     
    :
    :
     
    :
    :
    :
    :
     
    :
    :
    :
    :
     
    :
     
    : +
    +
    +
    +
    +
    +
    + + + '; + } else { + $html .= '
    '; + } + $html .= ' '; + if ($pl['align2'] > 0) { + $html .= ' '; + } + $html .= ' '; + $html .= '' . $pl['login'] . ' [' . $pl['level'] . ']'; + $html .= ' '; + $html .= ' - '; + if ($pl['online'] < time() - 520) { + $html .= ' 
    '; + } else { + $html .= '
    '; + } + } + + $html .= '
    '; + + $sp = mysql_query( + 'SELECT * FROM `users` WHERE `clan` = "' . $clan['id'] . '" AND `clan_prava` != "glava" AND `online` > "' . (time( + ) - 520) . '" ORDER BY `login` ASC' + ); + while ($pl = mysql_fetch_array($sp)) { + $html .= '
    '; + $html .= ' '; + if ($pl['align2'] > 0) { + $html .= ' '; + } + $html .= ' '; + $html .= '' . $pl['login'] . ' [' . $pl['level'] . ']'; + $html .= ' '; + $html .= ' - ' . $pl['mod_zvanie'] . ''; + $html .= '
    '; + } + $sp = mysql_query( + 'SELECT * FROM `users` WHERE `clan` = "' . $clan['id'] . '" AND `clan_prava` != "glava" AND `online` <= "' . (time( + ) - 520) . '" ORDER BY `login` ASC' + ); + while ($pl = mysql_fetch_array($sp)) { + $html .= '
    '; + $html .= ' '; + if ($pl['align2'] > 0) { + $html .= ' '; + } + $html .= ' '; + $html .= '' . $pl['login'] . ' [' . $pl['level'] . ']'; + $html .= ' '; + $html .= ' - ' . $pl['mod_zvanie'] . ''; + $html .= ' 
    '; + } + echo $html; + unset($html); + ?> + +
    : + + +
    -
    -
    -
    -
    -
    - - - '; - }else{ - $html .= '
    '; - } - $html .= ' '; - if( $pl['align2'] > 0 ) { - $html .= ' '; - } - $html .= ' '; - $html .= ''.$pl['login'].' ['.$pl['level'].']'; - $html .= ' '; - $html .= ' - '; - if( $pl['online'] < time() - 520 ) { - $html .= ' 
    '; - }else{ - $html .= '
    '; - } - } - - $html .= '
    '; - - $sp = mysql_query('SELECT * FROM `users` WHERE `clan` = "'.$clan['id'].'" AND `clan_prava` != "glava" AND `online` > "'.(time()-520).'" ORDER BY `login` ASC'); - while( $pl = mysql_fetch_array($sp) ) { - $html .= '
    '; - $html .= ' '; - if( $pl['align2'] > 0 ) { - $html .= ' '; - } - $html .= ' '; - $html .= ''.$pl['login'].' ['.$pl['level'].']'; - $html .= ' '; - $html .= ' - '.$pl['mod_zvanie'].''; - $html .= '
    '; - } - $sp = mysql_query('SELECT * FROM `users` WHERE `clan` = "'.$clan['id'].'" AND `clan_prava` != "glava" AND `online` <= "'.(time()-520).'" ORDER BY `login` ASC'); - while( $pl = mysql_fetch_array($sp) ) { - $html .= '
    '; - $html .= ' '; - if( $pl['align2'] > 0 ) { - $html .= ' '; - } - $html .= ' '; - $html .= ''.$pl['login'].' ['.$pl['level'].']'; - $html .= ' '; - $html .= ' - '.$pl['mod_zvanie'].''; - $html .= ' 
    '; - } - echo $html; - unset($html); - ?> - -
    : - - -
    diff --git a/confirm.php b/confirm.php index 48f5765f..091768c6 100644 --- a/confirm.php +++ b/confirm.php @@ -1,5 +1,5 @@ diff --git a/contacts.html b/contacts.html index b8a897e5..75fe36b8 100644 --- a/contacts.html +++ b/contacts.html @@ -1,41 +1,43 @@ - - - - - - - - - - + + + - + + + + + + - - -
             new-combats.com -
    -        -        -        -        -        -        -
    -
    -
    -
    -

    + + +
    +          new-combats.com +
    +        +        +        +        +        +        +
    +

    -


    - : . , . .8 .1
    - : +79107779911
    - : - 10:00 18:00, - -




    -
    -     -     -     -     -     -
    - +
    +
    + : . , . .8 .1
    + : +79107779911
    + : - 10:00 18:00, - - +
    +
    +     +     +     +     +     +
    +
    + \ No newline at end of file diff --git a/cron/battle_dell.php b/cron/battle_dell.php index 1c9147f3..f9ef95a6 100644 --- a/cron/battle_dell.php +++ b/cron/battle_dell.php @@ -1,62 +1,32 @@ "; - if (isset($tbtl['id'])) - { - sleep (2); - } - else - { - mysql_query('UPDATE `users` SET `battle` = 0 WHERE `battle` > 0'); - mysql_query('LOCK TABLES `battle_act` WRITE,`battle_end` WRITE,`battle_last` WRITE,`battle_out` WRITE,`battle_stat` WRITE,`battle_users` WRITE,`battle` WRITE,`battle_logs` WRITE,`battle_logs_save` WRITE,`zayvki` WRITE'); - - mysql_query('TRUNCATE TABLE `battle_act`'); - //mysql_query('OPTIMIZE TABLE `battle_act`'); - - mysql_query('TRUNCATE TABLE `battle_end`'); - //mysql_query('OPTIMIZE TABLE `battle_end`'); - - mysql_query('TRUNCATE TABLE `battle_last`'); - //mysql_query('OPTIMIZE TABLE `battle_last`'); - - mysql_query('TRUNCATE TABLE `battle_out`'); - //mysql_query('OPTIMIZE TABLE `battle_out`'); - - mysql_query('TRUNCATE TABLE `battle_stat`'); - //mysql_query('OPTIMIZE TABLE `battle_stat`'); - - mysql_query('TRUNCATE TABLE `battle_users`'); - //mysql_query('OPTIMIZE TABLE `battle_users`'); - - mysql_query('TRUNCATE TABLE `battle`'); - //mysql_query('OPTIMIZE TABLE `battle`'); +$test = 0; +while ($test == 0) { - - mysql_query('TRUNCATE TABLE `battle_logs`'); - //mysql_query('OPTIMIZE TABLE `battle_logs`'); - - mysql_query('TRUNCATE TABLE `battle_logs_save`'); - //mysql_query('OPTIMIZE TABLE `battle_logs_save`'); - - mysql_query('TRUNCATE TABLE `zayvki`'); - //mysql_query('OPTIMIZE TABLE `zayvki`'); - - mysql_query('UNLOCK TABLES'); - - $test=1; - } + $tbtl = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `team_win`=-1 ORDER BY `id` LIMIT 1')); + echo ": "; + echo $tbtl['id'] . "
    "; + if (isset($tbtl['id'])) { + sleep(2); + } else { + mysql_query('UPDATE `users` SET `battle` = 0 WHERE `battle` > 0'); + mysql_query( + 'LOCK TABLES `battle_act` WRITE,`battle_end` WRITE,`battle_last` WRITE,`battle_out` WRITE,`battle_stat` WRITE,`battle_users` WRITE,`battle` WRITE,`battle_logs` WRITE,`battle_logs_save` WRITE,`zayvki` WRITE' + ); + mysql_query('TRUNCATE TABLE `battle_act`'); + mysql_query('TRUNCATE TABLE `battle_end`'); + mysql_query('TRUNCATE TABLE `battle_last`'); + mysql_query('TRUNCATE TABLE `battle_out`'); + mysql_query('TRUNCATE TABLE `battle_stat`'); + mysql_query('TRUNCATE TABLE `battle_users`'); + mysql_query('TRUNCATE TABLE `battle`'); + mysql_query('TRUNCATE TABLE `battle_logs`'); + mysql_query('TRUNCATE TABLE `battle_logs_save`'); + mysql_query('TRUNCATE TABLE `zayvki`'); + mysql_query('UNLOCK TABLES'); - } - -?> + $test = 1; + } +} diff --git a/cron/battle_finish.php b/cron/battle_finish.php index 7f1a5f89..cca13afd 100644 --- a/cron/battle_finish.php +++ b/cron/battle_finish.php @@ -1,10 +1,7 @@ = 8 && $test['count'] < 12) + elseif ($test['count'] < 12) { mysql_query('UPDATE `battle` SET `timeout` = "120" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - elseif ($test['count'] >= 12) - { - mysql_query('UPDATE `battle` SET `timeout` = "180" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); + } else { + mysql_query('UPDATE `battle` SET `timeout` = "180" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } @@ -47,7 +42,6 @@ while( $pl = mysql_fetch_array($sp) ) { // batle cache mysql_query('DELETE FROM `battle_cache` WHERE `time` < "'.(time()-3600).'"'); -//mysql_query('OPTIMIZE TABLE `battle_cache`'); // (1-5 ) $sp = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `type` = 33 AND `time_over` < "'.(time()-120).'" AND `time_over` > "'.(time() - 360).'" AND `time_over` != 0 ORDER BY `battle`.`time_over` DESC LIMIT 1')); @@ -83,5 +77,4 @@ while( $pl = mysql_fetch_array($sps)) } // unset($sp,$sps,$pl,$test); - -?> + diff --git a/cron/battle_save.php b/cron/battle_save.php index 39fbd8c4..681c6d42 100644 --- a/cron/battle_save.php +++ b/cron/battle_save.php @@ -1,9 +1,6 @@ 0'); -?> diff --git a/cron/clear.php b/cron/clear.php index 22096cbf..759aed38 100644 --- a/cron/clear.php +++ b/cron/clear.php @@ -1,9 +1,6 @@ query($q) as $row) { diff --git a/cron/cron_clear.php b/cron/cron_clear.php index 942c23ce..efe1505c 100644 --- a/cron/cron_clear.php +++ b/cron/cron_clear.php @@ -3,7 +3,6 @@ define('GAME',true); setlocale(LC_CTYPE ,"ru_RU.CP1251"); include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); if( isset($_GET['actions']) ) { // @@ -141,7 +140,7 @@ while( $pl = mysql_fetch_array($sp) ) { //5. $i = 0; -$sp = mysql_query('SELECT * FROM `users` WHERE `real` = 0 ORDER BY `id` ASC LIMIT 100000'); +$sp = mysql_query('SELECT * FROM `users` WHERE `real` = 0 ORDER BY `id` LIMIT 100000'); while( $pl = mysql_fetch_array($sp) ) { $btl = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$pl['battle'].'" LIMIT 1')); $clon = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `inUser` = "'.$pl['id'].'" LIMIT 1')); @@ -159,9 +158,3 @@ mysql_query('DELETE FROM `items_users` WHERE `delete` > `time_create` AND `delet //6. mysql_query('DELETE FROM `users_delo` WHERE `time` < "'.(time()-86400*30).'" LIMIT 10000'); - -//echo '
    \: '.$i.'/'.$x.'
    '; -/*if( $i > 0 ) { - die(''); -}*/ -?> \ No newline at end of file diff --git a/cron/tom_check.php b/cron/tom_check.php index 9f085b90..befdaa7e 100644 --- a/cron/tom_check.php +++ b/cron/tom_check.php @@ -1,52 +1,30 @@ 10'); while( $pl = mysql_fetch_array($sp) ) { $test = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$pl['id'].'" LIMIT 1')); $userst = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$pl['id'].'" LIMIT 1')); - if($test['add_slot']>0) - { - - // echo ":".$userst['login']." :".$pl['priemslot']." :".$test['add_slot']."
    "; - - } - $kolvo = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `actions` WHERE `uid` ="'.$pl['id'].'" AND `vars` ="read"')); - + $kolvo = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `actions` WHERE `uid` ="'.$pl['id'].'" AND `vars` ="read"')); $overtop=$pl['priemslot']-10-$test['add_slot']-($kolvo['COUNT(*)']+1); - $overtopkorrect=$pl['priemslot']-10-$test['add_slot']; - - if($overtop>8) - { - $prevish = $overtop -8; - } else {$prevish =0;} - - if ($overtopkorrect>8){$overtopkorrect=8;} - + $prevish = $overtop > 8 ? $overtop - 8 : 0; + if ($overtopkorrect>8){$overtopkorrect=8;} $resultslot= 10 + $test['add_slot'] + $overtopkorrect; if($overtop>0) - { - + { + echo "!!! :".$userst['login']." :".$pl['priemslot']." :".$resultslot." :".$test['add_slot']." :".$kolvo['COUNT(*)']." :".$overtop." :".$prevish." :".$overtopkorrect."
    "; - + mysql_query('UPDATE `stats` SET `priemslot` = "'.$resultslot.'" WHERE `id` = "'.$pl['id'].'"'); - // mysql_query('UPDATE `stats` SET `priemslot` = "'.$resultslot.'" WHERE `id` = "'.$pl['id'].'"'); mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$pl['id'].'" AND `vars` = "read" '); - + if($overtopkorrect==5){$overtopkorrect=6;} - - if ($overtopkorrect==1) + + if ($overtopkorrect==1) { mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")'); } @@ -74,43 +52,39 @@ while( $pl = mysql_fetch_array($sp) ) { mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")'); - - - mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")'); + + + mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")'); } elseif ($overtopkorrect==7) { - + mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")'); - - + + mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4812")'); - + } elseif ($overtopkorrect==8) { - + mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")'); - - + + mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4812")'); mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4813")'); } - - - + + + echo "!!! :".$userst['login']." :".$resultslot." :".$test['add_slot']." :".$overtopkorrect."
    "; } } - - - -?> \ No newline at end of file diff --git a/cron_GAMECORE.php b/cron_GAMECORE.php index 632e8881..efc5239f 100644 --- a/cron_GAMECORE.php +++ b/cron_GAMECORE.php @@ -24,8 +24,8 @@ if(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' 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'); function e($t) { mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' ( ): '.mysql_real_escape_string($t).'","capitalcity","LEL","6","1","-1")'); diff --git a/cron_GoBattle.php b/cron_GoBattle.php index fcdabaef..7cc86a2b 100644 --- a/cron_GoBattle.php +++ b/cron_GoBattle.php @@ -1,61 +1,67 @@ '.$_SERVER['SERVER_ADDR']); +if (getIPblock() != $_SERVER['SERVER_ADDR'] && getIPblock() != '127.0.0.1' && getIPblock() != '' && getIPblock( + ) != '31.131.97.206') { + die(getIPblock() . '
    ' . $_SERVER['SERVER_ADDR']); } -define('GAME',true); +const GAME = true; include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); +$u = User::start(); -function e($t) { - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' ( ): '.mysql_real_escape_string($t).'","capitalcity","LEL","6","1","-1")'); +$sp = mysql_query( + 'SELECT `u`.*,`s`.*,`u`.`id`,`s`.`id` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON ( `s`.`id` = `u`.`id` AND `s`.`bot` = 0 ) WHERE `login` = "Crowley"' +); +while ($pl = mysql_fetch_array($sp)) { + if ($pl['inUser'] > 0 && $pl['inTurnir'] > 0) { + $txt = '! , !'; + mysql_query( + "INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $txt . "','" . time( + ) . "','6','0','1')" + ); + } + if ($pl['dnow'] > 0) { + // + mysql_query( + 'INSERT INTO `save_dungeon` (`x`,`y`,`dnow`,`time`,`uid`) VALUES ("' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dnow'] . '","' . time( + ) . '","' . $pl['id'] . '")' + ); + // + mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $pl['id'] . '"'); + mysql_query('UPDATE `users` SET `room` = "9",`battle` = "0" WHERE `id` = "' . $pl['id'] . '"'); + // + mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pl['id'] . '" AND `v1` = "priem" AND `delete` = "0"'); + mysql_query('DELETE FROM `battle` WHERE `id` = "' . $pl['battle'] . '"'); + mysql_query('DELETE FROM `battle_act` WHERE `battle` = "' . $pl['battle'] . '"'); + mysql_query( + 'DELETE FROM `battle_actions` WHERE `btl` = "' . $pl['battle'] . '" AND `uid` = "' . $pl['id'] . '"' + ); + mysql_query('DELETE FROM `battle_end` WHERE `battle_id` = "' . $pl['battle'] . '"'); + mysql_query('DELETE FROM `battle_last` WHERE `battle_id` = "' . $pl['battle'] . '"'); + mysql_query('DELETE FROM `battle_logs` WHERE `battle` = "' . $pl['battle'] . '"'); + mysql_query('DELETE FROM `battle_out` WHERE `battle` = "' . $pl['battle'] . '"'); + mysql_query('DELETE FROM `battle_stat` WHERE `battle` = "' . $pl['battle'] . '"'); + mysql_query('DELETE FROM `battle_users` WHERE `battle` = "' . $pl['battle'] . '"'); + } else { + $txt = '! 22:00 00:00! +100%, , !'; + mysql_query( + "INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $pl['city'] . "','','','','" . $txt . "','" . time( + ) . "','6','0','1')" + ); + } } - -$sp = mysql_query('SELECT `u`.*,`s`.*,`u`.`id`,`s`.`id` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON ( `s`.`id` = `u`.`id` AND `s`.`bot` = 0 ) WHERE `login` = "Crowley"'); - while($pl = mysql_fetch_array($sp)) { - if($pl['inUser'] > 0 && $pl['inTurnir'] > 0 ) { - $txt = '! , !'; - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$txt."','".time()."','6','0','1')"); - } - if($pl['dnow'] > 0 ) { - // - mysql_query('INSERT INTO `save_dungeon` (`x`,`y`,`dnow`,`time`,`uid`) VALUES ("'.$pl['x'].'","'.$pl['y'].'","'.$pl['dnow'].'","'.time().'","'.$pl['id'].'")'); - // - mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "'.$pl['id'].'"'); - mysql_query('UPDATE `users` SET `room` = "9",`battle` = "0" WHERE `id` = "'.$pl['id'].'"'); - // - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$pl['id'].'" AND `v1` = "priem" AND `delete` = "0"'); - mysql_query('DELETE FROM `battle` WHERE `id` = "'.$pl['battle'].'"'); - mysql_query('DELETE FROM `battle_act` WHERE `battle` = "'.$pl['battle'].'"'); - mysql_query('DELETE FROM `battle_actions` WHERE `btl` = "'.$pl['battle'].'" AND `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `battle_end` WHERE `battle_id` = "'.$pl['battle'].'"'); - mysql_query('DELETE FROM `battle_last` WHERE `battle_id` = "'.$pl['battle'].'"'); - mysql_query('DELETE FROM `battle_logs` WHERE `battle` = "'.$pl['battle'].'"'); - mysql_query('DELETE FROM `battle_out` WHERE `battle` = "'.$pl['battle'].'"'); - mysql_query('DELETE FROM `battle_stat` WHERE `battle` = "'.$pl['battle'].'"'); - mysql_query('DELETE FROM `battle_users` WHERE `battle` = "'.$pl['battle'].'"'); - }else{ - $txt = '! 22:00 00:00! +100%, , !'; - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$pl['city']."','','','','".$txt."','".time()."','6','0','1')"); - } -} -?> \ No newline at end of file diff --git a/cron_autozv.php b/cron_autozv.php deleted file mode 100644 index 5a41bfcc..00000000 --- a/cron_autozv.php +++ /dev/null @@ -1,40 +0,0 @@ -'.$_SERVER['SERVER_ADDR']); - } -} - -define('GAME',true); -setlocale(LC_CTYPE ,"ru_RU.CP1251"); -include('_incl_data/__config.php'); -include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/__magic.php'); - -// 2-3 -$inc = mysql_query('INSERT INTO `zayvki` ( - `comment`,`noatack`,`city`,`creator`,`type`,`time_start`,`timeout`,`min_lvl_1`,`min_lvl_2`,`max_lvl_1`,`max_lvl_2`,`noinc`,`razdel`,`time`,`fastfight`,`maxplayers` -) VALUES - -( "! ( )","1","capitalcity","0","51","300","120","8","8","8","8","1","5","'.time().'","0","30" ), -( "! ( )","1","capitalcity","0","51","300","120","8","8","21","21","1","5","'.time().'","0","30" ) - - -'); - -if($inc) { - echo 'true'; -}else{ - echo 'false'; -} -?> \ No newline at end of file diff --git a/cron_bot_core.php b/cron_bot_core.php index fd499856..534bb1b8 100644 --- a/cron_bot_core.php +++ b/cron_bot_core.php @@ -1,160 +1,139 @@

    ;)

    '); } -/* -if(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP() != '31.131.97.206' && !isset($_GET['robot'])) { - die(getIP().'
    '.$_SERVER['SERVER_ADDR']); -} -*/ + error_reporting(0); ini_set('display_errors', 'Off'); -define('GAME',true); +const GAME = true; -setlocale(LC_CTYPE ,"ru_RU.CP1251"); +setlocale(LC_CTYPE, "ru_RU.CP1251"); include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/bot.priem.php'); -include('_incl_data/class/bot.logic.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').' ( ): '.mysql_real_escape_string($t).'","capitalcity","","6","1","-1")'); -} - -function inuser_go_btl($id) { - if(isset($id['id'])) { - echo '[go]'; - echo file_get_contents('https://new-combats.com/jx/battle/refresh.php?uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass']); - } -} - -/*$sp = mysql_query('SELECT `id` FROM `users` WHERE `host_reg` = "real_bot_user" AND `login` != "delete" AND `banned` = "0" ORDER BY `online` DESC LIMIT 300'); -while($pl = mysql_fetch_array($sp)) { - botLogic::start( $pl['id'] ); -}*/ -//$sp = mysql_query('SELECT `u`.* , `s`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE ( /*( `s`.`bot` > 0 AND `u`.`battle` > 0 ) OR*/ `u`.`pass` = "saintlucia" ) ORDER BY `s`.`nextAct` ASC LIMIT 20'); -$ii=0; -while ($ii<6) +function inuser_go_btl($id) { -$count = array( - 0, - 0, - 0, - 0, - 0, - 0 -); -$sp = mysql_query('SELECT `u`.* , `s`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `u`.`pass` = "saintlucia" OR `u`.`no_ip` = "trupojor" ORDER BY `s`.`nextAct` ASC LIMIT 100'); -$btltest = array(); $btl_ref = array(); -while($pl = mysql_fetch_array($sp)) { - $i++; - if( $pl['zv'] > 0 ) { - $zv = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`razdel` FROM `zayvki` WHERE `id` = "'.$pl['zv'].'" AND `btl_id` = 0 LIMIT 1')); - if(!isset($zv['id']) || $zv['razdel'] != 5 ) { - $pl['zv'] = 0; - mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - if( $pl['battle'] == -1 ) { - mysql_query('UPDATE `users` SET `battle` = 0,`ipreg` = 0 WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $pl['battle'] = 0; - $pl['ipreg'] = 0; - } - if( date('i') == 5 || date('i') == 6 || date('i') == 15 || date('i') == 16 || date('i') == 25 || date('i') == 26 || date('i') == 35 || date('i') == 36 || date('i') == 45 ) { - if( $pl['zv'] == 0 ) { - mysql_query('UPDATE `users` SET `ipreg` = 0 WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - - if( (!isset($btltest2[$pl['battle']]) || $btltest2[$pl['battle']] == 0) && $pl['battle'] > 0) { - $btltest2[$pl['battle']]++; - echo '|'.$pl['battle'].'|'.$pl['id'].'|inBATTLE | '; - inuser_go_btl($pl); - echo '{!}'; - } - - if( $pl['zv'] == 0 && ($pl['battle'] == 0 || !isset($btltest[$pl['battle']]) || $btltest[$pl['battle']] < 1)) { - - $btltest[$pl['battle']]++; - - if( $pl['timereg'] == 0 ) { - mysql_query('UPDATE `users` SET `timereg` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }else{ - mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - if( $pl['exp'] > 400000 && $pl['level'] == 8 ) { - $pl['exp'] = 400000; - mysql_query('UPDATE `stats` SET `exp` = "400000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }elseif( $pl['exp'] > 3500000 && $pl['level'] == 9 ) { - $pl['exp'] = 3500000; - mysql_query('UPDATE `stats` SET `exp` = "3500000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }elseif( $pl['exp'] > 48000000 && $pl['level'] == 10 ) { - $pl['exp'] = 48000000; - mysql_query('UPDATE `stats` SET `exp` = "48000000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }elseif( $pl['exp'] > 148000000 && $pl['level'] == 11 ) { - $pl['exp'] = 148000000; - mysql_query('UPDATE `stats` SET `exp` = "148000000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }elseif( $pl['exp'] > 400000000 && $pl['level'] == 12 ) { - $pl['exp'] = 400000000; - mysql_query('UPDATE `stats` SET `exp` = "400000000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - if( $pl['bot'] == 0 ) { - mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - mysql_query('UPDATE `stats` SET `nextAct` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `online` = "'.time().'",`afk` = "" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - - botLogic::start( $pl['id'] ); - - //botLogic::e( $pl['battle'] .' -> '.$btltest[$pl['battle']] ); - }else{ - if( $pl['timereg'] == 0 ) { - mysql_query('UPDATE `users` SET `timereg` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }else{ - mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - if( $pl['exp'] > 400000 && $pl['level'] == 8 ) { - $pl['exp'] = 400000; - mysql_query('UPDATE `stats` SET `exp` = "400000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }elseif( $pl['exp'] > 3500000 && $pl['level'] == 9 ) { - $pl['exp'] = 3500000; - mysql_query('UPDATE `stats` SET `exp` = "3500000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }elseif( $pl['exp'] > 48000000 && $pl['level'] == 10 ) { - $pl['exp'] = 48000000; - mysql_query('UPDATE `stats` SET `exp` = "48000000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }elseif( $pl['exp'] > 148000000 && $pl['level'] == 11 ) { - $pl['exp'] = 148000000; - mysql_query('UPDATE `stats` SET `exp` = "148000000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }elseif( $pl['exp'] > 400000000 && $pl['level'] == 12 ) { - $pl['exp'] = 400000000; - mysql_query('UPDATE `stats` SET `exp` = "148000000" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - if( $pl['bot'] == 0 ) { - mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - mysql_query('UPDATE `stats` SET `nextAct` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } + if (isset($id['id'])) { + echo '[go]'; + echo file_get_contents( + 'https://new-combats.com/jx/battle/refresh.php?uid=' . $id['id'] . '&cron_core=' . md5( + $id['id'] . '_brfCOreW@!_' . $id['pass'] + ) . '&pass=' . $id['pass'] + ); + } } -$ii++; -echo 'TEST:'.$ii; -unset($btltest, $btl_ref, $btltest2); -sleep(4); +$ii = 0; +while ($ii < 6) { + $count = [0, 0, 0, 0, 0, 0]; + $sp = mysql_query( + 'SELECT `u`.* , `s`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `u`.`pass` = "saintlucia" OR `u`.`no_ip` = "trupojor" ORDER BY `s`.`nextAct` ASC LIMIT 100' + ); + $btltest = []; + $btl_ref = []; + while ($pl = mysql_fetch_array($sp)) { + $i++; + if ($pl['zv'] > 0) { + $zv = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`time`,`razdel` FROM `zayvki` WHERE `id` = "' . $pl['zv'] . '" AND `btl_id` = 0 LIMIT 1' + ) + ); + if (!isset($zv['id']) || $zv['razdel'] != 5) { + $pl['zv'] = 0; + mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + } + if ($pl['battle'] == -1) { + mysql_query('UPDATE `users` SET `battle` = 0,`ipreg` = 0 WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + $pl['battle'] = 0; + $pl['ipreg'] = 0; + } + if ((date('i') == 5 || date('i') == 6 || date('i') == 15 || date('i') == 16 || date('i') == 25 || date( + 'i' + ) == 26 || date('i') == 35 || date('i') == 36 || date('i') == 45) && $pl['zv'] == 0) { + mysql_query('UPDATE `users` SET `ipreg` = 0 WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + + if ((!isset($btltest2[$pl['battle']]) || $btltest2[$pl['battle']] == 0) && $pl['battle'] > 0) { + $btltest2[$pl['battle']]++; + echo '|' . $pl['battle'] . '|' . $pl['id'] . '|inBATTLE | '; + inuser_go_btl($pl); + echo '{!}'; + } + + if ($pl['zv'] == 0 && ($pl['battle'] == 0 || !isset($btltest[$pl['battle']]) || $btltest[$pl['battle']] < 1)) { + + $btltest[$pl['battle']]++; + + if ($pl['timereg'] == 0) { + mysql_query('UPDATE `users` SET `timereg` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } else { + mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + + if ($pl['exp'] > 400000 && $pl['level'] == 8) { + $pl['exp'] = 400000; + mysql_query('UPDATE `stats` SET `exp` = "400000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } elseif ($pl['exp'] > 3500000 && $pl['level'] == 9) { + $pl['exp'] = 3500000; + mysql_query('UPDATE `stats` SET `exp` = "3500000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } elseif ($pl['exp'] > 48000000 && $pl['level'] == 10) { + $pl['exp'] = 48000000; + mysql_query('UPDATE `stats` SET `exp` = "48000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } elseif ($pl['exp'] > 148000000 && $pl['level'] == 11) { + $pl['exp'] = 148000000; + mysql_query('UPDATE `stats` SET `exp` = "148000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } elseif ($pl['exp'] > 400000000 && $pl['level'] == 12) { + $pl['exp'] = 400000000; + mysql_query('UPDATE `stats` SET `exp` = "400000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + + if ($pl['bot'] == 0) { + mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + + mysql_query('UPDATE `stats` SET `nextAct` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `users` SET `online` = "' . time() . '",`afk` = "" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + + BotLogic::start($pl['id']); + + } else { + if ($pl['timereg'] == 0) { + mysql_query('UPDATE `users` SET `timereg` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } else { + mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + + if ($pl['exp'] > 400000 && $pl['level'] == 8) { + $pl['exp'] = 400000; + mysql_query('UPDATE `stats` SET `exp` = "400000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } elseif ($pl['exp'] > 3500000 && $pl['level'] == 9) { + $pl['exp'] = 3500000; + mysql_query('UPDATE `stats` SET `exp` = "3500000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } elseif ($pl['exp'] > 48000000 && $pl['level'] == 10) { + $pl['exp'] = 48000000; + mysql_query('UPDATE `stats` SET `exp` = "48000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } elseif ($pl['exp'] > 148000000 && $pl['level'] == 11) { + $pl['exp'] = 148000000; + mysql_query('UPDATE `stats` SET `exp` = "148000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } elseif ($pl['exp'] > 400000000 && $pl['level'] == 12) { + $pl['exp'] = 400000000; + mysql_query('UPDATE `stats` SET `exp` = "148000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + + if ($pl['bot'] == 0) { + mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + mysql_query('UPDATE `stats` SET `nextAct` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + } + + $ii++; + echo 'TEST:' . $ii; + unset($btltest, $btl_ref, $btltest2); + sleep(4); } -?> diff --git a/cron_bs.php b/cron_bs.php index 71f48971..ee95d5ba 100644 --- a/cron_bs.php +++ b/cron_bs.php @@ -27,9 +27,9 @@ if(getIPblock() != $_SERVER['SERVER_ADDR'] && getIPblock() != '127.0.0.1' && get define('GAME',true); setlocale(LC_CTYPE ,"ru_RU.CP1251"); -include('_incl_data/__config.php'); -include('_incl_data/class/__db_connect.php'); -//include('_incl_data/class/__user.php'); +require_once('_incl_data/__config.php'); +require_once('_incl_data/class/__db_connect.php'); +//require_once('_incl_data/class/__user.php'); function send($text) { return mysql_query('INSERT INTO `chat` (`new`,`type`,`to`,`text`,`time`) VALUES (1,6,"","'.$text.'",'.time().')'); diff --git a/cron_dungeon_getOut.php b/cron_dungeon_getOut.php index f16af60c..bee1fb3f 100644 --- a/cron_dungeon_getOut.php +++ b/cron_dungeon_getOut.php @@ -22,10 +22,10 @@ function getIPblock() { define('GAME', true); setlocale(LC_CTYPE ,"ru_RU.CP1251"); -include('_incl_data/__config.php'); -include('_incl_data/class/__db_connect.php'); -//include('_incl_data/class/__user.php'); -//include('_incl_data/class/__dungeon.php'); +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/__dungeon.php'); # . function start() { diff --git a/cron_dungeon_goBots.php b/cron_dungeon_goBots.php index 78e4e4a8..c244d9e0 100644 --- a/cron_dungeon_goBots.php +++ b/cron_dungeon_goBots.php @@ -3,158 +3,169 @@ # # - , -# IP -function getIP() { - if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP']; - return $_SERVER['REMOTE_ADDR']; -} - -# . -/*if( $_SERVER['HTTP_CF_CONNECTING_IP'] != $_SERVER['SERVER_ADDR'] && $_SERVER['HTTP_CF_CONNECTING_IP'] != '127.0.0.1' ) { die('Hello pussy!'); } -if(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP() != '5.187.7.71') { - die(getIP().'
    '.$_SERVER['SERVER_ADDR']); -}*/ - -define('GAME', true); -setlocale(LC_CTYPE ,"ru_RU.CP1251"); +const GAME = true; +setlocale(LC_CTYPE, "ru_RU.CP1251"); include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -//include('_incl_data/class/__dungeon.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').' ( ): '.mysql_real_escape_string($t).'","capitalcity","LEL","6","1","-1")'); -} # -> . -function botAttack ( $bot, $user ){ - if( $user['userBattle'] > 0 ) { - $battleID = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['userBattle'].'" AND `team_win` = "-1" LIMIT 1')); - } - if( !isset($battleID['id']) ) { // - $btl_id = 0; - $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` +function botAttack($bot, $user) +{ + if ($user['userBattle'] > 0) { + $battleID = mysql_fetch_array( + mysql_query( + 'SELECT `id` FROM `battle` WHERE `id` = "' . $user['userBattle'] . '" AND `team_win` = "-1" LIMIT 1' + ) + ); + } + if (!isset($battleID['id'])) { // + $btl_id = 0; + $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 ( - "'.$bot['dn_id'].'", - "'.$bot['this_dn'].'", - "'.$bot['x'].'", - "'.$bot['y'].'", - "'.$bot['userCity'].'", - "'.time().'", - "'.$btl['players'].'", - "'.$btl['timeout'].'", - "'.$btl['type'].'", - "'.$btl['invis'].'", - "'.$btl['noinc'].'", - "'.$btl['travmChance'].'", - "'.$btl['typeBattle'].'", - "'.$btl['addExp'].'", - "'.$btl['money'].'" + "' . $bot['dn_id'] . '", + "' . $bot['this_dn'] . '", + "' . $bot['x'] . '", + "' . $bot['y'] . '", + "' . $bot['userCity'] . '", + "' . time() . '", + "' . $btl['players'] . '", + "' . $btl['timeout'] . '", + "' . $btl['type'] . '", + "' . $btl['invis'] . '", + "' . $btl['noinc'] . '", + "' . $btl['travmChance'] . '", + "' . $btl['typeBattle'] . '", + "' . $btl['addExp'] . '", + "' . $btl['money'] . '" )' - ); - $btl_id = mysql_insert_id(); + ); + $btl_id = mysql_insert_id(); - if( $btl_id > 0 ) { // - $j = 0; - $logins_bot = array(); - mysql_query('UPDATE `dungeon_bots` SET `inBattle` = "'.$btl_id.'" WHERE `id2` = "'.$bot['id2'].'" LIMIT 1'); - $jui = 1; - while( $jui <= $bot['colvo'] ) { - $k = botAddBattle( $bot, $logins_bot ); - $logins_bot = $k['logins_bot']; - if( $k != false ) { - $upd = mysql_query('UPDATE `users` SET `battle` = "'.$btl_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++; - } - } - } - $jui++; - } - unset( $logins_bot ); - if( $j > 0 ) { - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$user['userId'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$user['userId'].'" LIMIT 1'); - } - } - } else { # . - $j = 0; - $logins_bot = array(); - $logins_bot_text =array(); - $logins_bot_vars =array('time1='.time().''); - $logins_bot_inBattle = mysql_query('SELECT SUBSTRING_INDEX(`login`, " (", 1) as login2, count(`login`) as count, `login` FROM `battle_users` WHERE `battle` = "'.$battleID['id'].'" AND `team`=2 GROUP BY `login2`'); - while($row = mysql_fetch_array($logins_bot_inBattle) ) { - $logins_bot[$row['login2']] = (int)$row['count']; - } - mysql_query('UPDATE `dungeon_bots` SET `inBattle` = "'.$battleID['id'].'" WHERE `id2` = "'.$bot['id2'].'" LIMIT 1'); - $jui = 1; - while( $jui <= $bot['colvo'] ) { - $k = botAddBattle( $bot, $logins_bot ); - $logins_bot = $k['logins_bot']; - - $logins_bot_text[] = ' '.$k['login'].''; - if( $k != false ) { - $upd = mysql_query('UPDATE `users` SET `battle` = "'.$battleID['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++; - } - } - } - $jui++; - } - if( $j > 0 ) { - $logins_bot_text = '{tm1} : '.implode(', ',$logins_bot_text).'.'; - $logins_bot_vars = implode('||',$logins_bot_vars); - $battle_log = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle`='.$battleID['id'].' ORDER BY `id_hod` DESC LIMIT 1')); - if( $battle_log['id_hod'] > 0 ) { - mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$battleID['id'].'","'.($battle_log['id_hod']+1).'","'.$logins_bot_text.'","'.$logins_bot_vars.'","","","","",1)'); - } - } - unset($logins_bot); - if( $j > 0 ) { - mysql_query('UPDATE `users` SET `battle` = "'.$battleID['id'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - } - unset($logins_bot_inBattle); - } + if ($btl_id > 0) { // + $j = 0; + $logins_bot = []; + mysql_query( + 'UPDATE `dungeon_bots` SET `inBattle` = "' . $btl_id . '" WHERE `id2` = "' . $bot['id2'] . '" LIMIT 1' + ); + $jui = 1; + while ($jui <= $bot['colvo']) { + $k = botAddBattle($bot, $logins_bot); + $logins_bot = $k['logins_bot']; + if ($k != false) { + $upd = mysql_query( + 'UPDATE `users` SET `battle` = "' . $btl_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++; + } + } + } + $jui++; + } + unset($logins_bot); + if ($j > 0) { + mysql_query( + 'UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $user['userId'] . '" LIMIT 1' + ); + mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "' . $user['userId'] . '" LIMIT 1'); + } + } + } else { # . + $j = 0; + $logins_bot = []; + $logins_bot_text = []; + $logins_bot_vars = ['time1=' . time() . '']; + $logins_bot_inBattle = mysql_query( + 'SELECT SUBSTRING_INDEX(`login`, " (", 1) as login2, count(`login`) as count, `login` FROM `battle_users` WHERE `battle` = "' . $battleID['id'] . '" AND `team`=2 GROUP BY `login2`' + ); + while ($row = mysql_fetch_array($logins_bot_inBattle)) { + $logins_bot[$row['login2']] = (int)$row['count']; + } + mysql_query( + 'UPDATE `dungeon_bots` SET `inBattle` = "' . $battleID['id'] . '" WHERE `id2` = "' . $bot['id2'] . '" LIMIT 1' + ); + $jui = 1; + while ($jui <= $bot['colvo']) { + $k = botAddBattle($bot, $logins_bot); + $logins_bot = $k['logins_bot']; + + $logins_bot_text[] = ' ' . $k['login'] . ''; + if ($k != false) { + $upd = mysql_query( + 'UPDATE `users` SET `battle` = "' . $battleID['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++; + } + } + } + $jui++; + } + if ($j > 0) { + $logins_bot_text = '{tm1} : ' . implode(', ', $logins_bot_text) . '.'; + $logins_bot_vars = implode('||', $logins_bot_vars); + $battle_log = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `battle_logs` WHERE `battle`=' . $battleID['id'] . ' ORDER BY `id_hod` DESC LIMIT 1' + ) + ); + if ($battle_log['id_hod'] > 0) { + mysql_query( + 'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time( + ) . '","' . $battleID['id'] . '","' . ($battle_log['id_hod'] + 1) . '","' . $logins_bot_text . '","' . $logins_bot_vars . '","","","","",1)' + ); + } + } + unset($logins_bot); + if ($j > 0) { + mysql_query( + 'UPDATE `users` SET `battle` = "' . $battleID['id'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1' + ); + mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + } + unset($logins_bot_inBattle); + } } # -> -function botAddBattle( $bot, $logins_bot ) { - $add_bot = mysql_fetch_array( - mysql_query('SELECT +function botAddBattle($bot, $logins_bot) +{ + $add_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` = "'.$bot['id_bot'].'" + WHERE `id` = "' . $bot['id_bot'] . '" LIMIT 1' - ) - ); - - if( isset($add_bot['id']) ) { - if( isset($logins_bot[$add_bot['login']]) ) { - $logins_bot[$add_bot['login']]++; - $add_bot['login'] = $add_bot['login'].' ('.$logins_bot[$add_bot['login']].')'; - } else { - $logins_bot[$add_bot['login']] = 1; - } - $ret = true; - if( $add_bot['time_reg'] == 100 ) { - $add_bot['time_reg'] = time(); - } - if( $add_bot['city_reg'] == '{thiscity}' ) { - $add_bot['city_reg'] = $bot['userCity']; - } - $ins1 = mysql_query('INSERT INTO `users` ( + ) + ); + + if (isset($add_bot['id'])) { + if (isset($logins_bot[$add_bot['login']])) { + $logins_bot[$add_bot['login']]++; + $add_bot['login'] = $add_bot['login'] . ' (' . $logins_bot[$add_bot['login']] . ')'; + } else { + $logins_bot[$add_bot['login']] = 1; + } + $ret = true; + if ($add_bot['time_reg'] == 100) { + $add_bot['time_reg'] = time(); + } + if ($add_bot['city_reg'] == '{thiscity}') { + $add_bot['city_reg'] = $bot['userCity']; + } + $ins1 = mysql_query( + 'INSERT INTO `users` ( `align`, `login`, `level`, @@ -169,179 +180,214 @@ function botAddBattle( $bot, $logins_bot ) { `obraz`, `bot_id` ) VALUES ( - "'.$add_bot['align'].'", - "'.$add_bot['login'].'", - "'.$add_bot['level'].'", - "'.md5('bot_pass_'.$add_bot['login'].'_').'", - "'.$bot['userCity'].'", - "'.$add_bot['city_reg'].'", - "'.$add_bot['name'].'", - "'.$add_bot['sex'].'", - "'.$add_bot['deviz'].'", - "'.$add_bot['hobby'].'", - "'.$add_bot['time_reg'].'", - "'.$add_bot['obraz'].'", - "'.$bot['id_bot'].'" - )'); - - # . - if( $ins1 ) { - $uid = mysql_insert_id(); - $ins2 = mysql_query('INSERT INTO `stats` (`id`,`stats`,`hpNow`,`upLevel`,`bot`) VALUES ("'.$uid.'","'.$add_bot['stats'].'","1000000","'.$add_bot['upLevel'].'","1")'); - if( $ins2 ) { - $add_bot['id'] = $uid; - $add_bot['logins_bot'] = $logins_bot; - $ret = $add_bot; - - // - //$this->addItem($item_id,$uid); - $iu = explode(',',$add_bot['itemsUse']); - $i = 0; - $w3b = 0; - while($i0) { - $idiu = botAddItem($iu[$i],$add_bot['id'], $bot['userCity']); - $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; - } - if( isset($idiu, $islot) ) mysql_query('UPDATE `items_users` SET `inOdet` = "'.$islot.'" WHERE `id` = "'.$idiu.'" LIMIT 1'); - } - $i++; - } - - }else{ - $ret = false; - } - }else{ - $ret = false; - } - return $ret; - } + "' . $add_bot['align'] . '", + "' . $add_bot['login'] . '", + "' . $add_bot['level'] . '", + "' . md5('bot_pass_' . $add_bot['login'] . '_') . '", + "' . $bot['userCity'] . '", + "' . $add_bot['city_reg'] . '", + "' . $add_bot['name'] . '", + "' . $add_bot['sex'] . '", + "' . $add_bot['deviz'] . '", + "' . $add_bot['hobby'] . '", + "' . $add_bot['time_reg'] . '", + "' . $add_bot['obraz'] . '", + "' . $bot['id_bot'] . '" + )' + ); + + # . + if ($ins1) { + $uid = mysql_insert_id(); + $ins2 = mysql_query( + 'INSERT INTO `stats` (`id`,`stats`,`hpNow`,`upLevel`,`bot`) VALUES ("' . $uid . '","' . $add_bot['stats'] . '","1000000","' . $add_bot['upLevel'] . '","1")' + ); + if ($ins2) { + $add_bot['id'] = $uid; + $add_bot['logins_bot'] = $logins_bot; + $ret = $add_bot; + + // + //$this->addItem($item_id,$uid); + $iu = explode(',', $add_bot['itemsUse']); + $i = 0; + $w3b = 0; + while ($i < count($iu)) { + if ($iu[$i] > 0) { + $idiu = botAddItem($iu[$i], $add_bot['id'], $bot['userCity']); + $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; + } + if (isset($idiu, $islot)) { + mysql_query( + 'UPDATE `items_users` SET `inOdet` = "' . $islot . '" WHERE `id` = "' . $idiu . '" LIMIT 1' + ); + } + } + $i++; + } + + } else { + $ret = false; + } + } else { + $ret = false; + } + return $ret; + } } # . -function botAddItem($item_id, $bot_uid, $city) { - $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($item_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']; - $ins = mysql_query(' +function botAddItem($item_id, $bot_uid, $city) +{ + $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( + $item_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']; + $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'].'", - "'.$bot_uid.'", - "'.$data.'", - "'.$i['iznosMAXi'].'", - "'.$i['geni'].'", - "'.$i['magic_inci'].'", - "'.$city.'", - "'.time().'", - "'.time().'", - "'.$i['dn_delete'].'" - )'); + "' . $i['overTypei'] . '", + "' . $i['id'] . '", + "' . $bot_uid . '", + "' . $data . '", + "' . $i['iznosMAXi'] . '", + "' . $i['geni'] . '", + "' . $i['magic_inci'] . '", + "' . $city . '", + "' . time() . '", + "' . time() . '", + "' . $i['dn_delete'] . '" + )' + ); - # . - if( $ins ){ - $rt = mysql_insert_id(); - # . - } else { - $rt = 0; - } - } - return $rt; + # . + if ($ins) { + $rt = mysql_insert_id(); + # . + } else { + $rt = 0; + } + } + return $rt; } -function moveBots($direction, $b){ - $toGoX = 0; - $toGoY = 0; - - if( isset($b['noBot']) && $b['noBot'] != '0000' ) { - if( $b['noBot'][0] != '0' ) $b['goTop'] = 0; - if( $b['noBot'][1] != '0' ) $b['goLeft'] = 0; - if( $b['noBot'][2] != '0' ) $b['goBottom'] = 0; - if( $b['noBot'][3] != '0' ) $b['goRight'] = 0; - } - $go = array( - 1 => array ('d'=>(int)$b['goTop'], 'go1'=>(int)$b['goLeft'], 'go2'=>(int)$b['goRight'], 'x' => (int)$b['x'], 'y' => (int)$b['y'], 's' => (int)$b['s']), - 2 => array ('d'=>(int)$b['goLeft'], 'go1'=>(int)$b['goBottom'], 'go2'=>(int)$b['goTop'], 'x' => (int)$b['x'], 'y' => (int)$b['y'], 's' => (int)$b['s']), - 3 => array ('d'=>(int)$b['goBottom'], 'go1'=>(int)$b['goRight'], 'go2'=>(int)$b['goLeft'], 'x' => (int)$b['x'], 'y' => (int)$b['y'], 's' => (int)$b['s']), - 4 => array ('d'=>(int)$b['goRight'], 'go1'=>(int)$b['goTop'], 'go2'=>(int)$b['goBottom'], 'x' => (int)$b['x'], 'y' => (int)$b['y'], 's' => (int)$b['s']) - ); - $dir = array( - 1 => array('moveForward' => array( 'x' => '0', 'y' => '1' ), 'moveBack' => array( 'x' => '0', 'y' => '-1' ),'moveGo1' => array( 'x' => '-1', 'y' => '0' ),'moveGo2' => array( 'x' => '1', 'y' => '0' )), - 2 => array('moveForward' => array( 'x' => '-1', 'y' => '0' ),'moveBack' => array( 'x' => '1', 'y' => '0' ),'moveGo1' => array( 'x' => '0', 'y' => '-1' ),'moveGo2' => array( 'x' => '0', 'y' => '1' )), - 3 => array('moveForward' => array( 'x' => '0', 'y' => '-1' ),'moveBack' => array( 'x' => '0', 'y' => '1' ),'moveGo1' => array( 'x' => '1', 'y' => '0' ),'moveGo2' => array( 'x' => '-1', 'y' => '0' )), - 4 => array('moveForward' => array( 'x' => '1', 'y' => '0' ),'moveBack' => array( 'x' => '-1', 'y' => '0' ),'moveGo1' => array( 'x' => '0', 'y' => '1' ),'moveGo2' => array( 'x' => '0', 'y' => '-1' )) - ); - $go = $go[$direction]; - $dir = $dir[$direction]; - if($go['d'] == 1 ) { - $toGoY = $dir['moveForward']['y']; - $toGoX = $dir['moveForward']['x']; - if(rand(1,100)>66){ - if( $go['go1'] ==1 && $go['go2'] == 0) { - $toGoY = $dir['moveGo1']['y']; - $toGoX = $dir['moveGo1']['x']; - } elseif( $go['go1'] ==0 && $go['go2'] == 1) { - $toGoY = $dir['moveGo2']['y']; - $toGoX = $dir['moveGo2']['x']; - } elseif( $go['go1'] ==1 && $go['go2'] == 1) { - $a = rand(1,2); - $toGoY = $dir['moveGo'.$a]['y']; - $toGoX = $dir['moveGo'.$a]['x']; - } - } elseif(rand(1,100)>96){ - $toGoY = $dir['moveBack']['y']; - $toGoX = $dir['moveBack']['x']; - } - } elseif( $go['d'] == 0 ) { - if( $go['go1'] ==1 && $go['go2'] == 1 ){ - if(rand(0,1) == 1) { - $toGoY = $dir['moveGo1']['y']; - $toGoX = $dir['moveGo1']['x']; - } else { - $toGoY = $dir['moveGo2']['y']; - $toGoX = $dir['moveGo2']['x']; - } - } elseif( $go['go1'] ==1 && $go['go2'] == 0 ) { - $toGoY = $dir['moveGo1']['y']; - $toGoX = $dir['moveGo1']['x']; - } elseif( $go['go1'] ==0 && $go['go2'] == 1 ) { - $toGoY = $dir['moveGo2']['y']; - $toGoX = $dir['moveGo2']['x']; - } elseif( $go['go1'] == 0 && $go['go2'] == 0 ){ - $toGoY = $dir['moveBack']['y']; - $toGoX = $dir['moveBack']['x']; - } - } - unset($dir, $go, $direction, $a); - return array( 'x'=>(int)$toGoX, 'y'=>(int)$toGoY ); + +function moveBots($direction, $b) +{ + $toGoX = 0; + $toGoY = 0; + + if (isset($b['noBot']) && $b['noBot'] != '0000') { + if ($b['noBot'][0] != '0') { + $b['goTop'] = 0; + } + if ($b['noBot'][1] != '0') { + $b['goLeft'] = 0; + } + if ($b['noBot'][2] != '0') { + $b['goBottom'] = 0; + } + if ($b['noBot'][3] != '0') { + $b['goRight'] = 0; + } + } + $go = [ + 1 => ['d' => (int)$b['goTop'], 'go1' => (int)$b['goLeft'], 'go2' => (int)$b['goRight'], 'x' => (int)$b['x'], 'y' => (int)$b['y'], 's' => (int)$b['s']], + 2 => ['d' => (int)$b['goLeft'], 'go1' => (int)$b['goBottom'], 'go2' => (int)$b['goTop'], 'x' => (int)$b['x'], 'y' => (int)$b['y'], 's' => (int)$b['s']], + 3 => ['d' => (int)$b['goBottom'], 'go1' => (int)$b['goRight'], 'go2' => (int)$b['goLeft'], 'x' => (int)$b['x'], 'y' => (int)$b['y'], 's' => (int)$b['s']], + 4 => ['d' => (int)$b['goRight'], 'go1' => (int)$b['goTop'], 'go2' => (int)$b['goBottom'], 'x' => (int)$b['x'], 'y' => (int)$b['y'], 's' => (int)$b['s']], + ]; + $dir = [ + 1 => ['moveForward' => ['x' => '0', 'y' => '1'], 'moveBack' => ['x' => '0', 'y' => '-1'], 'moveGo1' => ['x' => '-1', 'y' => '0'], 'moveGo2' => ['x' => '1', 'y' => '0']], + 2 => ['moveForward' => ['x' => '-1', 'y' => '0'], 'moveBack' => ['x' => '1', 'y' => '0'], 'moveGo1' => ['x' => '0', 'y' => '-1'], 'moveGo2' => ['x' => '0', 'y' => '1']], + 3 => ['moveForward' => ['x' => '0', 'y' => '-1'], 'moveBack' => ['x' => '0', 'y' => '1'], 'moveGo1' => ['x' => '1', 'y' => '0'], 'moveGo2' => ['x' => '-1', 'y' => '0']], + 4 => ['moveForward' => ['x' => '1', 'y' => '0'], 'moveBack' => ['x' => '-1', 'y' => '0'], 'moveGo1' => ['x' => '0', 'y' => '1'], 'moveGo2' => ['x' => '0', 'y' => '-1']], + ]; + $go = $go[$direction]; + $dir = $dir[$direction]; + if ($go['d'] == 1) { + $toGoY = $dir['moveForward']['y']; + $toGoX = $dir['moveForward']['x']; + if (rand(1, 100) > 66) { + if ($go['go1'] == 1 && $go['go2'] == 0) { + $toGoY = $dir['moveGo1']['y']; + $toGoX = $dir['moveGo1']['x']; + } elseif ($go['go1'] == 0 && $go['go2'] == 1) { + $toGoY = $dir['moveGo2']['y']; + $toGoX = $dir['moveGo2']['x']; + } elseif ($go['go1'] == 1 && $go['go2'] == 1) { + $a = rand(1, 2); + $toGoY = $dir['moveGo' . $a]['y']; + $toGoX = $dir['moveGo' . $a]['x']; + } + } elseif (rand(1, 100) > 96) { + $toGoY = $dir['moveBack']['y']; + $toGoX = $dir['moveBack']['x']; + } + } elseif ($go['d'] == 0) { + if ($go['go1'] == 1 && $go['go2'] == 1) { + if (rand(0, 1) == 1) { + $toGoY = $dir['moveGo1']['y']; + $toGoX = $dir['moveGo1']['x']; + } else { + $toGoY = $dir['moveGo2']['y']; + $toGoX = $dir['moveGo2']['x']; + } + } elseif ($go['go1'] == 1 && $go['go2'] == 0) { + $toGoY = $dir['moveGo1']['y']; + $toGoX = $dir['moveGo1']['x']; + } elseif ($go['go1'] == 0 && $go['go2'] == 1) { + $toGoY = $dir['moveGo2']['y']; + $toGoX = $dir['moveGo2']['x']; + } elseif ($go['go1'] == 0 && $go['go2'] == 0) { + $toGoY = $dir['moveBack']['y']; + $toGoX = $dir['moveBack']['x']; + } + } + unset($dir, $go, $direction, $a); + return ['x' => (int)$toGoX, 'y' => (int)$toGoY]; } # . -function start(){ - # 0.0000 - $mtime = microtime();$mtime = explode(" ",$mtime);$tstart = $mtime[1] + $mtime[0]; +function start() +{ + # 0.0000 + $mtime = microtime(); + $mtime = explode(" ", $mtime); + $tstart = $mtime[1] + $mtime[0]; - # . - # : , , , . - $query = mysql_query( - "SELECT + # . + # : , , , . + $query = mysql_query( + "SELECT `dn`.`id` as `this_dn`, `dn`.`id2` as `dn_id`, `db`.`id2`, `db`.`id_bot`, `tb`.`login` as login, `db`.`colvo`, `db`.`go_bot`, `db`.`x`, `db`.`y`, `db`.`s`, `db`.`atack`, `tb`.`agressor`, `dm`.`go_1` as `goRight`, `dm`.`go_2` as `goLeft`, `dm`.`go_3` as `goTop`, `dm`.`go_4` as `goBottom`, `dm`.`no_bot` as `noBot`, `user_info`.`id` as `userId`, @@ -362,66 +408,73 @@ function start(){ `db`.`atack` = '0' AND `db`.`delete` = '0' AND `db`.`for_dn` = '0' AND - ( ( `db`.`go_bot` > '".(time()-32400)."' AND `db`.`go_bot` < '".(time())."') OR `db`.`go_bot`='1') AND + ( ( `db`.`go_bot` > '" . (time() - 32400) . "' AND `db`.`go_bot` < '" . (time()) . "') OR `db`.`go_bot`='1') AND `db`.`inBattle`='0' GROUP BY `db`.`id2` ORDER BY `db`.`go_bot` ASC" - ); - - while( $bot = mysql_fetch_array( $query ) ) { - if( $bot['go_bot'] > 0 && $bot['go_bot'] <= time() ) { - $sNext = true; - $sTo=$bot['s']; - $xFrom = $bot['x']; # X - $yFrom = $bot['y']; # Y + ); - $return = moveBots($bot['s'],$bot); - $xTo = $bot['x']+$return['x']; - $yTo = $bot['y']+$return['y']; - # , . - $inSight = 0; - if( isset($bot['id2']) ) { - if($xFrom==$xTo && $yFrom==$yTo) { # . - $inSight = 1; - } elseif( isset($bot['goRight']) && $xFrom == $xTo-1 && $bot['goRight'] == 1 ) { // - $sTo=4; - $inSight = 1; - } elseif( isset($bot['goLeft']) && $xFrom == $xTo+1 && $bot['goLeft'] == 1 ) { // - $sTo=2; - $inSight = 1; - } elseif( isset($bot['goTop']) && $yFrom == $yTo-1 && $bot['goTop'] == 1 ) { // - $sTo=1; - $inSight = 1; - } elseif( isset($bot['goBottom']) && $yFrom == $yTo+1 && $bot['goBottom'] == 1 ) { // - $sTo=3; - $inSight = 1; - } - } - - if( isset($bot['userId'],$bot['userPosY'],$bot['userPosX']) && $bot['userId'] != '' && $bot['agressor']==1 && ( - ($bot['userPosY']==$bot['y']+1 && $bot['userPosX']==$bot['x']) OR - ($bot['userPosY']==$bot['y']-1 && $bot['userPosX']==$bot['x']) OR - ($bot['userPosY']==$bot['y'] && $bot['userPosX']==$bot['x']-1) OR - ($bot['userPosY']==$bot['y'] && $bot['userPosX']==$bot['x']+1) - ) ) { - bot['userPosY']=$yFrom; $bot['userPosX']=$xFrom; - mysql_query('UPDATE `stats` SET `x` = "'.$xFrom.'" , `y` = "'.$yFrom.'" WHERE `id` = "'.$bot['userId'].'" LIMIT 1'); - botAttack($bot,$bot); - } elseif( isset($bot['userId'],$bot['userPosY'],$bot['userPosX']) && $bot['userId'] != '' && $inSight == 1 && $yTo == $bot['userPosY'] && $xTo == $bot['userPosX'] && $bot['atack']==1) { - botAttack($bot,$bot); - } elseif( $inSight == 1 ) { // . - $bot['go_bot'] = time()+rand(7,15); - mysql_query('UPDATE `dungeon_bots` SET `x` = "'.$xTo.'",`y` = "'.$yTo.'", `s` = "'.$sTo.'", `go_bot` = "'.$bot['go_bot'].'" WHERE `id2` = "'.$bot['id2'].'" LIMIT 1 '); - } - unset($xFrom,$yFrom,$xTo,$yTo,$inSight,$sNext,$sTo); - } - unset($bot); - } - unset($query,$bot); - - $mtime = microtime(); - $mtime = explode(" ",$mtime);$mtime = $mtime[1] + $mtime[0];$totaltime = ($mtime - $tstart); - printf (" %f !", $totaltime); + while ($bot = mysql_fetch_array($query)) { + if ($bot['go_bot'] > 0 && $bot['go_bot'] <= time()) { + $sNext = true; + $sTo = $bot['s']; + $xFrom = $bot['x']; # X + $yFrom = $bot['y']; # Y + + $return = moveBots($bot['s'], $bot); + $xTo = $bot['x'] + $return['x']; + $yTo = $bot['y'] + $return['y']; + # , . + $inSight = 0; + if (isset($bot['id2'])) { + if ($xFrom == $xTo && $yFrom == $yTo) { # . + $inSight = 1; + } elseif (isset($bot['goRight']) && $xFrom == $xTo - 1 && $bot['goRight'] == 1) { // + $sTo = 4; + $inSight = 1; + } elseif (isset($bot['goLeft']) && $xFrom == $xTo + 1 && $bot['goLeft'] == 1) { // + $sTo = 2; + $inSight = 1; + } elseif (isset($bot['goTop']) && $yFrom == $yTo - 1 && $bot['goTop'] == 1) { // + $sTo = 1; + $inSight = 1; + } elseif (isset($bot['goBottom']) && $yFrom == $yTo + 1 && $bot['goBottom'] == 1) { // + $sTo = 3; + $inSight = 1; + } + } + + if (isset($bot['userId'], $bot['userPosY'], $bot['userPosX']) && $bot['userId'] != '' && $bot['agressor'] == 1 && ( + ($bot['userPosY'] == $bot['y'] + 1 && $bot['userPosX'] == $bot['x']) or + ($bot['userPosY'] == $bot['y'] - 1 && $bot['userPosX'] == $bot['x']) or + ($bot['userPosY'] == $bot['y'] && $bot['userPosX'] == $bot['x'] - 1) or + ($bot['userPosY'] == $bot['y'] && $bot['userPosX'] == $bot['x'] + 1) + )) { + bot['userPosY'] = $yFrom; + $bot['userPosX'] = $xFrom; + mysql_query( + 'UPDATE `stats` SET `x` = "' . $xFrom . '" , `y` = "' . $yFrom . '" WHERE `id` = "' . $bot['userId'] . '" LIMIT 1' + ); + botAttack($bot, $bot); + } elseif (isset($bot['userId'], $bot['userPosY'], $bot['userPosX']) && $bot['userId'] != '' && $inSight == 1 && $yTo == $bot['userPosY'] && $xTo == $bot['userPosX'] && $bot['atack'] == 1) { + botAttack($bot, $bot); + } elseif ($inSight == 1) { // . + $bot['go_bot'] = time() + rand(7, 15); + mysql_query( + 'UPDATE `dungeon_bots` SET `x` = "' . $xTo . '",`y` = "' . $yTo . '", `s` = "' . $sTo . '", `go_bot` = "' . $bot['go_bot'] . '" WHERE `id2` = "' . $bot['id2'] . '" LIMIT 1 ' + ); + } + unset($xFrom, $yFrom, $xTo, $yTo, $inSight, $sNext, $sTo); + } + unset($bot); + } + unset($query, $bot); + + $mtime = microtime(); + $mtime = explode(" ", $mtime); + $mtime = $mtime[1] + $mtime[0]; + $totaltime = ($mtime - $tstart); + printf(" %f !", $totaltime); } # . diff --git a/cron_dungeon_save.php b/cron_dungeon_save.php index a4d99af3..1d7ae9a7 100644 --- a/cron_dungeon_save.php +++ b/cron_dungeon_save.php @@ -1,42 +1,19 @@ '.$_SERVER['SERVER_ADDR']); -}*/ - - -define('GAME',true); +const GAME = true; include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.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').' ( ): '.mysql_real_escape_string($t).'","capitalcity","LEL","6","1","-1")'); +$sp = mysql_query( + 'SELECT `u`.*,`s`.*,`u`.`id`,`s`.`id` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON ( `s`.`id` = `u`.`id` AND `s`.`bot` = 0 ) WHERE `login` = "Crowley"' +); +while ($pl = mysql_fetch_array($sp)) { + $last_dnow = mysql_fetch_array(mysql_query('SELECT * FROM `save_dungeon` WHERE `uid` = "' . $pl['id'] . '"')); + if (isset($last_dnow['id'])) { + mysql_query('UPDATE `users` SET `room` = "405" WHERE `id` = "' . $last_dnow['uid'] . '"'); + mysql_query( + 'UPDATE `stats` SET `dnow` = "' . $last_dnow['dnow'] . '",`x` = "' . $last_dnow['x'] . '",`y` = "' . $last_dnow['y'] . '" WHERE `id` = "' . $last_dnow['uid'] . '"' + ); + } } - -$sp = mysql_query('SELECT `u`.*,`s`.*,`u`.`id`,`s`.`id` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON ( `s`.`id` = `u`.`id` AND `s`.`bot` = 0 ) WHERE `login` = "Crowley"'); - while($pl = mysql_fetch_array($sp)) { - $last_dnow = mysql_fetch_array(mysql_query('SELECT * FROM `save_dungeon` WHERE `uid` = "'.$pl['id'].'"')); - if(isset($last_dnow['id'])) { - mysql_query('UPDATE `users` SET `room` = "405" WHERE `id` = "'.$last_dnow['uid'].'"'); - mysql_query('UPDATE `stats` SET `dnow` = "'.$last_dnow['dnow'].'",`x` = "'.$last_dnow['x'].'",`y` = "'.$last_dnow['y'].'" WHERE `id` = "'.$last_dnow['uid'].'"'); - } -} -?> \ No newline at end of file diff --git a/cron_h.php b/cron_h.php index 2a02a0e0..80e4a09d 100644 --- a/cron_h.php +++ b/cron_h.php @@ -23,8 +23,8 @@ if(getIPblock() != $_SERVER['SERVER_ADDR'] && getIPblock() != '127.0.0.1' && get 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'); function e($t) { mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' ( ): '.mysql_real_escape_string($t).'","capitalcity","ENERGY STAR","6","1","-1")'); diff --git a/cron_killusers.php b/cron_killusers.php index 21708c1d..4aef3587 100644 --- a/cron_killusers.php +++ b/cron_killusers.php @@ -2,196 +2,222 @@ die('- ...'); -function getIP() { - if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP']; - return $_SERVER['REMOTE_ADDR']; +function getIP() +{ + return getIPblock(); } # IP -function getIPblock() { - if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP']; - return $_SERVER['REMOTE_ADDR']; +function getIPblock() +{ + return isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR']; } # . -if( $_SERVER['HTTP_CF_CONNECTING_IP'] != $_SERVER['SERVER_ADDR'] && $_SERVER['HTTP_CF_CONNECTING_IP'] != '127.0.0.1' ) { die('Hello pussy!'); } -if(getIPblock() != $_SERVER['SERVER_ADDR'] && getIPblock() != '127.0.0.1' && getIPblock() != '' && getIPblock() != '5.187.7.71') { - die(getIPblock().'
    '.$_SERVER['SERVER_ADDR']); +if ($_SERVER['HTTP_CF_CONNECTING_IP'] != $_SERVER['SERVER_ADDR'] && $_SERVER['HTTP_CF_CONNECTING_IP'] != '127.0.0.1') { + die('Hello pussy!'); +} +if (getIPblock() != $_SERVER['SERVER_ADDR'] && getIPblock() != '127.0.0.1' && getIPblock() != '' && getIPblock( + ) != '5.187.7.71') { + die(getIPblock() . '
    ' . $_SERVER['SERVER_ADDR']); } -define('GAME',true); +const GAME = true; include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.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').' ( ): '.mysql_real_escape_string($t).'","capitalcity","LEL","6","1","-1")'); +function e($t) +{ + mysql_query( + 'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #' . date('d.m.Y') . ' %' . date( + 'H:i:s' + ) . ' ( ): ' . mysql_real_escape_string($t) . '","capitalcity","LEL","6","1","-1")' + ); } -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")'); +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 => 90, - 9 => 90, - 10 => 90, - 11 => 90, - 12 => 90, - 13 => 90, - 14 => 90, - 15 => 90, - 16 => 90, - 17 => 90, - 18 => 90, - 19 => 90, - 20 => 90, - 21 => 90 -); +$kp = [ + 0 => 1, + 1 => 1, + 2 => 3, + 3 => 3, + 4 => 3, + 5 => 7, + 6 => 7, + 7 => 7, + 8 => 90, + 9 => 90, + 10 => 90, + 11 => 90, + 12 => 90, + 13 => 90, + 14 => 90, + 15 => 90, + 16 => 90, + 17 => 90, + 18 => 90, + 19 => 90, + 20 => 90, + 21 => 90, +]; -function addUser($userData) { - $query = "INSERT INTO `users_kill` ( ". - mysql_real_escape_string(implode(' , ', array_keys($userData))). - " ) VALUES ( '". - (implode("' , '", $userData)). - "' )"; +function addUser($userData) +{ + $query = "INSERT INTO `users_kill` ( " . + mysql_real_escape_string(implode(' , ', array_keys($userData))) . + " ) VALUES ( '" . + (implode("' , '", $userData)) . + "' )"; - return $query; + return $query; } // ( ) -mysql_query('DELETE FROM `eff_users` WHERE `delete` > "1392211522" AND `delete` < "'.time().'"'); -mysql_query('DELETE FROM `items_users` WHERE `delete` > "1392211522" AND `delete` < "'.time().'"'); +mysql_query('DELETE FROM `eff_users` WHERE `delete` > "1392211522" AND `delete` < "' . time() . '"'); +mysql_query('DELETE FROM `items_users` WHERE `delete` > "1392211522" AND `delete` < "' . time() . '"'); $lvl = 0; -while( $lvl <= 21 ) { - $last_time = round( time() - ( 2 * $kp[$lvl] * 86400 ) ); - $sp = mysql_query('SELECT `u`.*,`s`.*,`u`.`id` AS `id1`,`s`.`id` AS `id2` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON ( `s`.`id` = `u`.`id` AND `s`.`bot` = 0 ) WHERE `u`.`admin` = 0 AND `u`.`pass` != "" AND `u`.`no_ip` = "" AND `u`.`level` = "'.$lvl.'" AND `align` != 50 AND `u`.`online` < '.$last_time.' LIMIT 1000'); - while($pl = mysql_fetch_array($sp)) { - - if( $pl['id'] < 1 ) { - if( $pl['id1'] > 0 ) { - $pl['id'] = $pl['id1']; - }elseif( $pl['id2'] > 0 ) { - $pl['id'] = $pl['id2']; - } - } - - // - $pl['bank'] = mysql_fetch_array(mysql_query('SELECT SUM(`money1`),SUM(`money2`) FROM `bank` WHERE `uid` = "'.$pl['id'].'" LIMIT 1')); - $pl['money'] += $pl['bank'][0]; - $pl['money2'] += $pl['bank'][1]; - $sitm = mysql_query('SELECT `id`,`item_id`,`1price`,`2price` FROM `items_users` WHERE (`delete` = 1000 OR `delete` = 0) AND `delete` = "0" AND `data` NOT LIKE "%|frompisher=%" AND `uid` = "'.$pl['id'].'"'); - while($pitm = mysql_fetch_array($sitm)) { - if( $pitm['1price'] != 0 ) { - $pl['money'] += $pitm['1price']; - }elseif( $pitm['2price'] != 0 ) { - $pl['money'] += $pitm['2price']; - }else{ - $pitems = mysql_fetch_array(mysql_query('SELECT `price1`,`price2` FROM `items_main` WHERE `id` = "'.$sitm['item_id'].'" LIMIT 1')); - if( $pitems['price2'] > 0 ) { - $pl['money'] += $pitems['price2']; - }else{ - $pl['money2'] += $pitems['price1']; - } - } - } - if($pl['id'] > 0) { - // - mysql_query('DELETE FROM `aaa_znahar` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `add_smiles` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `a_com_act` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `a_noob` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `a_system` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `a_vaucher` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `a_vaucher_active` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `bank` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `bank_alh` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `battle_actions` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `battle_cache` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `bid` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `bs_actions` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `bs_zv` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `complects_priem` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `dump` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `dungeon_actions` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `dungeon_now` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `dungeon_zv` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `feerverks` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `fontan` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `fontan_hp` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `friends` WHERE `user` = "'.$pl['id'].'" OR `friend` = "'.$pl['id'].'" OR `enemy` = "'.$pl['id'].'" OR `notinlist` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `house` WHERE `owner` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `items_img` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `izlom_rating` WHERE `uid` = "'.$pl['id'].'"'); - //mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `online` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `post` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `reimage` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `rep` WHERE `id` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `repass` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `ruletka_coin` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `save_com` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `stats` WHERE `id` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `telegram` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `transfers` WHERE `uid1` = "'.$pl['id'].'" OR `uid2` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `users` WHERE `id` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `users_animal` WHERE `uid` = "'.$pl['id'].'"'); - //mysql_query('DELETE FROM `users_delo` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `users_ico` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `users_turnirs` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `zayvki` WHERE `uid` = "'.$pl['id'].'"'); - mysql_query('DELETE FROM `_clan` WHERE `uid` = "'.$pl['id'].'"'); - echo '•'.$pl['login'].'
    '; - } - - // - $usrData = array( - '`uid`' => $pl['id'], - '`money1`' => $pl['money'], - '`money2`' => $pl['money2'], - '`money4`' => $pl['money4'], - '`ip`' => $pl['ip'], - '`timereg`' => $pl['timereg'], - '`ipreg`' => $pl['ipreg'], - '`sex`' => $pl['sex'], - '`login`' => $pl['login'], - '`pass`' => $pl['pass'], - '`mail`' => $pl['mail'], - '`level`' => $pl['level'], - '`exp`' => $pl['exp'], - '`online`' => $pl['online'], - '`time_kill`' => time(), - '`align`' => $pl['align'], - '`clan`' => $pl['clan'], - '`banned`' => $pl['banned'], - '`win`' => $pl['win'], - '`lose`' => $pl['lose'], - '`nich`' => $pl['nich'], - '`marry`' => $pl['marry'], - '`send`' => $pl['send'], - '`activ`' => $pl['activ'], - '`name`' => $pl['name'], - '`obraz`' => $pl['obraz'], - '`bithday`' => $pl['bithday'], - '`host_reg`' => $pl['host_reg'] - ); - mysql_query(addUser($usrData)); - } - $lvl++; +while ($lvl <= 21) { + $last_time = round(time() - (2 * $kp[$lvl] * 86400)); + $sp = mysql_query( + 'SELECT `u`.*,`s`.*,`u`.`id` AS `id1`,`s`.`id` AS `id2` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON ( `s`.`id` = `u`.`id` AND `s`.`bot` = 0 ) WHERE `u`.`admin` = 0 AND `u`.`pass` != "" AND `u`.`no_ip` = "" AND `u`.`level` = "' . $lvl . '" AND `align` != 50 AND `u`.`online` < ' . $last_time . ' LIMIT 1000' + ); + while ($pl = mysql_fetch_array($sp)) { + + if ($pl['id'] < 1) { + if ($pl['id1'] > 0) { + $pl['id'] = $pl['id1']; + } elseif ($pl['id2'] > 0) { + $pl['id'] = $pl['id2']; + } + } + + // + $pl['bank'] = mysql_fetch_array( + mysql_query('SELECT SUM(`money1`),SUM(`money2`) FROM `bank` WHERE `uid` = "' . $pl['id'] . '" LIMIT 1') + ); + $pl['money'] += $pl['bank'][0]; + $pl['money2'] += $pl['bank'][1]; + $sitm = mysql_query( + 'SELECT `id`,`item_id`,`1price`,`2price` FROM `items_users` WHERE (`delete` = 1000 OR `delete` = 0) AND `delete` = "0" AND `data` NOT LIKE "%|frompisher=%" AND `uid` = "' . $pl['id'] . '"' + ); + while ($pitm = mysql_fetch_array($sitm)) { + if ($pitm['1price'] != 0) { + $pl['money'] += $pitm['1price']; + } elseif ($pitm['2price'] != 0) { + $pl['money'] += $pitm['2price']; + } else { + $pitems = mysql_fetch_array( + mysql_query( + 'SELECT `price1`,`price2` FROM `items_main` WHERE `id` = "' . $sitm['item_id'] . '" LIMIT 1' + ) + ); + if ($pitems['price2'] > 0) { + $pl['money'] += $pitems['price2']; + } else { + $pl['money2'] += $pitems['price1']; + } + } + } + if ($pl['id'] > 0) { + // + mysql_query('DELETE FROM `aaa_znahar` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `actions` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `add_smiles` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `a_com_act` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `a_noob` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `a_system` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `a_vaucher` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `a_vaucher_active` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `bank` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `bank_alh` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `battle_actions` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `battle_cache` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `bid` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `bs_actions` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `bs_zv` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `complects_priem` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `dump` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `dungeon_actions` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `dungeon_now` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `dungeon_zv` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `feerverks` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `fontan` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `fontan_hp` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query( + 'DELETE FROM `friends` WHERE `user` = "' . $pl['id'] . '" OR `friend` = "' . $pl['id'] . '" OR `enemy` = "' . $pl['id'] . '" OR `notinlist` = "' . $pl['id'] . '"' + ); + mysql_query('DELETE FROM `house` WHERE `owner` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `items_img` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `izlom_rating` WHERE `uid` = "' . $pl['id'] . '"'); + //mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$pl['id'].'"'); + mysql_query('DELETE FROM `online` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `post` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `reimage` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `rep` WHERE `id` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `repass` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `ruletka_coin` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `save_com` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `stats` WHERE `id` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `telegram` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `transfers` WHERE `uid1` = "' . $pl['id'] . '" OR `uid2` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `users` WHERE `id` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `users_animal` WHERE `uid` = "' . $pl['id'] . '"'); + //mysql_query('DELETE FROM `users_delo` WHERE `uid` = "'.$pl['id'].'"'); + mysql_query('DELETE FROM `users_ico` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `users_turnirs` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `zayvki` WHERE `uid` = "' . $pl['id'] . '"'); + mysql_query('DELETE FROM `_clan` WHERE `uid` = "' . $pl['id'] . '"'); + echo '•' . $pl['login'] . '
    '; + } + + // + $usrData = [ + '`uid`' => $pl['id'], + '`money1`' => $pl['money'], + '`money2`' => $pl['money2'], + '`money4`' => $pl['money4'], + '`ip`' => $pl['ip'], + '`timereg`' => $pl['timereg'], + '`ipreg`' => $pl['ipreg'], + '`sex`' => $pl['sex'], + '`login`' => $pl['login'], + '`pass`' => $pl['pass'], + '`mail`' => $pl['mail'], + '`level`' => $pl['level'], + '`exp`' => $pl['exp'], + '`online`' => $pl['online'], + '`time_kill`' => time(), + '`align`' => $pl['align'], + '`clan`' => $pl['clan'], + '`banned`' => $pl['banned'], + '`win`' => $pl['win'], + '`lose`' => $pl['lose'], + '`nich`' => $pl['nich'], + '`marry`' => $pl['marry'], + '`send`' => $pl['send'], + '`activ`' => $pl['activ'], + '`name`' => $pl['name'], + '`obraz`' => $pl['obraz'], + '`bithday`' => $pl['bithday'], + '`host_reg`' => $pl['host_reg'], + ]; + mysql_query(addUser($usrData)); + } + $lvl++; } -?> \ No newline at end of file diff --git a/cron_prizhaot.php b/cron_prizhaot.php index cdc4133b..1403ae40 100644 --- a/cron_prizhaot.php +++ b/cron_prizhaot.php @@ -1,39 +1,31 @@ '.$_SERVER['SERVER_ADDR']); - } +if (!isset($_GET['tests']) && getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP( + ) != '51.89.6.100') { + exit(getIP() . '
    ' . $_SERVER['SERVER_ADDR']); } -define('GAME',true); -setlocale(LC_CTYPE ,"ru_RU.CP1251"); -include('_incl_data/__config.php'); +const GAME = true; +setlocale(LC_CTYPE, "ru_RU.CP1251"); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/__magic.php'); - // () 8-11 -$inc = mysql_query('INSERT INTO `zayvki` (`comment`,`arand`,`noatack`,`city`,`creator`,`type`,`time_start`,`timeout`,`min_lvl_1`,`min_lvl_2`,`max_lvl_1`,`max_lvl_2`,`noinc`,`razdel`,`time`,`fastfight`,`priz`,`cancel`,`maxplayers`,`tm1max`,`tm2max`) -VALUES ("!
    ","1","1","capitalcity","0","33","300","180","8","8","12","12","1","5","'.time().'","1","1","0","40","0","0")'); +$inc = $pdo->prepare( + 'insert into zayvki (`comment`,`arand`,`noatack`,`city`,`creator`,`type`,`time_start`,`timeout`,`min_lvl_1`,`min_lvl_2`,`max_lvl_1`,`max_lvl_2`,`noinc`,`razdel`,`time`,`fastfight`,`priz`,`maxplayers`,`tm1max`,`tm2max`) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,unix_timestamp(),?,?,?,?,?)' +)->execute( + [ + "! ", + 1, 1, 'capitalcity', 0, 33, 300, 180, 8, 8, 12, 12, 1, 5, 1, 1, 40, 0, 0, + ] +); -$t='!!! .'; -mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("'.$t.'","capitalcity","","6","1","'.time().'")'); +$pdo->prepare('insert into chat (`text`,`type`,`new`,`time`) values (?,?,?,unix_timestamp())') + ->execute( + ["!!! .", 6, 1,] + ); - - -if($inc) { - echo 'true'; -}else{ - echo 'false'; -} - -?> \ No newline at end of file +echo $inc ? 'true' : 'false'; diff --git a/cron_psh.php b/cron_psh.php index fe3c2e42..a348dc71 100644 --- a/cron_psh.php +++ b/cron_psh.php @@ -1,80 +1,111 @@ '.$_SERVER['SERVER_ADDR']); +if ($_SERVER['HTTP_CF_CONNECTING_IP'] != $_SERVER['SERVER_ADDR'] && $_SERVER['HTTP_CF_CONNECTING_IP'] != '127.0.0.1') { + die('Hello pussy!'); +} +if (getIPblock() != $_SERVER['SERVER_ADDR'] && getIPblock() != '127.0.0.1' && getIPblock() != '' && getIPblock( + ) != '5.187.7.71') { + die(getIPblock() . '
    ' . $_SERVER['SERVER_ADDR']); } -define('GAME',true); +const GAME = true; -include('_incl_data/__config.php'); -include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/__dungeon.php'); +require_once('_incl_data/__config.php'); +require_once('_incl_data/class/__db_connect.php'); +$d = new Dungeon; +$d->start(); -function e($t) { - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' ( ): '.mysql_real_escape_string($t).'","capitalcity","LEL","6","1","-1")'); -} - -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")'); +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")' + ); } // $sp = mysql_query('SELECT * FROM `dungeon_items` WHERE `user` = 0 AND `take` = 0'); -while( $pl = mysql_fetch_array($sp) ) { - $fxv = array( - 'itm' => mysql_fetch_array(mysql_query('SELECT `im`.*,`ish`.* FROM `dungeon_items` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`id` = "'.mysql_real_escape_string($pl['id']).'" AND `ish`.`take` = "0" AND `ish`.`delete` = "0" LIMIT 1')), - 'luck_count' => mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `dungeon_actions` WHERE `dn` = "'.$pl['dn'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($pl['id']).'" LIMIT 1')), - 'user_count' => mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dnow` = "'.$pl['dn'].'" LIMIT 1')) - ); - $fxv['luck_count'] = $fxv['luck_count'][0]; - $fxv['user_count'] = $fxv['user_count'][0]; - - if( $fxv['itm']['user'] > 0 || $fxv['luck_count'] < 1 ) { - - }elseif( $fxv['luck_count'] >= $fxv['user_count'] || $fxv['itm']['time']+300 < time() ) { - $fxv['sp'] = mysql_query('SELECT * FROM `dungeon_actions` WHERE `dn` = "'.$pl['dn'].'" AND `vars` = "luck_itm'.mysql_real_escape_string($pl['id']).'" ORDER BY `vals` DESC LIMIT '.$fxv['luck_count']); - $fxv['winner'] = array(); - $fxv['win_val'] = 0; - while( $fxv['pl'] = mysql_fetch_array($fxv['sp']) ) { - if( $fxv['pl']['vals'] > $fxv['win_val'] ) { - // - unset($fxv['winner']); - $fxv['winner'][] = $fxv['pl']['uid']; - $fxv['win_val'] = $fxv['pl']['vals']; - }elseif( $fxv['pl']['vals'] > 0 && $fxv['pl']['vals'] == $fxv['win_val'] ) { - // - $fxv['winner'][] = $fxv['pl']['uid']; - } - } - unset($fxv['pl'],$fxv['sp']); - if( count($fxv['winner']) > 1 ) { - // - $fxv['text'] = 'test2'; - }elseif(count($fxv['winner']) == 1) { - $fxv['user_win'] = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`sex`,`city`,`room` FROM `users` WHERE `id` = "'.$fxv['winner'][0].'" LIMIT 1')); - $fxv['text'] = ''.$fxv['user_win']['login'].' "'.$fxv['itm']['name'].'"'; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$pl['dn']."','".$fxv['user_win']['city']."','".$fxv['user_win']['room']."','','','".$fxv['text']."','".time()."','6','0','1','1')"); - mysql_query('UPDATE `dungeon_items` SET `time` = "'.time().'",`user` = "'.$fxv['user_win']['id'].'" WHERE `id` = "'.$fxv['itm']['id'].'" LIMIT 1'); - }else{ - // - mysql_query('UPDATE `dungeon_items` SET `user` = "1" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - unset($fxv); +while ($pl = mysql_fetch_array($sp)) { + $fxv = ['itm' => mysql_fetch_array( + mysql_query( + 'SELECT `im`.*,`ish`.* FROM `dungeon_items` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`id` = "' . mysql_real_escape_string( + $pl['id'] + ) . '" AND `ish`.`take` = "0" AND `ish`.`delete` = "0" LIMIT 1' + ) + ), 'luck_count' => mysql_fetch_array( + mysql_query( + 'SELECT COUNT(*) FROM `dungeon_actions` WHERE `dn` = "' . $pl['dn'] . '" AND `vars` = "luck_itm' . mysql_real_escape_string( + $pl['id'] + ) . '" LIMIT 1' + ) + ), 'user_count' => mysql_fetch_array( + mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dnow` = "' . $pl['dn'] . '" LIMIT 1') + )]; + $fxv['luck_count'] = $fxv['luck_count'][0]; + $fxv['user_count'] = $fxv['user_count'][0]; + + if ($fxv['itm']['user'] <= 0 && $fxv['luck_count'] >= 1 && ($fxv['luck_count'] >= $fxv['user_count'] || $fxv['itm']['time'] + 300 < time( + ))) { + $fxv['sp'] = mysql_query( + 'SELECT * FROM `dungeon_actions` WHERE `dn` = "' . $pl['dn'] . '" AND `vars` = "luck_itm' . mysql_real_escape_string( + $pl['id'] + ) . '" ORDER BY `vals` DESC LIMIT ' . $fxv['luck_count'] + ); + $fxv['winner'] = []; + $fxv['win_val'] = 0; + while ($fxv['pl'] = mysql_fetch_array($fxv['sp'])) { + if ($fxv['pl']['vals'] > $fxv['win_val']) { + // + unset($fxv['winner']); + $fxv['winner'][] = $fxv['pl']['uid']; + $fxv['win_val'] = $fxv['pl']['vals']; + } elseif ($fxv['pl']['vals'] > 0 && $fxv['pl']['vals'] == $fxv['win_val']) { + // + $fxv['winner'][] = $fxv['pl']['uid']; + } + } + unset($fxv['pl'], $fxv['sp']); + if (count($fxv['winner']) > 1) { + // + $fxv['text'] = 'test2'; + } elseif (count($fxv['winner']) == 1) { + $fxv['user_win'] = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login`,`sex`,`city`,`room` FROM `users` WHERE `id` = "' . $fxv['winner'][0] . '" LIMIT 1' + ) + ); + $fxv['text'] = '' . $fxv['user_win']['login'] . ' "' . $fxv['itm']['name'] . '"'; + mysql_query( + "INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $pl['dn'] . "','" . $fxv['user_win']['city'] . "','" . $fxv['user_win']['room'] . "','','','" . $fxv['text'] . "','" . time( + ) . "','6','0','1','1')" + ); + mysql_query( + 'UPDATE `dungeon_items` SET `time` = "' . time( + ) . '",`user` = "' . $fxv['user_win']['id'] . '" WHERE `id` = "' . $fxv['itm']['id'] . '" LIMIT 1' + ); + } else { + // + mysql_query('UPDATE `dungeon_items` SET `user` = "1" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + } + unset($fxv); } -?> \ No newline at end of file diff --git a/cron_q.php b/cron_q.php index 28fff632..29aec002 100644 --- a/cron_q.php +++ b/cron_q.php @@ -2,8 +2,8 @@ define('GAME',true); setlocale(LC_CTYPE ,"ru_RU.CP1251"); -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'); $html = ''; diff --git a/cron_rating.php b/cron_rating.php index 698c62ae..f3f175e4 100644 --- a/cron_rating.php +++ b/cron_rating.php @@ -3,7 +3,7 @@ //die('- ...'); define('GAME',true); -include('_incl_data/class/__db_connect.php'); +require_once('_incl_data/class/__db_connect.php'); // diff --git a/cron_tower.php b/cron_tower.php index d5279675..7703a15e 100644 --- a/cron_tower.php +++ b/cron_tower.php @@ -1,885 +1,1081 @@ -----'.$_SERVER['SERVER_ADDR']); - } -} +if (!isset($_GET['test']) && getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP( + ) != '31.131.106.205') { + exit(getIP() . '
    ' . $_SERVER['SERVER_ADDR']); + } -function changeSleep($uid,$sleep_action){ - global $u; - if( $sleep_action == 1 ){ - // - mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("'.$uid.'","'.time().'","1")'); - // - mysql_query("UPDATE `eff_users` SET `sleeptime`=".time().",`deactiveLast` = ( `deactiveTime` - ".time()." ) WHERE `uid`='".mysql_real_escape_string($uid)."' AND `no_Ace` = 0 AND `delete` = 0"); - mysql_query('UPDATE `items_users` SET `time_sleep` = "'.time().'" WHERE `uid` = "'.$uid.'" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"'); - $u->addAction(time(),'sleep',$u->info['city']); - // - } elseif( $sleep_action == 2 ){ - // - mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("'.$uid.'","'.time().'","2")'); - // - $sp = mysql_query('SELECT * FROM `items_users` WHERE `time_sleep` > 0 AND `uid` = "'.$uid.'" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"'); - while( $pl = mysql_fetch_array($sp) ) { - $tm_add = time() - $pl['time_sleep']; - mysql_query('UPDATE `items_users` SET `time_sleep` = "0",`time_create` = "'.($pl['time_create'] + $tm_add).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - $sp = mysql_query('SELECT `id`,`deactiveTime`,`deactiveLast` FROM `eff_users` WHERE `v1` LIKE "pgb%" AND `delete` = "0" AND `deactiveTime` > 0 AND `uid` = "'.$uid.'" ORDER BY `timeUse` DESC'); - while($pl = mysql_fetch_array($sp)) { - mysql_query("UPDATE `eff_users` SET `deactiveTime` = ".(time()+$pl['deactiveLast'])." WHERE `id`='".$pl['id']."' "); - } - $sp = mysql_query('SELECT `id`,`sleeptime`,`timeUse` FROM `eff_users` WHERE `uid`="'.mysql_real_escape_string($uid).'" AND `no_Ace` = 0 AND `sleeptime` > 0 AND `delete` = 0'); - while($pl = mysql_fetch_array($sp)) { - $timeUsen = time()-($pl['sleeptime']-$pl['timeUse']); - mysql_query("UPDATE `eff_users` SET `timeUse`='".$timeUsen."',`sleeptime`='0' WHERE `id`='".$pl['id']."' "); - } - mysql_query('UPDATE `actions` SET `vars` = "unsleep",`val` = "'.time().'" WHERE `id` = "'.$sleep['id'].'" LIMIT 1'); - } - //$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "'.$uid.'" LIMIT 1', 1); +function changeSleep($uid, $sleep_action) +{ + $u = User::start(); + if ($sleep_action == 1) { + // + mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("' . $uid . '","' . time() . '","1")'); + // + mysql_query( + "UPDATE `eff_users` SET `sleeptime`=" . time() . ",`deactiveLast` = ( `deactiveTime` - " . time( + ) . " ) WHERE `uid`='" . mysql_real_escape_string($uid) . "' AND `no_Ace` = 0 AND `delete` = 0" + ); + mysql_query( + 'UPDATE `items_users` SET `time_sleep` = "' . time( + ) . '" WHERE `uid` = "' . $uid . '" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"' + ); + $u->addAction(time(), 'sleep', $u->info['city']); + // + } elseif ($sleep_action == 2) { + // + mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("' . $uid . '","' . time() . '","2")'); + // + $sp = mysql_query( + 'SELECT * FROM `items_users` WHERE `time_sleep` > 0 AND `uid` = "' . $uid . '" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"' + ); + while ($pl = mysql_fetch_array($sp)) { + $tm_add = time() - $pl['time_sleep']; + mysql_query( + 'UPDATE `items_users` SET `time_sleep` = "0",`time_create` = "' . ($pl['time_create'] + $tm_add) . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + } + $sp = mysql_query( + 'SELECT `id`,`deactiveTime`,`deactiveLast` FROM `eff_users` WHERE `v1` LIKE "pgb%" AND `delete` = "0" AND `deactiveTime` > 0 AND `uid` = "' . $uid . '" ORDER BY `timeUse` DESC' + ); + while ($pl = mysql_fetch_array($sp)) { + mysql_query( + "UPDATE `eff_users` SET `deactiveTime` = " . (time( + ) + $pl['deactiveLast']) . " WHERE `id`='" . $pl['id'] . "' " + ); + } + $sp = mysql_query( + 'SELECT `id`,`sleeptime`,`timeUse` FROM `eff_users` WHERE `uid`="' . mysql_real_escape_string( + $uid + ) . '" AND `no_Ace` = 0 AND `sleeptime` > 0 AND `delete` = 0' + ); + while ($pl = mysql_fetch_array($sp)) { + $timeUsen = time() - ($pl['sleeptime'] - $pl['timeUse']); + mysql_query( + "UPDATE `eff_users` SET `timeUse`='" . $timeUsen . "',`sleeptime`='0' WHERE `id`='" . $pl['id'] . "' " + ); + } + mysql_query( + 'UPDATE `actions` SET `vars` = "unsleep",`val` = "' . time( + ) . '" WHERE `id` = "' . $sleep['id'] . '" LIMIT 1' + ); + } } // -$cnfg = array( - 'time_restart' => 1, - 'time_puti' => 240 -); +$cnfg = [ + 'time_restart' => 1, + 'time_puti' => 240, +]; echo '#start#'; -define('GAME',true); -setlocale(LC_CTYPE ,"ru_RU.CP1251"); +define('GAME', true); +setlocale(LC_CTYPE, "ru_RU.CP1251"); include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/__magic.php'); +$magic = new Magic(); -$itbs = array( - 0 => 558, - 1 => 722, - 2 => 718, - 3 => 700, - 4 => 291, - 5 => 545, - 6 => 533, - 7 => 536, - 8 => 628, - 9 => 710, - 10 => 654, - 11 => 684, - 12 => 689, - 13 => 552, - 14 => 552, - 15 => 716, - 16 => 320, - 17 => 290, - 18 => 543, - 19 => 528, - 20 => 540, - 21 => 627, - 22 => 709, - 23 => 653, - 24 => 681, - 25 => 687, - 26 => 523, - 27 => 523, - 28 => 712, - 29 => 1151, - 30 => 544, - 31 => 541, - 32 => 525, - 33 => 539, - 34 => 633, - 35 => 707, - 36 => 647, - 37 => 680, - 38 => 685, - 39 => 567, - 40 => 717, - 41 => 706, - 42 => 527, - 43 => 537, - 44 => 626, - 45 => 708, - 46 => 723, - 47 => 651, - 48 => 683, - 49 => 297, - 50 => 485, - 51 => 484, - 52 => 686 - ); -function microLogin2($bus) { - $bus['login_BIG'] = ''; - if( $bus['align'] > 0 ) { - $bus['login_BIG'] .= ''; - } - if( $bus['clan'] > 0 ) { - $bus['login_BIG'] .= ''; - } - $bus['login_BIG'] .= ''.$bus['login'].'['.$bus['level'].']'; - return $bus['login_BIG']; +$itbs = [ + 0 => 558, + 1 => 722, + 2 => 718, + 3 => 700, + 4 => 291, + 5 => 545, + 6 => 533, + 7 => 536, + 8 => 628, + 9 => 710, + 10 => 654, + 11 => 684, + 12 => 689, + 13 => 552, + 14 => 552, + 15 => 716, + 16 => 320, + 17 => 290, + 18 => 543, + 19 => 528, + 20 => 540, + 21 => 627, + 22 => 709, + 23 => 653, + 24 => 681, + 25 => 687, + 26 => 523, + 27 => 523, + 28 => 712, + 29 => 1151, + 30 => 544, + 31 => 541, + 32 => 525, + 33 => 539, + 34 => 633, + 35 => 707, + 36 => 647, + 37 => 680, + 38 => 685, + 39 => 567, + 40 => 717, + 41 => 706, + 42 => 527, + 43 => 537, + 44 => 626, + 45 => 708, + 46 => 723, + 47 => 651, + 48 => 683, + 49 => 297, + 50 => 485, + 51 => 484, + 52 => 686, +]; +function microLogin2($bus) +{ + $bus['login_BIG'] = ''; + if ($bus['align'] > 0) { + $bus['login_BIG'] .= ''; + } + if ($bus['clan'] > 0) { + $bus['login_BIG'] .= ''; + } + $bus['login_BIG'] .= '' . $bus['login'] . '[' . $bus['level'] . ']'; + return $bus['login_BIG']; } -function addItem($id,$uid,$md = NULL,$dn = NULL,$mxiznos = 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`.`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) - { - $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; - } - - - if($dn!=NULL) - { - // - if($dn['del']>0) - { - $i['dn_delete'] = 1; - } - } - if($mxiznos > 0) { - $i['iznosMAXi'] = $mxiznos; - } - $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'].'", +function addItem($id, $uid, $md = null, $dn = null, $mxiznos = 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`.`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) { + $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; + } + + + // + if ($dn != null && $dn['del'] > 0) { + $i['dn_delete'] = 1; + } + if ($mxiznos > 0) { + $i['iznosMAXi'] = $mxiznos; + } + $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'] . '", "capitalcity", - "'.time().'", - "'.time().'", - "'.$i['dn_delete'].'")'); - if($ins) - { - $rt = mysql_insert_id(); - }else{ - $rt = 0; - } - } - return $rt; + "' . time() . '", + "' . time() . '", + "' . $i['dn_delete'] . '")' + ); + if ($ins) { + $rt = mysql_insert_id(); + } else { + $rt = 0; + } + } + return $rt; } -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/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=='') - { - if($time_still<0) - { - $time_still = 0; - } - $out = $time_still.' .'; - } - return $out; +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; } -function e($t) { - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("'.mysql_real_escape_string($t).'","capitalcity","","6","1","'.time().'")'); +function e($t) +{ + mysql_query( + 'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("' . mysql_real_escape_string( + $t + ) . '","capitalcity","","6","1","' . time() . '")' + ); } -function e2($t) { - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("'.mysql_real_escape_string($t).'","capitalcity","","6","1","-1")'); +function e2($t) +{ + mysql_query( + 'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("' . mysql_real_escape_string( + $t + ) . '","capitalcity","","6","1","-1")' + ); } // 1 2 -function bs_atack($bs,$u1,$u2) { - global $magic; - if( isset($u1['id'],$u2['id']) ) { - $btl_id = $magic->atackUser($u1['id'],$u2['id'],$u2['team'],$u2['battle']); - if( $btl_id > 0 ) { - mysql_query('UPDATE `battle` SET `inTurnir` = "'.$bs['id'].'" WHERE `id` = "'.$btl_id.'" LIMIT 1'); - } - $usr_real = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `login` = "'.$u2['login'].'" AND `inUser` = "'.$u2['id'].'" LIMIT 1')); - if( !isset($usr_real['id']) ) { - $usr_real = $u2; - } - $me_real = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "'.$u1['id'].'" AND `login` = "'.$u1['login'].'" LIMIT 1')); - if( !isset($me_real['id']) ) { - $me_real = $u1; - } - /*if( $u2['battle'] > 0 ) { - $u2['battle'] = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$u2['battle'].'" AND `team_win` = "-1" LIMIT 1')); - if( isset($u2['battle']['id']) ) { - $u2['battle'] = $u2['battle']['id']; - }else{ - $u2['battle'] = 0; - } - }*/ - if( $u2['battle'] > 0 ) { - // - if( $u1['sex'] == 0 ) { - $text = '{u1} {u2} '; - }else{ - $text = '{u1} {u2} '; - } - }else{ - // - if( $u1['sex'] == 0 ) { - $text = '{u1} {u2} '; - }else{ - $text = '{u1} {u2} '; - } - } - if( isset($usr_real['id'])) { - $usrreal = ''; - if( $usr_real['align'] > 0 ) { - $usrreal .= ''; - } - if( $usr_real['clan'] > 0 ) { - $usrreal .= ''; - } - $usrreal .= ''.$usr_real['login'].'['.$usr_real['level'].']'; - }else{ - $mereal = '[??]'; - } - if( isset($me_real['id']) ) { - $mereal = ''; - if( $me_real['align'] > 0 ) { - $mereal .= ''; - } - if( $me_real['clan'] > 0 ) { - $mereal .= ''; - } - $mereal .= ''.$me_real['login'].'['.$me_real['level'].']'; - }else{ - $mereal = '[??]'; - } - $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.'" - )'); - } +function bs_atack($bs, $u1, $u2) +{ + global $magic; + if (isset($u1['id'], $u2['id'])) { + $btl_id = $magic->atackUser($u1['id'], $u2['id'], $u2['team'], $u2['battle']); + if ($btl_id > 0) { + mysql_query('UPDATE `battle` SET `inTurnir` = "' . $bs['id'] . '" WHERE `id` = "' . $btl_id . '" LIMIT 1'); + } + $usr_real = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`sex`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `login` = "' . $u2['login'] . '" AND `inUser` = "' . $u2['id'] . '" LIMIT 1' + ) + ); + if (!isset($usr_real['id'])) { + $usr_real = $u2; + } + $me_real = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`sex`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "' . $u1['id'] . '" AND `login` = "' . $u1['login'] . '" LIMIT 1' + ) + ); + if (!isset($me_real['id'])) { + $me_real = $u1; + } + if ($u2['battle'] > 0) { + // + if ($u1['sex'] == 0) { + $text = '{u1} {u2} '; + } else { + $text = '{u1} {u2} '; + } + } else { + // + if ($u1['sex'] == 0) { + $text = '{u1} {u2} '; + } else { + $text = '{u1} {u2} '; + } + } + if (isset($usr_real['id'])) { + $usrreal = ''; + if ($usr_real['align'] > 0) { + $usrreal .= ''; + } + if ($usr_real['clan'] > 0) { + $usrreal .= ''; + } + $usrreal .= '' . $usr_real['login'] . '[' . $usr_real['level'] . ']'; + } else { + $mereal = '[??]'; + } + if (isset($me_real['id'])) { + $mereal = ''; + if ($me_real['align'] > 0) { + $mereal .= ''; + } + if ($me_real['clan'] > 0) { + $mereal .= ''; + } + $mereal .= '' . $me_real['login'] . '[' . $me_real['level'] . ']'; + } else { + $mereal = '[??]'; + } + $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 . '" + )' + ); + } } // -function nostart($pl) { - global $cnfg; - $r = false; - if( $pl['users'] < 4 ) { - // - $r = true; - $pl['time_start'] = time() + $cnfg['time_restart'] * (60*60); - if( $pl['users'] > 0 ) { - e(' , '.$pl['to_lvl'].' : '.timeOut($pl['time_start']-time()).' ('.date('d.m.Y H:i',$pl['time_start']).')'); - }else{ - //if( timeOut($pl['time_start']-time()) != '44 .' ) { - e(' , '.$pl['to_lvl'].' '.timeOut($pl['time_start']-time()).' ('.date('d.m.Y H:i',$pl['time_start']).'), : 0.00 ., 1.00 ., : 0'); - //} - } - // - $sp = mysql_query('SELECT * FROM `bs_zv` WHERE `bsid` = "'.$pl['id'].'" AND `finish` = "0"'); - while( $pu = mysql_fetch_array($sp) ) { - mysql_query('UPDATE `users` SET `money` = `money` + "'.$pu['money'].'" WHERE `id` = "'.$pu['uid'].'" LIMIT 1'); - mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `id` = "'.$pu['id'].'" LIMIT 1'); - } - // - mysql_query('UPDATE `bs_turnirs` SET `ch1` = "0",`ch2` = "0", `status` = "0", `money` = "0", `time_start` = "'.$pl['time_start'].'",`users` = "0",`users_finish` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - return $r; +function nostart($pl) +{ + global $cnfg; + $r = false; + if ($pl['users'] < 4) { + // + $r = true; + $pl['time_start'] = time() + $cnfg['time_restart'] * (60 * 60); + if ($pl['users'] > 0) { + e( + ' , ' . $pl['to_lvl'] . ' : ' . timeOut( + $pl['time_start'] - time() + ) . ' (' . date('d.m.Y H:i', $pl['time_start']) . ')' + ); + } else { + e( + ' , ' . $pl['to_lvl'] . ' ' . timeOut( + $pl['time_start'] - time() + ) . ' (' . date( + 'd.m.Y H:i', $pl['time_start'] + ) . '), : 0.00 ., 1.00 ., : 0' + ); + } + // + $sp = mysql_query('SELECT * FROM `bs_zv` WHERE `bsid` = "' . $pl['id'] . '" AND `finish` = "0"'); + while ($pu = mysql_fetch_array($sp)) { + mysql_query( + 'UPDATE `users` SET `money` = `money` + "' . $pu['money'] . '" WHERE `id` = "' . $pu['uid'] . '" LIMIT 1' + ); + mysql_query('UPDATE `bs_zv` SET `finish` = "' . time() . '" WHERE `id` = "' . $pu['id'] . '" LIMIT 1'); + } + // + mysql_query( + 'UPDATE `bs_turnirs` SET `ch1` = "0",`ch2` = "0", `status` = "0", `money` = "0", `time_start` = "' . $pl['time_start'] . '",`users` = "0",`users_finish` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + } + return $r; } // "" -function add_arhiv($pl,$user) { - $return = 0; - mysql_query('INSERT INTO `users` (`login`,`pass`,`level`,`inTurnir`,`sex`,`obraz`,`name`,`online`,`city`,`room`,`align`,`clan`,`cityreg`,`bithday`,`activ`) VALUES ( - "'.$user['login'].'","bstowerbot","'.$user['level'].'","'.$pl['id'].'","'.$user['sex'].'","'.$user['obraz'].'","'.$user['login'].'","'.(time()+60*60*24).'","'.$user['city'].'","'.$user['room'].'","'.$user['align'].'","'.$user['clan'].'","capitalcity","01.02.2003","0" - )'); - $return = mysql_insert_id(); - if( $return > 0 ) { - $ins = mysql_query('INSERT INTO `stats` (`id`,`stats`,`bot`,`x`,`y`,`upLevel`) VALUES ( - "'.$return.'","s1=30|s2=31|s3=33|s4=30|s5=30|s6=1|s7=25|rinv=40|m9=5|m6=10","2","'.$user['x'].'","'.$user['y'].'","98" - )'); - if(!$ins) { - mysql_query('DELETE FROM `users` WHERE `id` = "'.$return.'" LIMIT 1'); - $return = 0; - } - } - return $return; +function add_arhiv($pl, $user) +{ + $return = 0; + mysql_query( + 'INSERT INTO `users` (`login`,`pass`,`level`,`inTurnir`,`sex`,`obraz`,`name`,`online`,`city`,`room`,`align`,`clan`,`cityreg`,`bithday`,`activ`) VALUES ( + "' . $user['login'] . '","bstowerbot","' . $user['level'] . '","' . $pl['id'] . '","' . $user['sex'] . '","' . $user['obraz'] . '","' . $user['login'] . '","' . (time( + ) + 60 * 60 * 24) . '","' . $user['city'] . '","' . $user['room'] . '","' . $user['align'] . '","' . $user['clan'] . '","capitalcity","01.02.2003","0" + )' + ); + $return = mysql_insert_id(); + if ($return > 0) { + $ins = mysql_query( + 'INSERT INTO `stats` (`id`,`stats`,`bot`,`x`,`y`,`upLevel`) VALUES ( + "' . $return . '","s1=30|s2=31|s3=33|s4=30|s5=30|s6=1|s7=25|rinv=40|m9=5|m6=10","2","' . $user['x'] . '","' . $user['y'] . '","98" + )' + ); + if (!$ins) { + mysql_query('DELETE FROM `users` WHERE `id` = "' . $return . '" LIMIT 1'); + $return = 0; + } + } + return $return; } // -function backusers($pl) { - $sp = mysql_query('SELECT * FROM `bs_zv` WHERE `bsid` = "'.$pl['id'].'" AND `off` = "0" AND `inBot` > 0'); - while( $pu = mysql_fetch_array($sp) ) { - // - mysql_query('DELETE FROM `users` WHERE `id` = "'.$pu['inBot'].'" LIMIT 1'); - mysql_query('DELETE FROM `stats` WHERE `id` = "'.$pu['inBot'].'" LIMIT 1'); - mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$pu['inBot'].'"'); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$pu['inBot'].'"'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$pu['inBot'].'"'); - mysql_query('DELETE FROM `users_delo` WHERE `uid` = "'.$pu['inBot'].'"'); - // - mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `id` = "'.$pu['uid'].'" LIMIT 1'); - // - mysql_query('UPDATE `bs_zv` SET `off` = "'.time().'" WHERE `id` = "'.$pu['id'].'" LIMIT 1'); - } - // - $sp = mysql_query('SELECT * FROM `users` WHERE `pass` = "bstowerbot" AND `inTurnir` = "'.$pl['id'].'" AND `room` = "362"'); - while( $pu = mysql_fetch_array($sp) ) { - mysql_query('DELETE FROM `users` WHERE `id` = "'.$pu['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `stats` WHERE `id` = "'.$pu['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$pu['id'].'"'); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$pu['id'].'"'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$pu['id'].'"'); - mysql_query('DELETE FROM `users_delo` WHERE `uid` = "'.$pu['id'].'"'); - } - // - mysql_query('DELETE FROM `bs_items` WHERE `bid` = "'.$pl['id'].'" AND `count` = "'.$pl['count'].'"'); - // - mysql_query('DELETE FROM `bs_actions` WHERE `bid` = "'.$pl['id'].'" AND `count` = "'.$pl['count'].'"'); - // - mysql_query('DELETE FROM `bs_trap` WHERE `bid` = "'.$pl['id'].'" AND `count` = "'.$pl['count'].'"'); +function backusers($pl) +{ + $sp = mysql_query('SELECT * FROM `bs_zv` WHERE `bsid` = "' . $pl['id'] . '" AND `off` = "0" AND `inBot` > 0'); + while ($pu = mysql_fetch_array($sp)) { + // + mysql_query('DELETE FROM `users` WHERE `id` = "' . $pu['inBot'] . '" LIMIT 1'); + mysql_query('DELETE FROM `stats` WHERE `id` = "' . $pu['inBot'] . '" LIMIT 1'); + mysql_query('DELETE FROM `actions` WHERE `uid` = "' . $pu['inBot'] . '"'); + mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pu['inBot'] . '"'); + mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pu['inBot'] . '"'); + mysql_query('DELETE FROM `users_delo` WHERE `uid` = "' . $pu['inBot'] . '"'); + // + mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `id` = "' . $pu['uid'] . '" LIMIT 1'); + // + mysql_query('UPDATE `bs_zv` SET `off` = "' . time() . '" WHERE `id` = "' . $pu['id'] . '" LIMIT 1'); + } + // + $sp = mysql_query( + 'SELECT * FROM `users` WHERE `pass` = "bstowerbot" AND `inTurnir` = "' . $pl['id'] . '" AND `room` = "362"' + ); + while ($pu = mysql_fetch_array($sp)) { + mysql_query('DELETE FROM `users` WHERE `id` = "' . $pu['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `stats` WHERE `id` = "' . $pu['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `actions` WHERE `uid` = "' . $pu['id'] . '"'); + mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pu['id'] . '"'); + mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pu['id'] . '"'); + mysql_query('DELETE FROM `users_delo` WHERE `uid` = "' . $pu['id'] . '"'); + } + // + mysql_query('DELETE FROM `bs_items` WHERE `bid` = "' . $pl['id'] . '" AND `count` = "' . $pl['count'] . '"'); + // + mysql_query('DELETE FROM `bs_actions` WHERE `bid` = "' . $pl['id'] . '" AND `count` = "' . $pl['count'] . '"'); + // + mysql_query('DELETE FROM `bs_trap` WHERE `bid` = "' . $pl['id'] . '" AND `count` = "' . $pl['count'] . '"'); } -$exp2 = array( - 1=>30000, - 2=>300000 -); -$st2s = array( - 7=>array( - 0=>10, - 1=>64, - 2=>8 - ), - 8=>array( - 0=>11, - 1=>78, - 2=>9 - ) -); +$exp2 = [ + 1 => 30000, + 2 => 300000, +]; +$st2s = [ + 7 => [ + 0 => 10, + 1 => 64, + 2 => 8, + ], + 8 => [ + 0 => 11, + 1 => 78, + 2 => 9, + ], +]; $sp = mysql_query('SELECT * FROM `bs_turnirs`'); -while( $pl = mysql_fetch_array($sp) ) { - // - $pl['to_lvl'] = $pl['level']; - if( $pl['level'] != $pl['level_max'] ) { - $pl['to_lvl'] .= '-'.$pl['level_max'].''; - } - $pl['to_lvl'] = ''; - if( $pl['status'] == 1 ) { - // - $tcu = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `inTurnir` = "'.$pl['id'].'" AND `room` = "362"')); - $tcu = $tcu[0]; - // - if( $pl['users'] != $tcu ) { - //- - $pl['users'] = $tcu; - } - // - // , , 6 - if( $pl['time_start'] < time() - 6*60*60 ) { - // - // - $text = ' . : ( ). : '.round($pl['money']*0.85,2).' .'; - mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( - "1", "'.mysql_real_escape_string($text).'", "'.time().'", "'.$pl['id'].'", "'.$pl['count'].'", "'.$pl['city'].'", - "'.round($pl['money']*0.85,2).'","'.$i.'" - )'); - // - // - mysql_query('INSERT INTO `bs_statistic` (`bsid`,`count`,`time_start`,`time_finish`,`time_sf`,`type_bs`,`money`,`wlogin`,`wuid`,`walign`,`wclan`) VALUES ( - "'.$pl['id'].'","'.$pl['count'].'","'.$pl['time_start'].'","'.time().'","'.(time()-$pl['time_start']).'","'.$pl['type_btl'].'","'.round($pl['money']*0.85,2).'", +while ($pl = mysql_fetch_array($sp)) { + // + $pl['to_lvl'] = $pl['level']; + if ($pl['level'] != $pl['level_max']) { + $pl['to_lvl'] .= '-' . $pl['level_max'] . ''; + } + $pl['to_lvl'] = ''; + if ($pl['status'] == 1) { + // + $tcu = mysql_fetch_array( + mysql_query('SELECT COUNT(*) FROM `users` WHERE `inTurnir` = "' . $pl['id'] . '" AND `room` = "362"') + ); + $tcu = $tcu[0]; + // + if ($pl['users'] != $tcu) { + //- + $pl['users'] = $tcu; + } + // + // , , 6 + if ($pl['time_start'] < time() - 6 * 60 * 60) { + // + // + $text = ' . : ( ). : ' . round( + $pl['money'] * 0.85, 2 + ) . ' .'; + mysql_query( + 'INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( + "1", "' . mysql_real_escape_string($text) . '", "' . time( + ) . '", "' . $pl['id'] . '", "' . $pl['count'] . '", "' . $pl['city'] . '", + "' . round($pl['money'] * 0.85, 2) . '","' . $i . '" + )' + ); + // + // + mysql_query( + 'INSERT INTO `bs_statistic` (`bsid`,`count`,`time_start`,`time_finish`,`time_sf`,`type_bs`,`money`,`wlogin`,`wuid`,`walign`,`wclan`) VALUES ( + "' . $pl['id'] . '","' . $pl['count'] . '","' . $pl['time_start'] . '","' . time() . '","' . (time( + ) - $pl['time_start']) . '","' . $pl['type_btl'] . '","' . round($pl['money'] * 0.85, 2) . '", "2","0","0","0" - )'); - $pl['time_start'] = time() + $cnfg['time_restart'] * (60*60); - e(' '.$pl['to_lvl'].' . '.timeOut($pl['time_start']-time()-3600).' ('.date('d.m.Y H:i',$pl['time_start']).')'); - backusers($pl); - $pl['count']++; - mysql_query('UPDATE `bs_turnirs` SET `money` = "0",`count` = "'.$pl['count'].'",`status` = "0",`time_start` = "'.$pl['time_start'].'",`users` = "0",`users_finish` = "0",`ch1` = "0",`arhiv` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }else{ - mysql_query('UPDATE `users` SET `online` = "'.(time()+60*60*6).'" WHERE `inTurnir` = "'.$pl['id'].'" OR (`room` >= 362 AND `room` <= 366) LIMIT '.($pl['users']+$pl['arhiv'])); - // - if( $pl['users'] < 2 ) { - mysql_query('DELEE FROM `users` WHERE `login` LIKE "%(%" AND `inTurnir` = "'.$pl['id'].'" AND `room` = "362"'); - if( $pl['users'] == 1 ) { - $pl['usersn'] = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `inTurnir` = "'.$pl['id'].'" AND `room` = "362" LIMIT 1')); - $pl['usersn'] = $pl['usersn'][0]; - if( $pl['users'] != $pl['usersn'] ) { - //$pl['users'] = $pl['usersn']; - } - } - //. - if( $pl['users'] == 1 ) { - // , 1 - if( $pl['arhiv'] == 0 ) { - // , - $uwin_bot = mysql_fetch_array(mysql_query('SELECT `id`,`money`,`login`,`level`,`align`,`clan` FROM `users` WHERE `inTurnir` = "'.$pl['id'].'" AND `room` = "362" LIMIT 1')); - $swin_bot = mysql_fetch_array(mysql_query('SELECT `id`,`exp` FROM `stats` WHERE `id` = "'.$uwin_bot['id'].'" LIMIT 1')); - $uwin = mysql_fetch_array(mysql_query('SELECT `id`,`money`,`money2`,`login`,`level`,`align`,`clan` FROM `users` WHERE `inUser` = "'.$uwin_bot['id'].'" LIMIT 1')); - $swin = mysql_fetch_array(mysql_query('SELECT `id`,`exp` FROM `stats` WHERE `id` = "'.$uwin['id'].'" LIMIT 1')); - - // - $swin_bot['exp'] -= 30000; - $swin_bot['exp'] = round($swin_bot['exp']/2); - if( $swin_bot['exp'] < 0 ) { - $swin_bot['exp'] = 0; - } - $swin_bot['exp'] += 1500; - - // - mysql_query('INSERT INTO `bs_statistic` (`bsid`,`count`,`time_start`,`time_finish`,`time_sf`,`type_bs`,`money`,`wlogin`,`wuid`,`walign`,`wclan`,`wlevel`) VALUES ( - "'.$pl['id'].'","'.$pl['count'].'","'.$pl['time_start'].'","'.time().'","'.(time()-$pl['time_start']).'","'.$pl['type_btl'].'","'.round($pl['money']*0.85,2).'", - "'.$uwin['login'].'","'.$uwin['id'].'","'.$uwin['align'].'","'.$uwin['clan'].'","'.$uwin['level'].'" - )'); - $pl['time_start'] = time() + $cnfg['time_restart'] * (60*60); - if( isset($uwin['id']) ) { - mysql_query('UPDATE `users` SET `money` = "'.($uwin['money']+round($pl['money']*0.85,2)).'", `money2` = "'.($uwin['money2']+1).'", `win_bs` = IFNULL(`win_bs`, 0) + 1 WHERE `login` = "'.$uwin['login'].'"'); - mysql_query('UPDATE `stats` SET `exp` = "'.($swin['exp']+$swin_bot['exp']).'" WHERE `id` = "'.$uwin['id'].'" LIMIT 1'); - e('#'.$pl['usersn'].' '.$pl['to_lvl'].' . : '.microLogin2($uwin).'. : '.round($pl['money']*0.85,2).' . 1 .'.round($swin_bot['exp']).' . '.timeOut($pl['time_start']-time()).' ('.date('d.m.Y H:i',$pl['time_start']).')'); - if(date('w') == 0 || date('w') == 6 || date('w') == 3) { - mysql_query('UPDATE `stats` SET `repexp` = `repexp` + 25 WHERE `id` = "'.$uwin['id'].'" LIMIT 1'); - } - else - { - mysql_query('UPDATE `stats` SET `repexp` = `repexp` + 10 WHERE `id` = "'.$uwin['id'].'" LIMIT 1'); - } - } - // - $text = ' . : '.microLogin2($uwin).'. : '.round($pl['money']*0.85,2).' . 1 .'.round($swin_bot['exp']).' .'; - mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( - "1", "'.mysql_real_escape_string($text).'", "'.time().'", "'.$pl['id'].'", "'.$pl['count'].'", "'.$pl['city'].'", - "'.round($pl['money']*0.85,2).'","'.$i.'" - )'); - // - backusers($pl); - $pl['count']++; - mysql_query('UPDATE `bs_turnirs` SET `money` = "0",`count` = "'.$pl['count'].'",`status` = "0",`time_start` = "'.$pl['time_start'].'",`users` = "0",`users_finish` = "0",`ch1` = "0",`arhiv` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }else{ - // - - } - }else{ - // - mysql_query('INSERT INTO `bs_statistic` (`bsid`,`count`,`time_start`,`time_finish`,`time_sf`,`type_bs`,`money`,`wlogin`,`wuid`,`walign`,`wclan`) VALUES ( - "'.$pl['id'].'","'.$pl['count'].'","'.$pl['time_start'].'","'.time().'","'.(time()-$pl['time_start']).'","'.$pl['type_btl'].'","'.round($pl['money']*0.85,2).'", + )' + ); + $pl['time_start'] = time() + $cnfg['time_restart'] * (60 * 60); + e( + ' ' . $pl['to_lvl'] . ' . ' . timeOut( + $pl['time_start'] - time() - 3600 + ) . ' (' . date('d.m.Y H:i', $pl['time_start']) . ')' + ); + backusers($pl); + $pl['count']++; + mysql_query( + 'UPDATE `bs_turnirs` SET `money` = "0",`count` = "' . $pl['count'] . '",`status` = "0",`time_start` = "' . $pl['time_start'] . '",`users` = "0",`users_finish` = "0",`ch1` = "0",`arhiv` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + } else { + mysql_query( + 'UPDATE `users` SET `online` = "' . (time( + ) + 60 * 60 * 6) . '" WHERE `inTurnir` = "' . $pl['id'] . '" OR (`room` >= 362 AND `room` <= 366) LIMIT ' . ($pl['users'] + $pl['arhiv']) + ); + // + if ($pl['users'] < 2) { + mysql_query( + 'DELEE FROM `users` WHERE `login` LIKE "%(%" AND `inTurnir` = "' . $pl['id'] . '" AND `room` = "362"' + ); + if ($pl['users'] == 1) { + $pl['usersn'] = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(*) FROM `users` WHERE `inTurnir` = "' . $pl['id'] . '" AND `room` = "362" LIMIT 1' + ) + ); + $pl['usersn'] = $pl['usersn'][0]; + if ($pl['users'] != $pl['usersn']) { + //$pl['users'] = $pl['usersn']; + } + } + //. + if ($pl['users'] == 1) { + // , 1 + if ($pl['arhiv'] == 0) { + // , + $uwin_bot = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`money`,`login`,`level`,`align`,`clan` FROM `users` WHERE `inTurnir` = "' . $pl['id'] . '" AND `room` = "362" LIMIT 1' + ) + ); + $swin_bot = mysql_fetch_array( + mysql_query('SELECT `id`,`exp` FROM `stats` WHERE `id` = "' . $uwin_bot['id'] . '" LIMIT 1') + ); + $uwin = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`money`,`money2`,`login`,`level`,`align`,`clan` FROM `users` WHERE `inUser` = "' . $uwin_bot['id'] . '" LIMIT 1' + ) + ); + $swin = mysql_fetch_array( + mysql_query('SELECT `id`,`exp` FROM `stats` WHERE `id` = "' . $uwin['id'] . '" LIMIT 1') + ); + + // + $swin_bot['exp'] -= 30000; + $swin_bot['exp'] = round($swin_bot['exp'] / 2); + if ($swin_bot['exp'] < 0) { + $swin_bot['exp'] = 0; + } + $swin_bot['exp'] += 1500; + + // + mysql_query( + 'INSERT INTO `bs_statistic` (`bsid`,`count`,`time_start`,`time_finish`,`time_sf`,`type_bs`,`money`,`wlogin`,`wuid`,`walign`,`wclan`,`wlevel`) VALUES ( + "' . $pl['id'] . '","' . $pl['count'] . '","' . $pl['time_start'] . '","' . time( + ) . '","' . (time() - $pl['time_start']) . '","' . $pl['type_btl'] . '","' . round( + $pl['money'] * 0.85, 2 + ) . '", + "' . $uwin['login'] . '","' . $uwin['id'] . '","' . $uwin['align'] . '","' . $uwin['clan'] . '","' . $uwin['level'] . '" + )' + ); + $pl['time_start'] = time() + $cnfg['time_restart'] * (60 * 60); + if (isset($uwin['id'])) { + mysql_query( + 'UPDATE `users` SET `money` = "' . ($uwin['money'] + round( + $pl['money'] * 0.85, 2 + )) . '", `money2` = "' . ($uwin['money2'] + 1) . '", `win_bs` = IFNULL(`win_bs`, 0) + 1 WHERE `login` = "' . $uwin['login'] . '"' + ); + mysql_query( + 'UPDATE `stats` SET `exp` = "' . ($swin['exp'] + $swin_bot['exp']) . '" WHERE `id` = "' . $uwin['id'] . '" LIMIT 1' + ); + e( + '#' . $pl['usersn'] . ' ' . $pl['to_lvl'] . ' . : ' . microLogin2( + $uwin + ) . '. : ' . round( + $pl['money'] * 0.85, 2 + ) . ' . 1 .' . round( + $swin_bot['exp'] + ) . ' . ' . timeOut( + $pl['time_start'] - time() + ) . ' (' . date('d.m.Y H:i', $pl['time_start']) . ')' + ); + if (date('w') == 0 || date('w') == 6 || date('w') == 3) { + mysql_query( + 'UPDATE `stats` SET `repexp` = `repexp` + 25 WHERE `id` = "' . $uwin['id'] . '" LIMIT 1' + ); + } else { + mysql_query( + 'UPDATE `stats` SET `repexp` = `repexp` + 10 WHERE `id` = "' . $uwin['id'] . '" LIMIT 1' + ); + } + } + // + $text = ' . : ' . microLogin2($uwin) . '. : ' . round( + $pl['money'] * 0.85, 2 + ) . ' . 1 .' . round($swin_bot['exp']) . ' .'; + mysql_query( + 'INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( + "1", "' . mysql_real_escape_string($text) . '", "' . time( + ) . '", "' . $pl['id'] . '", "' . $pl['count'] . '", "' . $pl['city'] . '", + "' . round($pl['money'] * 0.85, 2) . '","' . $i . '" + )' + ); + // + backusers($pl); + $pl['count']++; + mysql_query( + 'UPDATE `bs_turnirs` SET `money` = "0",`count` = "' . $pl['count'] . '",`status` = "0",`time_start` = "' . $pl['time_start'] . '",`users` = "0",`users_finish` = "0",`ch1` = "0",`arhiv` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + } else { + // + + } + } else { + // + mysql_query( + 'INSERT INTO `bs_statistic` (`bsid`,`count`,`time_start`,`time_finish`,`time_sf`,`type_bs`,`money`,`wlogin`,`wuid`,`walign`,`wclan`) VALUES ( + "' . $pl['id'] . '","' . $pl['count'] . '","' . $pl['time_start'] . '","' . time( + ) . '","' . (time() - $pl['time_start']) . '","' . $pl['type_btl'] . '","' . round( + $pl['money'] * 0.85, 2 + ) . '", "1","0","0","0" - )'); - // , - $pl['time_start'] = time() + $cnfg['time_restart'] * (60*60); - // - $text = ' . : ( ). : '.round($pl['money']*0.85,2).' .'; - mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( - "1", "'.mysql_real_escape_string($text).'", "'.time().'", "'.$pl['id'].'", "'.$pl['count'].'", "'.$pl['city'].'", - "'.round($pl['money']*0.85,2).'","'.$i.'" - )'); - // - backusers($pl); - $pl['count']++; - e(' '.$pl['to_lvl'].' . : ( ). '.round($pl['money']*0.85,2).' . '.timeOut($pl['time_start']-time()-3600).' ('.date('d.m.Y H:i',$pl['time_start']).')'); - mysql_query('UPDATE `bs_turnirs` SET `money` = "'.round($pl['money']*0.85,2).'",`count` = "'.$pl['count'].'",`status` = "0",`time_start` = "'.$pl['time_start'].'",`users` = "0",`users_finish` = "0",`ch1` = "0",`arhiv` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - }else{ - // - if( $pl['arhiv'] > 0 ) { - $a_sp = mysql_query('SELECT `s`.`timeGo`,`u`.`align`,`u`.`clan`,`u`.`sex`,`u`.`pass`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`battle`,`s`.`x`,`s`.`y` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`pass` = "bstowerbot" AND `u`.`inTurnir` = "'.mysql_real_escape_string($pl['id']).'" AND `u`.`room` = "362" LIMIT 10'); - while( $a_pl = mysql_fetch_array($a_sp) ) { - $xy = mysql_fetch_array(mysql_query('SELECT * FROM `bs_map` WHERE `x` = "'.$a_pl['x'].'" AND `y` = "'.$a_pl['y'].'" LIMIT 1')); - if( isset($xy['id']) ) { - if( $a_pl['battle'] == 0 ) { - // - $sp_itm = mysql_query('SELECT * FROM `bs_items` WHERE `x` = "'.$a_pl['x'].'" AND `y` = "'.$a_pl['y'].'" AND `bid` = "'.$pl['id'].'" AND `count` = "'.$pl['count'].'" LIMIT 20'); - while( $pl_itm = mysql_fetch_array( $sp_itm ) ) { - if( rand(0,100) < 21 ) { - // - $itm_id = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$pl_itm['item_id'].'" LIMIT 1')); - if( isset($itm_id['id']) ) { - $itm_id['odevaem'] = addItem($itm_id['id'],$a_pl['id']); - mysql_query('DELETE FROM `bs_items` WHERE `id` = "'.$pl_itm['id'].'" LIMIT 1'); - if( $itm_id['level'] <= $a_pl['level'] && $itm_id['odevaem'] > 0 ) { - // - if( $itm_id['inslot'] == 10 ) { - $itm_id['inslot'] = rand(10,12); - } - mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `inOdet` = "'.$itm_id['inslot'].'" AND `uid` = "'.$a_pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `inOdet` = "'.$itm_id['inslot'].'" WHERE `id` = "'.$itm_id['odevaem'].'" LIMIT 1'); - } - } - } - } - unset($itm_id,$sp_itm,$pl_itm); - /// - if( $pl['time_start'] < time() - $cnfg['time_puti'] ) { - $sp_usr = mysql_query('SELECT `u`.`id`,`u`.`battle`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`sex`,`s`.`team` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`x` = "'.$a_pl['x'].'" AND `u`.`pass` != "'.$a_pl['pass'].'" AND `s`.`y` = "'.$a_pl['y'].'" ORDER BY `s`.`timeGo` ASC LIMIT 5'); - while( $pl_usr = mysql_fetch_array($sp_usr) ) { - if( rand(0,100) < 31 && $a_pl['battle'] == 0 ) { - $pl_usr_real = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`login`,`level`,`clan`,`align`,`battle` FROM `users` WHERE `inUser` = "'.$pl_usr['id'].'" LIMIT 1')); - if( isset($pl_usr_real['id']) ) { - mysql_query('UPDATE `stats` SET `hpNow` = `hpNow` + 10 WHERE `id` = "'.$a_pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `hpNow` = `hpNow` + 10 WHERE `id` = "'.$pl_usr['id'].'" LIMIT 1'); - bs_atack($pl,$a_pl,$pl_usr); - $a_pl['battle'] = 1; - } - } - } - unset($sp_usr,$pl_usr); - - if( $a_pl['battle'] == 0 && rand(0,100) < 71 && $a_pl['timeGo'] < time()) { - // - $stor = array(); - if( $xy['up'] > 0 ) { - $stor[] = 'up'; - } - if( $xy['down'] > 0 ) { - $stor[] = 'down'; - } - if( $xy['left'] > 0 ) { - $stor[] = 'left'; - } - if( $xy['right'] > 0 ) { - $stor[] = 'right'; - } - $stor = $stor[rand(0,count($stor)-1)]; - if( $stor == 'up' ) { - $stgo = $xy[$stor]; - }elseif( $stor == 'down' ) { - $stgo = $xy[$stor]; - }elseif( $stor == 'left' ) { - $stgo = $xy[$stor]; - }elseif( $stor == 'right' ) { - $stgo = $xy[$stor]; - } - if( $stgo == 1 ) { - if( $stor == 'up' ) { - $a_pl['x']--; - }elseif( $stor == 'down' ) { - $a_pl['x']++; - }elseif( $stor == 'left' ) { - $a_pl['y']--; - }elseif( $stor == 'right' ) { - $a_pl['y']++; - } - }else{ - $stgo = mysql_fetch_array(mysql_query('SELECT * FROM `bs_map` WHERE `id` = "'.$stgo.'" LIMIT 1')); - if( isset($stgo['id']) ) { - $a_pl['x'] = $stgo['x']; - $a_pl['y'] = $stgo['y']; - } - } - mysql_query('UPDATE `stats` SET `x` = "'.$a_pl['x'].'",`y` = "'.$a_pl['y'].'" WHERE `id` = "'.$a_pl['id'].'" LIMIT 1'); - unset($stor,$stgo); - } - } - - }else{ - // - - } - } - } - } - } - } - }elseif( $pl['status'] == 0 && $pl['time_start'] < time() ) { - // - if( nostart( $pl ) == false ) { - - // ! - $spm = mysql_query('SELECT `x`,`y` FROM `bs_map` WHERE `mid` = "'.$pl['type_map'].'"'); - $maps = array( ); - while( $plm = mysql_fetch_array($spm) ) { - $maps[] = array($plm['x'],$plm['y']); - } - $i = 0; $j = 0; $usrlst = array(); - $ubss = ''; - $sp_u = mysql_query('SELECT * FROM `bs_zv` WHERE `finish` = "0" AND `bsid` = "'.$pl['id'].'" ORDER BY `money` DESC LIMIT 12'); - // - // - mysql_query('INSERT INTO `dungeon_now` ( + )' + ); + // , + $pl['time_start'] = time() + $cnfg['time_restart'] * (60 * 60); + // + $text = ' . : ( ). : ' . round( + $pl['money'] * 0.85, 2 + ) . ' .'; + mysql_query( + 'INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( + "1", "' . mysql_real_escape_string($text) . '", "' . time( + ) . '", "' . $pl['id'] . '", "' . $pl['count'] . '", "' . $pl['city'] . '", + "' . round($pl['money'] * 0.85, 2) . '","' . $i . '" + )' + ); + // + backusers($pl); + $pl['count']++; + e( + ' ' . $pl['to_lvl'] . ' . : ( ). ' . round( + $pl['money'] * 0.85, 2 + ) . ' . ' . timeOut( + $pl['time_start'] - time() - 3600 + ) . ' (' . date('d.m.Y H:i', $pl['time_start']) . ')' + ); + mysql_query( + 'UPDATE `bs_turnirs` SET `money` = "' . round( + $pl['money'] * 0.85, 2 + ) . '",`count` = "' . $pl['count'] . '",`status` = "0",`time_start` = "' . $pl['time_start'] . '",`users` = "0",`users_finish` = "0",`ch1` = "0",`arhiv` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + } + } else { + // + if ($pl['arhiv'] > 0) { + $a_sp = mysql_query( + 'SELECT `s`.`timeGo`,`u`.`align`,`u`.`clan`,`u`.`sex`,`u`.`pass`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`battle`,`s`.`x`,`s`.`y` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`pass` = "bstowerbot" AND `u`.`inTurnir` = "' . mysql_real_escape_string( + $pl['id'] + ) . '" AND `u`.`room` = "362" LIMIT 10' + ); + while ($a_pl = mysql_fetch_array($a_sp)) { + $xy = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `bs_map` WHERE `x` = "' . $a_pl['x'] . '" AND `y` = "' . $a_pl['y'] . '" LIMIT 1' + ) + ); + if (isset($xy['id'])) { + if ($a_pl['battle'] == 0) { + // + $sp_itm = mysql_query( + 'SELECT * FROM `bs_items` WHERE `x` = "' . $a_pl['x'] . '" AND `y` = "' . $a_pl['y'] . '" AND `bid` = "' . $pl['id'] . '" AND `count` = "' . $pl['count'] . '" LIMIT 20' + ); + while ($pl_itm = mysql_fetch_array($sp_itm)) { + if (rand(0, 100) < 21) { + // + $itm_id = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `items_main` WHERE `id` = "' . $pl_itm['item_id'] . '" LIMIT 1' + ) + ); + if (isset($itm_id['id'])) { + $itm_id['odevaem'] = addItem($itm_id['id'], $a_pl['id']); + mysql_query( + 'DELETE FROM `bs_items` WHERE `id` = "' . $pl_itm['id'] . '" LIMIT 1' + ); + if ($itm_id['level'] <= $a_pl['level'] && $itm_id['odevaem'] > 0) { + // + if ($itm_id['inslot'] == 10) { + $itm_id['inslot'] = rand(10, 12); + } + mysql_query( + 'UPDATE `items_users` SET `inOdet` = "0" WHERE `inOdet` = "' . $itm_id['inslot'] . '" AND `uid` = "' . $a_pl['id'] . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `items_users` SET `inOdet` = "' . $itm_id['inslot'] . '" WHERE `id` = "' . $itm_id['odevaem'] . '" LIMIT 1' + ); + } + } + } + } + unset($itm_id, $sp_itm, $pl_itm); + /// + if ($pl['time_start'] < time() - $cnfg['time_puti']) { + $sp_usr = mysql_query( + 'SELECT `u`.`id`,`u`.`battle`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`sex`,`s`.`team` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`x` = "' . $a_pl['x'] . '" AND `u`.`pass` != "' . $a_pl['pass'] . '" AND `s`.`y` = "' . $a_pl['y'] . '" ORDER BY `s`.`timeGo` ASC LIMIT 5' + ); + while ($pl_usr = mysql_fetch_array($sp_usr)) { + if (rand(0, 100) < 31 && $a_pl['battle'] == 0) { + $pl_usr_real = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`sex`,`login`,`level`,`clan`,`align`,`battle` FROM `users` WHERE `inUser` = "' . $pl_usr['id'] . '" LIMIT 1' + ) + ); + if (isset($pl_usr_real['id'])) { + mysql_query( + 'UPDATE `stats` SET `hpNow` = `hpNow` + 10 WHERE `id` = "' . $a_pl['id'] . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `stats` SET `hpNow` = `hpNow` + 10 WHERE `id` = "' . $pl_usr['id'] . '" LIMIT 1' + ); + bs_atack($pl, $a_pl, $pl_usr); + $a_pl['battle'] = 1; + } + } + } + unset($sp_usr, $pl_usr); + + if ($a_pl['battle'] == 0 && rand(0, 100) < 71 && $a_pl['timeGo'] < time()) { + // + $stor = []; + if ($xy['up'] > 0) { + $stor[] = 'up'; + } + if ($xy['down'] > 0) { + $stor[] = 'down'; + } + if ($xy['left'] > 0) { + $stor[] = 'left'; + } + if ($xy['right'] > 0) { + $stor[] = 'right'; + } + $stor = $stor[rand(0, count($stor) - 1)]; + if ($stor == 'up') { + $stgo = $xy[$stor]; + } elseif ($stor == 'down') { + $stgo = $xy[$stor]; + } elseif ($stor == 'left') { + $stgo = $xy[$stor]; + } elseif ($stor == 'right') { + $stgo = $xy[$stor]; + } + if ($stgo == 1) { + if ($stor == 'up') { + $a_pl['x']--; + } elseif ($stor == 'down') { + $a_pl['x']++; + } elseif ($stor == 'left') { + $a_pl['y']--; + } elseif ($stor == 'right') { + $a_pl['y']++; + } + } else { + $stgo = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `bs_map` WHERE `id` = "' . $stgo . '" LIMIT 1' + ) + ); + if (isset($stgo['id'])) { + $a_pl['x'] = $stgo['x']; + $a_pl['y'] = $stgo['y']; + } + } + mysql_query( + 'UPDATE `stats` SET `x` = "' . $a_pl['x'] . '",`y` = "' . $a_pl['y'] . '" WHERE `id` = "' . $a_pl['id'] . '" LIMIT 1' + ); + unset($stor, $stgo); + } + } + + } else { + // + + } + } + } + } + } + } + } elseif ($pl['status'] == 0 && $pl['time_start'] < time()) { + // + if (nostart($pl) == false) { + + // ! + $spm = mysql_query('SELECT `x`,`y` FROM `bs_map` WHERE `mid` = "' . $pl['type_map'] . '"'); + $maps = []; + while ($plm = mysql_fetch_array($spm)) { + $maps[] = [$plm['x'], $plm['y']]; + } + $i = 0; + $j = 0; + $usrlst = []; + $ubss = ''; + $sp_u = mysql_query( + 'SELECT * FROM `bs_zv` WHERE `finish` = "0" AND `bsid` = "' . $pl['id'] . '" ORDER BY `money` DESC LIMIT 12' + ); + // + // + mysql_query( + 'INSERT INTO `dungeon_now` ( `id2` , `name` , `time_start` , `time_finish` , `uid` , `city` , `type` , `bsid` ) VALUES ( - "6" , " " , "'.$pl['time_start'].'" , "0" , "0" , "'.$pl['city'].'" , "0" , "'.$pl['id'].'" - )'); - $dnew = mysql_insert_id(); - // + "6" , " " , "' . $pl['time_start'] . '" , "0" , "0" , "' . $pl['city'] . '" , "0" , "' . $pl['id'] . '" + )' + ); + $dnew = mysql_insert_id(); + // $vls32 = ''; $sphj = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "6"'); - while($plhj = mysql_fetch_array($sphj)) - { - $vls32 .= '("'.$dnew.'","'.$plhj['name'].'","'.$plhj['img'].'","'.$plhj['x'].'","'.$plhj['y'].'","'.$plhj['action'].'","'.$plhj['type'].'","'.$plhj['w'].'","'.$plhj['h'].'","'.$plhj['s'].'","'.$plhj['s2'].'","'.$plhj['os1'].'","'.$plhj['os2'].'","'.$plhj['os3'].'","'.$plhj['os4'].'","'.$plhj['type2'].'","'.$plhj['top'].'","'.$plhj['left'].'","'.$plhj['date'].'"),'; + while ($plhj = mysql_fetch_array($sphj)) { + $vls32 .= '("' . $dnew . '","' . $plhj['name'] . '","' . $plhj['img'] . '","' . $plhj['x'] . '","' . $plhj['y'] . '","' . $plhj['action'] . '","' . $plhj['type'] . '","' . $plhj['w'] . '","' . $plhj['h'] . '","' . $plhj['s'] . '","' . $plhj['s2'] . '","' . $plhj['os1'] . '","' . $plhj['os2'] . '","' . $plhj['os3'] . '","' . $plhj['os4'] . '","' . $plhj['type2'] . '","' . $plhj['top'] . '","' . $plhj['left'] . '","' . $plhj['date'] . '"),'; } - $vls32 = rtrim($vls32,','); - if($vls32!='') - { - $ins232 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls32.''); + $vls32 = rtrim($vls32, ','); + if ($vls32 != '') { + $ins232 = mysql_query( + 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls32 . '' + ); } - unset($vls32,$ins232); - // - $map = array(); - $mapsp = mysql_query('SELECT `x`,`y` FROM `dungeon_map` WHERE `id_dng` = 6'); - while( $mappl = mysql_fetch_array($mapsp) ) { - $map[] = array( 'x' => $mappl['x'] , 'y' => $mappl['y'] ); - } - $mapu = $map; - // - $ii1 = 0; - while($ii1 < count($map)) { - // 2 - $itbsrnd = $itbs[rand(0,count($itbs)-1)]; - $mp = rand(0,count($map)-1); - // - $x1 = $map[$mp]['x']; - $y1 = $map[$mp]['y']; - // - mysql_query('INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ( - "'.$dnew.'","'.$itbsrnd.'","'.(time()-600).'","'.$x1.'","'.$y1.'" - )'); - // - $ii1++; - } - - // . . - $m1 = $maps[rand(0,count($maps)-1)]; - $x1 = round($m1[0]); - $y1 = round($m1[1]); - //$itm1 = array( 4174 , 4175 , 4176 , 4177 , 4178 , 4179 , 4180 ); // . - $itm1 = array( 4176 , 4177 ); // . - $itm1 = $itm1[rand(0,count($itm1)-1)]; - if( $itm1 > 0 ) { - // - $mp = rand(0,count($map)-1); - // - $x1 = $map[$mp]['x']; - $y1 = $map[$mp]['y']; - // - mysql_query('INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ( - "'.$dnew.'","'.$itm1.'","'.(time()-600).'","'.$x1.'","'.$y1.'" - )'); - // - } - - // () - /*$vls0 = ''; - $zi1 = 0; - $id_bots = array(159,160,161); - while($zi1 < count($id_bots)) { - if(isset($id_bots[$zi1])) { - $mp = rand(0,count($map)-1); - $x1 = $map[$mp]['x']; - $y1 = $map[$mp]['y']; - $vls0 .= '("'.(time()+150).'","'.$dnew.'","'.$id_bots[$zi1].'","1","","'.$x1.'","'.$y1.'","0",""),'; - } - $zi1++; + unset($vls32, $ins232); + // + $map = []; + $mapsp = mysql_query('SELECT `x`,`y` FROM `dungeon_map` WHERE `id_dng` = 6'); + while ($mappl = mysql_fetch_array($mapsp)) { + $map[] = ['x' => $mappl['x'], 'y' => $mappl['y']]; + } + $mapu = $map; + // + $ii1 = 0; + while ($ii1 < count($map)) { + // 2 + $itbsrnd = $itbs[rand(0, count($itbs) - 1)]; + $mp = rand(0, count($map) - 1); + // + $x1 = $map[$mp]['x']; + $y1 = $map[$mp]['y']; + // + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ( + "' . $dnew . '","' . $itbsrnd . '","' . (time() - 600) . '","' . $x1 . '","' . $y1 . '" + )' + ); + // + $ii1++; } - $vls0 = rtrim($vls0,','); - $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`go_bot`,`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls0.''); - */ - // - $newkor = array(); - while( $pl_u = mysql_fetch_array($sp_u) ) { - if( $i < 12 && !isset($usrlst[$pl_u['uid']]) ) { - // - $usrlst[$pl_u['uid']] = true; - $bus = mysql_fetch_array(mysql_query('SELECT `align`,`chatColor`,`molch1`,`molch2`,`id`,`login`,`clan`,`align`,`level`,`sex`,`online`,`room` FROM `users` WHERE `id` = "'.mysql_real_escape_string($pl_u['uid']).'" LIMIT 1')); - if(date('w') == 0 || date('w') == 6 || date('w') == 3) { - mysql_query('UPDATE `stats` SET `repexp` = `repexp` + 5 WHERE `id` = "'.$bus['id'].'" LIMIT 1'); - } - else - { - mysql_query('UPDATE `stats` SET `repexp` = `repexp` + 5 WHERE `id` = "'.$bus['id'].'" LIMIT 1'); - } - // - //changeSleep($bus['id'],1); - //mysql_query('UPDATE `eff_users` SET `sleeptime` = "'.time().'",`bs` = "1" WHERE `uid` = "'.$bus['id'].'" AND `delete` = "0" AND `no_Ace` = "0"'); - // - - $bus['login_BIG'] = ''; - if( $bus['align'] > 0 ) { - $bus['login_BIG'] .= ''; - } - if( $bus['clan'] > 0 ) { - $bus['login_BIG'] .= ''; - } - $bus['login_BIG'] .= ''.$bus['login'].'['.$bus['level'].']'; - $ubss .= ', '.$bus['login_BIG']; - // - // - if( $bus['align'] >= 1 && $bus['align'] < 2 ) { - $bus['align'] = 1; - }elseif( $bus['align'] >= 3 && $bus['align'] < 4 ) { - $bus['align'] = 3; - }elseif( $bus['align'] == 7 ) { - $bus['align'] = 7; - }else{ - $bus['align'] = 0; - } - mysql_query('INSERT INTO `users` (`chatColor`,`align`,`inTurnir`,`molch1`,`molch2`,`activ`,`login`,`room`,`name`,`sex`,`level`,`bithday`) VALUES ( - "'.$bus['chatColor'].'","'.$bus['align'].'","'.$pl['id'].'","'.$bus['molch1'].'","'.$bus['molch2'].'","0","'.$bus['login'].'","362","'.$bus['name'].'","'.$bus['sex'].'","'.$pl['level'].'","'.date('d.m.Y').'")'); - // - $inbot = mysql_insert_id(); // - if( $inbot > 0 ) { - // - // - $mp = rand(0,count($mapu)-1); - - $testxy=0; - $jj=count($newkor); - if ($i == 0) - { - $x1 = $mapu[$mp]['x']; - $y1 = $mapu[$mp]['y']; - $newkor[$i]['x'] = $mapu[$mp]['x']; - $newkor[$i]['y'] = $mapu[$mp]['y']; - } - else - { + // . . + $m1 = $maps[rand(0, count($maps) - 1)]; + $x1 = round($m1[0]); + $y1 = round($m1[1]); + //$itm1 = array( 4174 , 4175 , 4176 , 4177 , 4178 , 4179 , 4180 ); // . + $itm1 = [4176, 4177]; // . + $itm1 = $itm1[rand(0, count($itm1) - 1)]; + if ($itm1 > 0) { + // + $mp = rand(0, count($map) - 1); + // + $x1 = $map[$mp]['x']; + $y1 = $map[$mp]['y']; + // + mysql_query( + 'INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES ( + "' . $dnew . '","' . $itm1 . '","' . (time() - 600) . '","' . $x1 . '","' . $y1 . '" + )' + ); + // + } - while ($testxy<1) - { - $iii=0; - - while ($iii<$jj) - { - if ( ($newkor[$iii]['x'] <= $mapu[$mp]['x'] +3) && ($newkor[$iii]['x'] >= $mapu[$mp]['x'] -3) && ($newkor[$iii]['y'] <= $mapu[$mp]['y'] +3)&& ($newkor[$iii]['y'] >= $mapu[$mp]['y'] -3)) - { - $testxy=1; - } - - $iii++; - } - - if($testxy==1) - { - $mp = rand(0,count($mapu)-1); - $testxy=0; - } - else - { - $testxy=1; - $x1 = $mapu[$mp]['x']; - $y1 = $mapu[$mp]['y']; - $newkor[$i]['x'] = $mapu[$mp]['x']; - $newkor[$i]['y'] = $mapu[$mp]['y']; - } - } - - } - - // - + // () + $newkor = []; + while ($pl_u = mysql_fetch_array($sp_u)) { + if ($i < 12 && !isset($usrlst[$pl_u['uid']])) { + // + $usrlst[$pl_u['uid']] = true; + $bus = mysql_fetch_array( + mysql_query( + 'SELECT `align`,`chatColor`,`molch1`,`molch2`,`id`,`login`,`clan`,`align`,`level`,`sex`,`online`,`room` FROM `users` WHERE `id` = "' . mysql_real_escape_string( + $pl_u['uid'] + ) . '" LIMIT 1' + ) + ); + mysql_query( + 'UPDATE `stats` SET `repexp` = `repexp` + 5 WHERE `id` = "' . $bus['id'] . '" LIMIT 1' + ); - - unset($mapu[$mp]); - // - mysql_query('INSERT INTO `stats` (`timeGo`,`timeGoL`,`upLevel`,`dnow`,`id`,`stats`,`exp`,`ability`,`skills`,`x`,`y`) + $bus['login_BIG'] = ''; + if ($bus['align'] > 0) { + $bus['login_BIG'] .= ''; + } + if ($bus['clan'] > 0) { + $bus['login_BIG'] .= ''; + } + $bus['login_BIG'] .= '' . $bus['login'] . '[' . $bus['level'] . ']'; + $ubss .= ', ' . $bus['login_BIG']; + // + // + if ($bus['align'] >= 1 && $bus['align'] < 2) { + $bus['align'] = 1; + } elseif ($bus['align'] >= 3 && $bus['align'] < 4) { + $bus['align'] = 3; + } elseif ($bus['align'] == 7) { + $bus['align'] = 7; + } else { + $bus['align'] = 0; + } + mysql_query( + 'INSERT INTO `users` (`chatColor`,`align`,`inTurnir`,`molch1`,`molch2`,`activ`,`login`,`room`,`name`,`sex`,`level`,`bithday`) VALUES ( + "' . $bus['chatColor'] . '","' . $bus['align'] . '","' . $pl['id'] . '","' . $bus['molch1'] . '","' . $bus['molch2'] . '","0","' . $bus['login'] . '","362","' . $bus['name'] . '","' . $bus['sex'] . '","' . $pl['level'] . '","' . date( + 'd.m.Y' + ) . '")' + ); + // + $inbot = mysql_insert_id(); // + if ($inbot > 0) { + // + // + $mp = rand(0, count($mapu) - 1); + + + $testxy = 0; + $jj = count($newkor); + if ($i == 0) { + $x1 = $mapu[$mp]['x']; + $y1 = $mapu[$mp]['y']; + $newkor[$i]['x'] = $mapu[$mp]['x']; + $newkor[$i]['y'] = $mapu[$mp]['y']; + } else { + + while ($testxy < 1) { + $iii = 0; + + while ($iii < $jj) { + if (($newkor[$iii]['x'] <= $mapu[$mp]['x'] + 3) && ($newkor[$iii]['x'] >= $mapu[$mp]['x'] - 3) && ($newkor[$iii]['y'] <= $mapu[$mp]['y'] + 3) && ($newkor[$iii]['y'] >= $mapu[$mp]['y'] - 3)) { + $testxy = 1; + } + + $iii++; + } + + if ($testxy == 1) { + $mp = rand(0, count($mapu) - 1); + $testxy = 0; + } else { + $testxy = 1; + $x1 = $mapu[$mp]['x']; + $y1 = $mapu[$mp]['y']; + $newkor[$i]['x'] = $mapu[$mp]['x']; + $newkor[$i]['y'] = $mapu[$mp]['y']; + } + } + + } + + // + + + unset($mapu[$mp]); + // + mysql_query( + 'INSERT INTO `stats` (`timeGo`,`timeGoL`,`upLevel`,`dnow`,`id`,`stats`,`exp`,`ability`,`skills`,`x`,`y`) VALUES ( - "'.(time()+$cnfg['time_puti']).'","'.(time()+$cnfg['time_puti']).'","98","'.$dnew.'","'.$inbot.'", - "s1=3|s2=3|s3=3|s4='.$st2s[$pl['level']][0].'|s5=0|s6=0|rinv=40|m9=5|m6=10","'.$exp2[$pl['level']].'", - "'.$st2s[$pl['level']][1].'","'.$st2s[$pl['level']][2].'","'.$x1.'","'.$y1.'" - )'); - mysql_query('UPDATE `users` SET `inUser` = "'.$inbot.'" WHERE `id` = "'.$bus['id'].'" LIMIT 1'); - } - // - // - mysql_query('INSERT INTO `eff_users` (`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`img2`) VALUES ( - "2","'.$inbot.'","","add_speedhp=30000|add_speedmp=30000|puti='.(time()+$cnfg['time_puti']).'","1","'.(time()+$cnfg['time_puti']).'","chains.gif" - ) '); - // - // - mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'",`inBot` = "'.$inbot.'" WHERE `id` = "'.$pl_u['id'].'" LIMIT 1'); - // - unset($bus['login_BIG']); - $i++; - } - $j++; - } - unset($sp_u,$pl_u,$bus,$usrlst,$testxy,$iii,$jj); - // - $pl['type_btl'] = 0; - // - $m1 = $maps[rand(0,count($maps)-1)]; - $x1 = round($m1[0]); - $y1 = round($m1[1]); - // - unset($mis,$m1,$x1,$y1,$i2); - // - $ubss = ltrim($ubss,', '); - // - // - mysql_query('UPDATE `bs_turnirs` SET `type_btl` = "'.$pl['type_btl'].'", `status` = "1", `users` = "'.$i.'", `arhiv` = "'.$pl['arhiv'].'", `users_finish` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `bsid` = "'.$pl['id'].'" AND `finish` = "0" AND `inBot` = "0"'); - // - $text = ' . : '.$ubss; - mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( - "1", "'.mysql_real_escape_string($text).'", "'.time().'", "'.$pl['id'].'", "'.$pl['count'].'", "'.$pl['city'].'", - "'.round($pl['money']*0.85,2).'","'.$i.'" - )'); - // - e(' , '.$pl['to_lvl'].' . : '.$ubss.'.'); - } - }else{ - // 60 ., - 10 . - if( $pl['status'] == 0 ) { - if( $pl['ch1'] == 0 && $pl['time_start'] - 60*60 < time()) { - mysql_query('UPDATE `bs_turnirs` SET `ch1` = `ch1` + 1 WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - //e(' 5 , '.$pl['to_lvl'].' '.timeOut($pl['time_start']-time()).' ('.date('d.m.Y H:i',$pl['time_start']).'), : '.round($pl['money']*0.85,2).' ., : '.$pl['users'].''); - }elseif( $pl['ch1'] == 1 && $pl['time_start'] - 10*60 < time()) { - mysql_query('UPDATE `bs_turnirs` SET `ch1` = `ch1` + 1 WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - e(' , '.$pl['to_lvl'].' '.timeOut($pl['time_start']-time()).' ('.date('d.m.Y H:i',$pl['time_start']).'), : '.round($pl['money']*0.85,2).' ., 1.00 ., : '.$pl['users'].''); - } - } - } + "' . (time() + $cnfg['time_puti']) . '","' . (time( + ) + $cnfg['time_puti']) . '","98","' . $dnew . '","' . $inbot . '", + "s1=3|s2=3|s3=3|s4=' . $st2s[$pl['level']][0] . '|s5=0|s6=0|rinv=40|m9=5|m6=10","' . $exp2[$pl['level']] . '", + "' . $st2s[$pl['level']][1] . '","' . $st2s[$pl['level']][2] . '","' . $x1 . '","' . $y1 . '" + )' + ); + mysql_query( + 'UPDATE `users` SET `inUser` = "' . $inbot . '" WHERE `id` = "' . $bus['id'] . '" LIMIT 1' + ); + } + // + // + mysql_query( + 'INSERT INTO `eff_users` (`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`img2`) VALUES ( + "2","' . $inbot . '","","add_speedhp=30000|add_speedmp=30000|puti=' . (time( + ) + $cnfg['time_puti']) . '","1","' . (time() + $cnfg['time_puti']) . '","chains.gif" + ) ' + ); + // + // + mysql_query( + 'UPDATE `bs_zv` SET `finish` = "' . time( + ) . '",`inBot` = "' . $inbot . '" WHERE `id` = "' . $pl_u['id'] . '" LIMIT 1' + ); + // + unset($bus['login_BIG']); + $i++; + } + $j++; + } + unset($sp_u, $pl_u, $bus, $usrlst, $testxy, $iii, $jj); + // + $pl['type_btl'] = 0; + // + $m1 = $maps[rand(0, count($maps) - 1)]; + $x1 = round($m1[0]); + $y1 = round($m1[1]); + // + unset($mis, $m1, $x1, $y1, $i2); + // + $ubss = ltrim($ubss, ', '); + // + // + mysql_query( + 'UPDATE `bs_turnirs` SET `type_btl` = "' . $pl['type_btl'] . '", `status` = "1", `users` = "' . $i . '", `arhiv` = "' . $pl['arhiv'] . '", `users_finish` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `bs_zv` SET `finish` = "' . time( + ) . '" WHERE `bsid` = "' . $pl['id'] . '" AND `finish` = "0" AND `inBot` = "0"' + ); + // + $text = ' . : ' . $ubss; + mysql_query( + 'INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES ( + "1", "' . mysql_real_escape_string($text) . '", "' . time( + ) . '", "' . $pl['id'] . '", "' . $pl['count'] . '", "' . $pl['city'] . '", + "' . round($pl['money'] * 0.85, 2) . '","' . $i . '" + )' + ); + // + e(' , ' . $pl['to_lvl'] . ' . : ' . $ubss . '.'); + } + } else { + // 60 ., - 10 . + if ($pl['status'] == 0) { + if ($pl['ch1'] == 0 && $pl['time_start'] - 60 * 60 < time()) { + mysql_query('UPDATE `bs_turnirs` SET `ch1` = `ch1` + 1 WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + //e(' 5 , '.$pl['to_lvl'].' '.timeOut($pl['time_start']-time()).' ('.date('d.m.Y H:i',$pl['time_start']).'), : '.round($pl['money']*0.85,2).' ., : '.$pl['users'].''); + } elseif ($pl['ch1'] == 1 && $pl['time_start'] - 10 * 60 < time()) { + mysql_query('UPDATE `bs_turnirs` SET `ch1` = `ch1` + 1 WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + e( + ' , ' . $pl['to_lvl'] . ' ' . timeOut( + $pl['time_start'] - time() + ) . ' (' . date( + 'd.m.Y H:i', $pl['time_start'] + ) . '), : ' . round( + $pl['money'] * 0.85, 2 + ) . ' ., 1.00 ., : ' . $pl['users'] . '' + ); + } + } + } } echo '#finish#'; -?> \ No newline at end of file diff --git a/cron_trupojor.php b/cron_trupojor.php index b42a8711..711edbdb 100644 --- a/cron_trupojor.php +++ b/cron_trupojor.php @@ -24,8 +24,8 @@ if(!isset($_GET['test'])) 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'); function e($t) { mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' ( ): '.mysql_real_escape_string($t).'","capitalcity","LEL","6","1","-1")'); diff --git a/cron_turnir.php b/cron_turnir.php index c37520b7..c613ce4e 100644 --- a/cron_turnir.php +++ b/cron_turnir.php @@ -1,97 +1,85 @@ '.$_SERVER['SERVER_ADDR']); - } -} +if (!isset($_GET['test']) && getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP( + ) != '31.131.97.206') { + die(getIP() . '
    ' . $_SERVER['SERVER_ADDR']); + } -define('GAME',true); -setlocale(LC_CTYPE ,"ru_RU.CP1251"); +const GAME = true; +setlocale(LC_CTYPE, "ru_RU.CP1251"); include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/__magic.php'); +$u = User::start(); // $sp = mysql_query('SELECT * FROM `battle` WHERE `otmorozok` = 1 AND `team_win` = -1 AND `otmorozok_use` = 0'); -while( $pl = mysql_fetch_array($sp) ) { - if( rand( 0 , 100 ) < 11 ) { - // - mysql_query('UPDATE `battle` SET `otmorozok_use` = 1 WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - // - $usr = mysql_fetch_array(mysql_query('SELECT `level`,`city` FROM `users` WHERE `battle` = "'.$pl['id'].'" ORDER BY `level` DESC LIMIT 1')); - $bot = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` LIKE "% [%'.$usr['level'].'%]%" LIMIT 1')); - // - $tmr = rand(1,2); - // - $logins_bot = array(); - $bot = $u->addNewbot($bot['id'],NULL,NULL,$logins_bot,NULL); - $otmz = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `login` LIKE "% (%" AND `battle` = "'.$pl['id'].'" LIMIT 1')); - // - $otmz[0]++; - // - mysql_query('UPDATE `users` SET `city` = "'.$usr['city'].'",`login` = " ('.$otmz[0].')",`battle` = "'.$pl['id'].'" WHERE `id` = "'.$bot['id'].'" LIMIT 1'); - // - mysql_query('UPDATE `stats` SET `team` = "'.$tmr.'" WHERE `id` = "'.$bot['id'].'" LIMIT 1'); - // - $vtvl = '{tm1} {u1} . ! ! !'; - $last_hod = mysql_fetch_array(mysql_query('SELECT `id_hod` FROM `battle_logs` WHERE `battle` = "'.$pl['id'].'" ORDER BY `id_hod` DESC LIMIT 1')); - $last_hod = $last_hod['id_hod']; - // - $mass = array( - 'time' => time(), - 'battle' => $pl['id'], - 'id_hod' => ($last_hod+1), - 'vars' => '||time1='.time().'||time2=0||s1=0||t1='.$tmr.'||login1= ('.$otmz[0].')', - 'type' => 1 - ); - // - $ins = mysql_query('INSERT INTO `battle_logs` ( +while ($pl = mysql_fetch_array($sp)) { + if (rand(0, 100) < 11) { + // + mysql_query('UPDATE `battle` SET `otmorozok_use` = 1 WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + // + $usr = mysql_fetch_array( + mysql_query( + 'SELECT `level`,`city` FROM `users` WHERE `battle` = "' . $pl['id'] . '" ORDER BY `level` DESC LIMIT 1' + ) + ); + $bot = mysql_fetch_array( + mysql_query('SELECT * FROM `test_bot` WHERE `login` LIKE "% [%' . $usr['level'] . '%]%" LIMIT 1') + ); + // + $tmr = rand(1, 2); + // + $logins_bot = []; + $bot = $u->addNewbot($bot['id'], null, null, $logins_bot, null); + $otmz = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(*) FROM `users` WHERE `login` LIKE "% (%" AND `battle` = "' . $pl['id'] . '" LIMIT 1' + ) + ); + // + $otmz[0]++; + // + mysql_query( + 'UPDATE `users` SET `city` = "' . $usr['city'] . '",`login` = " (' . $otmz[0] . ')",`battle` = "' . $pl['id'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1' + ); + // + mysql_query('UPDATE `stats` SET `team` = "' . $tmr . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'); + // + $vtvl = '{tm1} {u1} . ! ! !'; + $last_hod = mysql_fetch_array( + mysql_query( + 'SELECT `id_hod` FROM `battle_logs` WHERE `battle` = "' . $pl['id'] . '" ORDER BY `id_hod` DESC LIMIT 1' + ) + ); + $last_hod = $last_hod['id_hod']; + // + $mass = [ + 'time' => time(), + 'battle' => $pl['id'], + 'id_hod' => ($last_hod + 1), + 'vars' => '||time1=' . time() . '||time2=0||s1=0||t1=' . $tmr . '||login1= (' . $otmz[0] . ')', + 'type' => 1, + ]; + // + $ins = mysql_query( + 'INSERT INTO `battle_logs` ( `time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type` ) VALUES ( - "'.$mass['time'].'", - "'.$mass['battle'].'", - "'.$mass['id_hod'].'", - "'.$vtvl.'", - "'.$mass['vars'].'", + "' . $mass['time'] . '", + "' . $mass['battle'] . '", + "' . $mass['id_hod'] . '", + "' . $vtvl . '", + "' . $mass['vars'] . '", "", "", "", "", - "'.$mass['type'].'" - )'); - } + "' . $mass['type'] . '" + )' + ); + } } -// - -die(); - -// 2-3 -$inc = mysql_query('INSERT INTO `zayvki` ( - `arand`,`noatack`,`city`,`creator`,`type`,`time_start`,`timeout`,`min_lvl_1`,`min_lvl_2`,`max_lvl_1`,`max_lvl_2`,`noinc`,`razdel`,`time`,`fastfight`,`priz` -) VALUES ( - "1","1","capitalcity","0","0","300","120","2","2","3","3","1","5","'.time().'","1","1" -), ( - "1","1","capitalcity","0","0","300","120","4","4","6","6","1","5","'.time().'","1","1" -), ( - "1","1","capitalcity","0","0","300","120","7","7","7","7","1","5","'.time().'","1","1" -), ( - "1","1","capitalcity","0","0","300","120","8","8","8","8","1","5","'.time().'","1","1" -), ( - "1","1","capitalcity","0","0","300","120","9","9","9","9","1","5","'.time().'","1","1" -), ( - "1","1","capitalcity","0","0","300","120","10","10","10","10","1","5","'.time().'","1","1" -)'); - -if($inc) { - echo 'true'; -}else{ - echo 'false'; -} -?> \ No newline at end of file diff --git a/cron_vs.php b/cron_vs.php deleted file mode 100644 index cf1c3b39..00000000 --- a/cron_vs.php +++ /dev/null @@ -1,113 +0,0 @@ -'.$_SERVER['SERVER_ADDR']); - } -} - -echo '#start#'; -define('GAME',true); -setlocale(LC_CTYPE ,"ru_RU.CP1251"); -include('_incl_data/__config.php'); -include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/__magic.php'); -// -$cfg = array( - 'H' => 17 // -); -// -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")'); - echo '[SEND_CHAT]'; -} -// -$bot1 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "" LIMIT 1')); -$bot2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "" LIMIT 1')); -// -$st1 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "'.$bot1['id'].'" LIMIT 1')); -$st2 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "'.$bot2['id'].'" LIMIT 1')); -// -$td = mysql_fetch_array(mysql_query('SELECT * FROM `vs_stat` WHERE (`d` = "'.date('d').'" AND `m` = "'.date('m').'" AND `y` = "'.date('Y').'") OR `winner` = -1 ORDER BY `time` ASC LIMIT 1')); -// -if(!isset($td['id'])) { - // - $ins = mysql_query('INSERT INTO `vs_stat` ( - `time`,`d`,`m`,`y`,`act`,`type`,`uid` - ) VALUES ( - "'.time().'","'.date('d').'","'.date('m').'","'.date('Y').'","1","0","0" - )'); - // - if(!$ins) { - echo '#ERROR_INSERT_DATA#'; - }else{ - $td = mysql_fetch_array(mysql_query('SELECT * FROM `vs_stat` WHERE `d` = "'.date('d').'" AND `m` = "'.date('m').'" AND `y` = "'.date('Y').'" ORDER BY `time` LIMIT 1')); - } - // -} -if(isset($td['id'])) { - // - echo '#type'.$td['type'].'#'; - // - if( $td['type'] == 0 ) { - if( date('H') == $cfg['H'] ) { - send_chat(1,'',' , !',time()); - send_chat(1,'',': - , , :vamp:',time()); - send_chat(1,'',': :grace:',time()); - // - mysql_query('INSERT INTO `battle` ( - `city`,`time_start`,`timeout`,`type`,`noinc` - ) VALUES ( - "capitalcity","'.time().'","180","180","1" - )'); - // - $btl_id = mysql_insert_id(); - if( $btl_id > 0 ) { - // - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'",`online` = "'.(time()+3600).'" WHERE `id` = "'.$bot1['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'",`online` = "'.(time()+3600).'" WHERE `id` = "'.$bot2['id'].'" LIMIT 1'); - // - mysql_query('UPDATE `stats` SET `hpNow` = "1000000",`mpNow` = "1000000",`team` = 1 WHERE `id` = "'.$bot1['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `hpNow` = "1000000",`mpNow` = "1000000",`team` = 2 WHERE `id` = "'.$bot2['id'].'" LIMIT 1'); - // - mysql_query('UPDATE `vs_stat` SET `type` = "1",`battle` = "'.$btl_id.'" WHERE `id` = "'.$td['id'].'" LIMIT 1'); - // - } - // - } - }elseif( $td['type'] == 1 ) { - // - $bt = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$bot1['battle'].'" AND `id` = "'.$bot2['battle'].'" LIMIT 1')); - //// - mysql_query('UPDATE `users` SET `online` = "'.(time()+3600).'" WHERE `id` = "'.$bot1['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `online` = "'.(time()+3600).'" WHERE `id` = "'.$bot2['id'].'" LIMIT 1'); - // - if( $st1['bot'] != 2 ) { - mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "'.$bot1['id'].'" LIMIT 1'); - } - if( $st2['bot'] != 2 ) { - mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "'.$bot2['id'].'" LIMIT 1'); - } - // - if( $st1['hpNow'] < 1 || $st2['hpNow'] < 1 || $bot1['battle'] == 0 || $bot2['battle'] == 0 ) { - // , - - - }else{ - // , - - } - // - } - // -} -// -// -echo '#finish#'; -?> \ No newline at end of file diff --git a/cron_zv.php b/cron_zv.php index 5e9423c6..0cc69d0e 100644 --- a/cron_zv.php +++ b/cron_zv.php @@ -1,72 +1,26 @@ '.$_SERVER['SERVER_ADDR']); -} - - -define('GAME',true); +const GAME = true; include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/__zv.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').' ( ): '.mysql_real_escape_string($t).'","capitalcity","LEL","6","1","-1")'); +$query = 'select id, pass from users where battle in (select id from battle where team_win = -1 and time_over = 0 and time_start < unix_timestamp() - 3600)'; +$sp = Db::getRows($query); + +foreach ($sp as $pl) { + if (!$pl['id']) { + continue; + } + $uid = $pl['id']; + $pass = $pl['pass']; + $cron_core = md5($uid . '_brfCOreW@!_' . $pass); + echo file_get_contents("https://new-combats.com/jx/battle/refresh.php?uid=$uid&cron_core=$cron_core&pass=$pass"); + echo '
    '; } -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")'); -} - -function inuser_go_btl($id) { - if(isset($id['id'])) { - echo file_get_contents('https://new-combats.com/jx/battle/refresh.php?uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass']); - echo '
    '; - } -} - -// -$sp = mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `team_win` = "-1" AND `time_over` = "0" AND `time_start` < "'.(time()-3600).'" LIMIT 100'); -while($pl = mysql_fetch_array($sp)) { - $user1 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `battle` = "'.$pl['id'].'" LIMIT 1')); - inuser_go_btl($user1); - //sleep(1); -} - -// -/* -$sp = mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `team_win` = -1'); -while( $pl = mysql_fetch_array($sp) ) { - $test = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$pl['id'].'" ORDER BY `id` DESC LIMIT 1')); - $end = 0; - if(!isset($test['id']) && $pl['time_start'] < time() - 3600 ) { - $end = 1; - }elseif( $test['time'] < time() - 3600 ) { - $end = 1; - } - e($pl['id']); - if( $end == 1 ) { - mysql_query('UPDATE `battle` SET `team_win` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `battle` = "0" WHERE `battle` = "'.$pl['id'].'" LIMIT 1'); - } -} -*/ - +$zv = new FightRequest(); $zv->testCronZv(); -?> diff --git a/dn_editor.php b/dn_editor.php index 3f5779d0..2bd5ffff 100644 --- a/dn_editor.php +++ b/dn_editor.php @@ -1,1170 +1,1433 @@ -

    :

    '.$e.'


    (c) '.$c[1].'

    '); -} - -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()); -define('GAME',true); +info['admin'] == 0) { - die(''); +if (!$u->info['admin']) { + die(''); } -if(isset($_GET['id'])) { - $_POST['id'] = (int)$_GET['id']; +if (isset($_GET['id'])) { + $_POST['id'] = (int)$_GET['id']; } -if(isset($_POST['id_dng'])) { - $id = (int)$_POST['id_dng']; - if($id > 0) { - $test_id = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.mysql_real_escape_string($id).'" LIMIT 1')); - if(!isset($test_id['id'])) { - unset($test_id); - } - }else{ - $id = 0; - } -}elseif(isset($_POST['id'])) { - $id = (int)$_POST['id']; - if($id > 0) { - $test_id = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.mysql_real_escape_string($id).'" LIMIT 1')); - if(!isset($test_id['id'])) { - unset($test_id); - } - }else{ - $id = 0; - } +if (isset($_POST['id_dng'])) { + $id = (int)$_POST['id_dng']; + if ($id > 0) { + $test_id = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . mysql_real_escape_string($id) . '" LIMIT 1') + ); + if (!isset($test_id['id'])) { + unset($test_id); + } + } else { + $id = 0; + } +} elseif (isset($_POST['id'])) { + $id = (int)$_POST['id']; + if ($id > 0) { + $test_id = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . mysql_real_escape_string($id) . '" LIMIT 1') + ); + if (!isset($test_id['id'])) { + unset($test_id); + } + } else { + $id = 0; + } } - $u->info['psevdo_x'] = 0; - $u->info['psevdo_y'] = 0; - $u->info['psevdo_s'] = 1; - - if(isset($_POST['x'])) { - $u->info['psevdo_x'] = (int)$_POST['x']; - $u->info['psevdo_y'] = (int)$_POST['y']; - $u->info['psevdo_s'] = (int)$_POST['s']; - } - - if(isset($_GET['x'])) { - $u->info['psevdo_x'] = (int)$_GET['x']; - $u->info['psevdo_y'] = (int)$_GET['y']; - $u->info['psevdo_s'] = (int)$_GET['s']; - } - -if(isset($_POST['saveObjPosition'])) { - echo 'START#'; - $_POST['saveObjPosition'] = str_replace('obj_true_','',$_POST['saveObjPosition']); - $_POST['saveObjPosition'] = floor((int)$_POST['saveObjPosition']); - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_obj` WHERE `id` = "'.mysql_real_escape_string($_POST['saveObjPosition']).'" LIMIT 1')); - if(isset($obj['id'])) { - $cor = array(0,0); - $data = explode(',',ltrim(rtrim($obj['date'],'\}'),'\{')); - $da = array(); - $i = 0; - while($i < count($data)) { - $data[$i] = explode(':',$data[$i]); - $da[$data[$i][0]] = $data[$i][1]; - echo '['.$data[$i][0].' = '.$data[$i][1].']'; - $i++; - } - $obj['top'] = 0; - $obj['left'] = 0; - $rs = (int)$_POST['rz']; - $da['rt'.$rs] = 0+$_POST['objy']; - $da['rl'.$rs] = 0+$_POST['objx']; - - $dak = array_keys($da); - $dav = $da; - $da = ''; - $i = 0; - while($i < count($dak)) { - $da .= $dak[$i].':'.$dav[$dak[$i]].','; - $i++; - } - $da = rtrim($da,','); - $da = '{'.$da.'}'; - $upd = mysql_query('UPDATE `dungeon_obj` SET `top` = "'.mysql_real_escape_string($obj['top']).'", `left` = "'.mysql_real_escape_string($obj['left']).'", `date` = "'.mysql_real_escape_string($da).'" WHERE `id` = "'.$obj['id'].'" LIMIT 1'); - if($upd) { - echo ' '.$da; - }else{ - echo '#!'; - } - }else{ - echo '#'; - } - die('#END'); -}elseif(isset($_POST['ore_id'])) { - $id = (int)$_POST['id_dng']; - echo '[START# '; - $_POST['ore_id'] = floor((int)$_POST['ore_id']); - $obj = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_obj` WHERE `id` = "'.mysql_real_escape_string($_POST['ore_id']).'" LIMIT 1')); - $_POST['ore_name'] = iconv("UTF-8", "cp1251",$_POST['ore_name']); - if(isset($obj['id'])) { - mysql_query('UPDATE `dungeon_obj` SET - `name` = "'.mysql_real_escape_string($_POST['ore_name']).'", - `img` = "'.mysql_real_escape_string($_POST['ore_img']).'", - `w` = "'.mysql_real_escape_string($_POST['ore_w']).'", - `h` = "'.mysql_real_escape_string($_POST['ore_h']).'", - `x` = "'.mysql_real_escape_string($_POST['ore_x']).'", - `y` = "'.mysql_real_escape_string($_POST['ore_y']).'", +$u->info['psevdo_x'] = 0; +$u->info['psevdo_y'] = 0; +$u->info['psevdo_s'] = 1; + +if (isset($_POST['x'])) { + $u->info['psevdo_x'] = (int)$_POST['x']; + $u->info['psevdo_y'] = (int)$_POST['y']; + $u->info['psevdo_s'] = (int)$_POST['s']; +} + +if (isset($_GET['x'])) { + $u->info['psevdo_x'] = (int)$_GET['x']; + $u->info['psevdo_y'] = (int)$_GET['y']; + $u->info['psevdo_s'] = (int)$_GET['s']; +} + +if (isset($_POST['saveObjPosition'])) { + echo 'START#'; + $_POST['saveObjPosition'] = str_replace('obj_true_', '', $_POST['saveObjPosition']); + $_POST['saveObjPosition'] = floor((int)$_POST['saveObjPosition']); + $obj = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `dungeon_obj` WHERE `id` = "' . mysql_real_escape_string( + $_POST['saveObjPosition'] + ) . '" LIMIT 1' + ) + ); + if (isset($obj['id'])) { + $cor = [0, 0]; + $data = explode(',', ltrim(rtrim($obj['date'], '\}'), '\{')); + $da = []; + $i = 0; + while ($i < count($data)) { + $data[$i] = explode(':', $data[$i]); + $da[$data[$i][0]] = $data[$i][1]; + echo '[' . $data[$i][0] . ' = ' . $data[$i][1] . ']'; + $i++; + } + $obj['top'] = 0; + $obj['left'] = 0; + $rs = (int)$_POST['rz']; + $da['rt' . $rs] = 0 + $_POST['objy']; + $da['rl' . $rs] = 0 + $_POST['objx']; + + $dak = array_keys($da); + $dav = $da; + $da = ''; + $i = 0; + while ($i < count($dak)) { + $da .= $dak[$i] . ':' . $dav[$dak[$i]] . ','; + $i++; + } + $da = rtrim($da, ','); + $da = '{' . $da . '}'; + $upd = mysql_query( + 'UPDATE `dungeon_obj` SET `top` = "' . mysql_real_escape_string( + $obj['top'] + ) . '", `left` = "' . mysql_real_escape_string($obj['left']) . '", `date` = "' . mysql_real_escape_string( + $da + ) . '" WHERE `id` = "' . $obj['id'] . '" LIMIT 1' + ); + if ($upd) { + echo ' ' . $da; + } else { + echo '#!'; + } + } else { + echo '#'; + } + die('#END'); +} elseif (isset($_POST['ore_id'])) { + $id = (int)$_POST['id_dng']; + echo '[START# '; + $_POST['ore_id'] = floor((int)$_POST['ore_id']); + $obj = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `dungeon_obj` WHERE `id` = "' . mysql_real_escape_string($_POST['ore_id']) . '" LIMIT 1' + ) + ); + $_POST['ore_name'] = iconv("UTF-8", "cp1251", $_POST['ore_name']); + if (isset($obj['id'])) { + mysql_query( + 'UPDATE `dungeon_obj` SET + `name` = "' . mysql_real_escape_string($_POST['ore_name']) . '", + `img` = "' . mysql_real_escape_string($_POST['ore_img']) . '", + `w` = "' . mysql_real_escape_string($_POST['ore_w']) . '", + `h` = "' . mysql_real_escape_string($_POST['ore_h']) . '", + `x` = "' . mysql_real_escape_string($_POST['ore_x']) . '", + `y` = "' . mysql_real_escape_string($_POST['ore_y']) . '", - `type2` = "'.mysql_real_escape_string($_POST['ore_type2']).'", - `s` = "'.mysql_real_escape_string($_POST['ore_s']).'", - `s2` = "'.mysql_real_escape_string($_POST['ore_s2']).'", - `os1` = "'.mysql_real_escape_string($_POST['ore_os1']).'", - `os2` = "'.mysql_real_escape_string($_POST['ore_os2']).'", - `os3` = "'.mysql_real_escape_string($_POST['ore_os3']).'", - `os4` = "'.mysql_real_escape_string($_POST['ore_os4']).'", - `fix_x_y` = "'.mysql_real_escape_string($_POST['ore_fix_x_y']).'", + `type2` = "' . mysql_real_escape_string($_POST['ore_type2']) . '", + `s` = "' . mysql_real_escape_string($_POST['ore_s']) . '", + `s2` = "' . mysql_real_escape_string($_POST['ore_s2']) . '", + `os1` = "' . mysql_real_escape_string($_POST['ore_os1']) . '", + `os2` = "' . mysql_real_escape_string($_POST['ore_os2']) . '", + `os3` = "' . mysql_real_escape_string($_POST['ore_os3']) . '", + `os4` = "' . mysql_real_escape_string($_POST['ore_os4']) . '", + `fix_x_y` = "' . mysql_real_escape_string($_POST['ore_fix_x_y']) . '", - `type` = "'.mysql_real_escape_string($_POST['ore_type']).'" WHERE `id` = "'.$obj['id'].'" LIMIT 1 - '); - echo ' '; - }else{ - // - /* - $('#ore_id').val(op[0]); - $('#ore_img').val(op[4]); - $('#ore_name').val(op[1]); - $('#ore_x').val(op['x']); - $('#ore_y').val(op['y']); - $('#ore_t').val(top.obi['t']); - $('#ore_l').val(top.obi['l']); - $('#ore_w').val(op[7]); - $('#ore_h').val(op[8]); - */ - if(isset($_POST['ore_img'])) { - echo ' '; - if(mysql_query('INSERT INTO `dungeon_obj` (`for_dn`,`name`,`img`,`w`,`h`,`x`,`y`,`type2`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`fix_x_y`,`type`,`date`) VALUES ( - "'.mysql_real_escape_string($id).'", - "'.mysql_real_escape_string($_POST['ore_name']).'", - "'.mysql_real_escape_string($_POST['ore_img']).'", - "'.mysql_real_escape_string($_POST['ore_w']).'", - "'.mysql_real_escape_string($_POST['ore_h']).'", - "'.mysql_real_escape_string($_POST['ore_x']).'", - "'.mysql_real_escape_string($_POST['ore_y']).'", - "'.mysql_real_escape_string($_POST['ore_type2']).'", - "'.mysql_real_escape_string($_POST['ore_s']).'", - "'.mysql_real_escape_string($_POST['ore_s2']).'", - "'.mysql_real_escape_string($_POST['ore_os1']).'", - "'.mysql_real_escape_string($_POST['ore_os2']).'", - "'.mysql_real_escape_string($_POST['ore_os3']).'", - "'.mysql_real_escape_string($_POST['ore_os4']).'", - "'.mysql_real_escape_string($_POST['ore_fix_x_y']).'", - "'.mysql_real_escape_string($_POST['ore_type']).'", + `type` = "' . mysql_real_escape_string($_POST['ore_type']) . '" WHERE `id` = "' . $obj['id'] . '" LIMIT 1 + ' + ); + echo ' '; + } else { + if (isset($_POST['ore_img'])) { + echo ' '; + if (mysql_query( + 'INSERT INTO `dungeon_obj` (`for_dn`,`name`,`img`,`w`,`h`,`x`,`y`,`type2`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`fix_x_y`,`type`,`date`) VALUES ( + "' . mysql_real_escape_string($id) . '", + "' . mysql_real_escape_string($_POST['ore_name']) . '", + "' . mysql_real_escape_string($_POST['ore_img']) . '", + "' . mysql_real_escape_string($_POST['ore_w']) . '", + "' . mysql_real_escape_string($_POST['ore_h']) . '", + "' . mysql_real_escape_string($_POST['ore_x']) . '", + "' . mysql_real_escape_string($_POST['ore_y']) . '", + "' . mysql_real_escape_string($_POST['ore_type2']) . '", + "' . mysql_real_escape_string($_POST['ore_s']) . '", + "' . mysql_real_escape_string($_POST['ore_s2']) . '", + "' . mysql_real_escape_string($_POST['ore_os1']) . '", + "' . mysql_real_escape_string($_POST['ore_os2']) . '", + "' . mysql_real_escape_string($_POST['ore_os3']) . '", + "' . mysql_real_escape_string($_POST['ore_os4']) . '", + "' . mysql_real_escape_string($_POST['ore_fix_x_y']) . '", + "' . mysql_real_escape_string($_POST['ore_type']) . '", "{use:\'takeit\'}" - )')) { - echo '+'; - }else{ - echo '-'; - } - } - } - die(' #END]'); -}elseif(isset($_POST['ore_delete_id'])) { - mysql_query('UPDATE `dungeon_obj` SET `delete` = "'.$u->info['id'].'",`for_dn` = "'.time().'" WHERE `id` = "'.mysql_real_escape_string($_POST['ore_delete_id']).'" LIMIT 1'); - die('[START# #END]'); + )' + )) { + echo '+'; + } else { + echo '-'; + } + } + } + die(' #END]'); +} elseif (isset($_POST['ore_delete_id'])) { + mysql_query( + 'UPDATE `dungeon_obj` SET `delete` = "' . $u->info['id'] . '",`for_dn` = "' . time( + ) . '" WHERE `id` = "' . mysql_real_escape_string($_POST['ore_delete_id']) . '" LIMIT 1' + ); + die('[START# #END]'); } -if($id > 0) { - // - $pd = array( - 1 =>0, - 2 =>0, - 3 =>0, - 4 =>0, - 5 =>0, - 6 =>0, - 7 =>0, - 8 =>0, - 9 =>0, // , 2- - 10=>0, - 11=>0, - 12=>0, - 13=>0, - 14=>0, - 15=>0, - 16=>0, - 17=>0, - 18=>0, - 19=>0, - 20=>0, - 21=>0, - 22=>0, - 23=>0, - /* : 1 */ - 24=>0, // (1) - 25=>0, // (1) - 26=>0, // (1) - 27=>0, // (1) - 28=>0 // (1) - ); - - include('dn_editor_class.php'); - - $d->point = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.$d->info['id2'].'" AND `x` = "'.$u->info['x'].'" AND `y` ="'.$u->info['y'].'" LIMIT 1')); - if(!isset($d->point['id'])) - { - $d->point['css'] = 'css'; - } +if ($id > 0) { + // + $pd = [ + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 0, + 8 => 0, + 9 => 0, // , 2- + 10 => 0, + 11 => 0, + 12 => 0, + 13 => 0, + 14 => 0, + 15 => 0, + 16 => 0, + 17 => 0, + 18 => 0, + 19 => 0, + 20 => 0, + 21 => 0, + 22 => 0, + 23 => 0, + /* : 1 */ + 24 => 0, // (1) + 25 => 0, // (1) + 26 => 0, // (1) + 27 => 0, // (1) + 28 => 0 // (1) + ]; + + $d = new DungeonEditor(); + $d->start(); + + $d->point = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $d->info['id2'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` ="' . $u->info['y'] . '" LIMIT 1' + ) + ); + if (!isset($d->point['id'])) { + $d->point['css'] = 'css'; + } } -if(!isset($_GET['look'])) { +if (!isset($_GET['look'])) { ?> - - © new-combats.com + + © new-combats.com - - - - - + + + + + - + -'; }else{ ?> -function genMap(){ - var i = 0, m = false, mz = false; - while(i=1) - { - if(zfloor0[i]!='') - { - document.getElementById('Floor0').innerHTML += zfloor0[i]; - } - i--; - } -} -var dConfig={ - 2:{ - 1:{'top':50,'left':140,'w':80,'h':147}, - 2:{'top':45,'left':87,'w':80,'h':147}, - 3:{'top':45,'left':192,'w':80,'h':147}, - 4:{'top':49,'left':165,'w':80,'h':147}, - 5:{'top':49,'left':105,'w':80,'h':147}, - 6:{'top':53,'left':140,'w':80,'h':147}, - 7:{'top':53,'left':87,'w':80,'h':147}, - 8:{'top':53,'left':190,'w':80,'h':147} - }, - 3:{ - 1:{'top':60,'left':152,'w':53,'h':97}, - 2:{'top':58,'left':110,'w':53,'h':97}, - 3:{'top':58,'left':188,'w':53,'h':97}, - 4:{'top':61,'left':168,'w':53,'h':97}, - 5:{'top':61,'left':128,'w':53,'h':97}, - 6:{'top':62,'left':153,'w':53,'h':97}, - 7:{'top':62,'left':113,'w':53,'h':97}, - 8:{'top':62,'left':193,'w':53,'h':97}}, - 4:{ - 1:{'top':70,'left':158,'w':35,'h':64}, - 2:{'top':68,'left':125,'w':35,'h':64}, - 3:{'top':68,'left':193,'w':35,'h':64}, - 4:{'top':71,'left':173,'w':35,'h':64}, - 5:{'top':71,'left':137,'w':35,'h':64}, - 6:{'top':73,'left':158,'w':35,'h':64}, - 7:{'top':73,'left':129,'w':35,'h':64}, - 8:{'top':73,'left':193,'w':35,'h':64} - } -} -var dConfigObj = { - 1: { - 0: { - 'top':65, - 'left':110, - 'w':1, - 'h':1 - } - } - ,2: { - 0: { - 'top':65, - 'left':110, - 'w':0.65, - 'h':0.65 - } - }, - 3: { - 0: { - 'top':65, - 'left':110, - 'w':0.48, - 'h':0.48 - } - }, - 4: { - 0: { - 'top':65, - 'left':110, - 'w':0.35, - 'h':0.35 - } - } -} -var prob = { - 0: { - 1:1, - 2:0.25, - 3:-0.10, - 4:-0.38 - }, - 1: { - 1:0.90, - 2:0.50, - 3:0.23, - 4:0.05 - } -}; - -function addObj(v,mz,iii){ - var r = ''; - //355*245 window - var rz = 0; // - if(v[2]>=1 && v[2]<=3) { rz = 1; } - if(v[2]>=4 && v[2]<=6) { rz = 2; } - if(v[2]>=7 && v[2]<=9) { rz = 3; } - if(v[2]>=10 && v[2]<=14) { rz = 4; } - if(v[2]>=15 && v[2]<=19) { rz = 5; } - if(v[5]==dsee) { rz -= 1; } - if(dConfigObj[rz]!=undefined && dConfigObj[rz][v[6]]!=undefined) { - new_w = v[7]*dConfigObj[rz][v[6]]['w']; - new_h = v[8]*dConfigObj[rz][v[6]]['h']; - new_left = dConfigObj[rz][v[6]]['left']-Math.round((v[7]*prob[0][rz])/4); - new_top = dConfigObj[rz][v[6]]['top']-Math.round((v[8]*prob[1][rz])/4); - if(v[2]==6) { new_left += 195; new_top -= 5; } - if(v[2]==4) { new_left -= 195; new_top -= 5; } - if( v[2]==9) { new_left -= 140; new_top -= 2; } - if( v[2]==7){ new_left += 140; new_top -= 2; } - if( v[2]==13){ new_left += 100; new_top -= 1; } - if( v[2]==11){ new_left -= 100; new_top -= 0; } - if( v[9]!=0){ new_left += Math.round(new_left/(100+(rz-1)*10)*v[9]+rz*0.25); } - if( v[10]!=0){ new_top += Math.round(new_h/2+new_top/(100+(rz-1)*50)*v[10]-rz*3.3); } - if( rz == 4 ){ new_top += 3; } - if( v[11] != 0 ) { - if(v[11]['t'+rz]!=undefined) { new_top += v[11]['t'+rz]; } - if(v[11]['l'+rz]!=undefined) { new_left += v[11]['l'+rz]; } - if(v[11]['w'+rz]!=undefined) { new_w += v[11]['w'+rz]; } - if(v[11]['h'+rz]!=undefined) { new_h += v[11]['h'+rz]; } - if(v[11]['rt'+rz]!=undefined) { new_top = v[11]['rt'+rz]; } - if(v[11]['rl'+rz]!=undefined) { new_left = v[11]['rl'+rz]; } - } - ////i:{0:id,1:name,2:mapPoint,3:action,4:img,5:type}, - if( rz >= 1 && rz <= 2 ) { - actionNow = ''; - if( v[11]['use'] != undefined ) { - if( v[11]['use'] == 'exit' ) { - actionNow = 'alert(\' \');'; - } else if( v[11]['use'] == 'takeit' ) { - actionNow = 'location=\'main.php?take_obj='+v[0]+'&rnd='+0.28626200682069150+'\';'; - } - } - zfloor0[rz] = ''+zfloor0[rz]; - } else { - zfloor0[rz] = ''+zfloor0[rz]; - } - r = ''; - } - return r; -} -function addUser(v,mz) { - var r = ''; - var rz = 0; // - if(v[2]>=1 && v[2]<=3){ rz = 1; } - if(v[2]>=4 && v[2]<=6){ rz = 2; } - if(v[2]>=7 && v[2]<=9){ rz = 3; } - if(v[2]>=10 && v[2]<=14){ rz = 4; } - if(v[2]>=15 && v[2]<=19){ rz = 5; } - if(dConfig[rz]!=undefined && dConfig[rz][v[6]]!=undefined) { - new_w = dConfig[rz][v[6]]['w']; - new_h = dConfig[rz][v[6]]['h']; - new_left = dConfig[rz][v[6]]['left']; - new_top = dConfig[rz][v[6]]['top']; - if(v[2]==6) { new_left += 215; new_top -= 5; } - if(v[2]==4) { new_left -= 215; new_top -= 5; } - if(v[2]==9) { new_left -= 155; new_top -= 2; } - if(v[2]==7) { new_left += 155; new_top -= 2; } - if(v[2]==13) { new_left += 115; new_top -= 1; } - if(v[2]==11) { new_left -= 115; new_top -= 1; } - if(v[2]>=11 && v[2]<=13) { new_top += 5; } - if(rz>=1 && rz<=2) { - action = ''; - if( v[5]=='bot' || 0 > 0 ) { action = 'dialogMenu('+v[0]+',1,'+v[7]+',0,0,event);'; } - zfloor0[rz] += ''; - } else { - zfloor0[rz] += ''; - } - r = ''; - } - return r; -} -speedLoc = 0; -sLoc1 = 0; -sLoc2 = 0; -tgo = 0; -tgol = 0; -gotoup777 = 0; -gotext777 = ''; -function cancelgoto() { - document.getElementById('gotext777').innerHTML = ''; - gotoup777 = 0; - gotext777 = ''; -} -function goToLoca(id,ttl) { - if(tgo < 1) { - location = 'main.php?go='+id; - }else{ - gotoup777 = id; - gotext777 = ttl; - } -} -function locGoLineDng() -{ - var line = document.getElementById('pline1'); - if(line!=undefined) - { - - prc = 100-Math.floor(tgo/tgol*100); - sLoc1 = 108/100*prc; - if(sLoc1<1) - { - sLoc1 = 1; - } - - if(sLoc1>108) - { - sLoc1 = 108; - } - - line.style.width = sLoc1+'px'; - if(tgo>0) - { - tgo -= 1; - setTimeout('locGoLineDng()',100); - }else{ - if(gotoup777 > 0) { - location = "main.php?go="+gotoup777; - } - } - if(gotoup777 > 0 && gotext777 != '' && document.getElementById('gotext777').innerHTML != ' '+gotext777+' ()') { - //document.getElementById('gotext777').style.display = 'block'; - document.getElementById('gotext777').innerHTML = ' '+gotext777+' ()'; - }else if(document.getElementById('gotext777').innerHTML != '' && gotoup777 == 0 && gotext777 == '') { - //document.getElementById('gotext777').style.display = 'none'; - document.getElementById('gotext777').innerHTML = ''; - } - } -} + var obi = { + 'obj': 0, + 'w': 0, + 'h': 0, + 't': 0, + 'l': 0, + 'position': 0, + 'val': 0 + }; + } - + var sel_id = 0, sel_x = 0, sel_y = 0, sel_s = 1; - + $('#dngseemap').html(''); + + if (top.sel_s < 1) { + top.sel_s = 4; + } + + if (top.sel_s > 4) { + top.sel_s = 1; + } + + if (top.sel_id > 0) { + $('#px_' + top.sel_id).css({'background-color': ''}); + $('#px_' + top.sel_id).attr({'className': 'cq'}); + } + + $('#px_' + id).css({'background-color': '#ffd5d5'}); + + top.obi = { + 'obj': 0, + 'w': 0, + 'h': 0, + 't': 0, + 'l': 0, + 'position': 0, + 'val': 0 + }; + + top.sel_id = id; + top.sel_x = x; + top.sel_y = y; + + $('#fm1').attr("src", "dn_editor_bots.php?id_dn=&xx=" + x + "&&yy=" + y + ""); + $.post('dn_editor.php?look=1', {id: , id_p: id, x: x, y: y, s: top.sel_s}, function (data) { + $('#dngseemap').html(data); + }); + } + + function dialogMenu(id, atk, talk, look, take, e) { + var d = document.getElementById('deMenu'); + if (d != undefined) { + if (e == undefined) { + e = window.e; + + } + d.innerHTML = ''; + var t = ''; + if (talk > 0) { + t += '
    '; + } + if (atk == 1) { + t += '
    '; + } + if (look == 1) { + t += '
    '; + } + if (take == 1) { + t += '
    '; + } + d.innerHTML = t + ''; + d.style.display = ''; + if (e.x == undefined) { + e.x = e.clientX; + e.y = e.clientY; + } + d.style.top = e.y + 'px'; + if (e.x > 320) { + d.style.right = (document.body.offsetWidth - e.x) + 'px'; + } else { + d.style.right = (-e.x + 540) + 'px'; + } + } + } + + function exitDem() { + var d = document.getElementById('deMenu'); + if (d != undefined) { + d.innerHTML = ''; + d.style.display = 'none'; + d.style.top = '0px'; + d.style.right = '0px'; + } + } + + 0) { ?> + '; + } if (!isset($_GET['look'])) { + echo 'var'; + }?> objects = {}; + //i:{id,login,mapPoint,sex,obraz,type,users_p}, + users = {}; + objs = {genObjects(); ?>}; + items = {}; + actions = {}; + dsee = gs; ?>; + mapp = { + 1: '0_0f', 2: '0_0f', 3: '0_0f', 4: '1_1f', 5: '1_1f', 6: '1_1f' + , 7: '2_1f', 8: '2_1f', 9: '2_1f' + , 11: '3_1l', 12: '3_1f', 13: '3_1r' + } + zmap = {5: 894, 8: 0, 12: 0} + zfloor0 = {1: '', 2: '', 3: '', 4: '', 5: ''}; + '; + }else{ ?> + function genMap() { + var i = 0, m = false, mz = false; + while (i < users['count']) { + if (users[i] != undefined) { + mz = mapp[users[i][2]]; + if (document.getElementById(mz) != undefined) { + m = document.getElementById(mz); + m.innerHTML = addUser(users[i], mz) + m.innerHTML; + } + } + i++; + } + var i = 0, m = false, mz = false; + while (i < objs['count']) { + if (objs[i] != undefined) { + mz = mapp[objs[i][2]]; + if (objs[i][5] == dsee && (objs[i][2] == 5 || objs[i][2] == 2 || objs[i][2] == 8 || objs[i][2] == 12 || objs[i][2] == 15)) { + mz = mapp[objs[i][2] - 3]; + } + if (document.getElementById(mz) != undefined) { + m = document.getElementById(mz); + m.innerHTML = addObj(objs[i], mz, i) + m.innerHTML; + } + } + i++; + } + var i = 5; + while (i >= 1) { + if (zfloor0[i] != '') { + document.getElementById('Floor0').innerHTML += zfloor0[i]; + } + i--; + } + } + + var dConfig = { + 2: { + 1: {'top': 50, 'left': 140, 'w': 80, 'h': 147}, + 2: {'top': 45, 'left': 87, 'w': 80, 'h': 147}, + 3: {'top': 45, 'left': 192, 'w': 80, 'h': 147}, + 4: {'top': 49, 'left': 165, 'w': 80, 'h': 147}, + 5: {'top': 49, 'left': 105, 'w': 80, 'h': 147}, + 6: {'top': 53, 'left': 140, 'w': 80, 'h': 147}, + 7: {'top': 53, 'left': 87, 'w': 80, 'h': 147}, + 8: {'top': 53, 'left': 190, 'w': 80, 'h': 147} + }, + 3: { + 1: {'top': 60, 'left': 152, 'w': 53, 'h': 97}, + 2: {'top': 58, 'left': 110, 'w': 53, 'h': 97}, + 3: {'top': 58, 'left': 188, 'w': 53, 'h': 97}, + 4: {'top': 61, 'left': 168, 'w': 53, 'h': 97}, + 5: {'top': 61, 'left': 128, 'w': 53, 'h': 97}, + 6: {'top': 62, 'left': 153, 'w': 53, 'h': 97}, + 7: {'top': 62, 'left': 113, 'w': 53, 'h': 97}, + 8: {'top': 62, 'left': 193, 'w': 53, 'h': 97} + }, + 4: { + 1: {'top': 70, 'left': 158, 'w': 35, 'h': 64}, + 2: {'top': 68, 'left': 125, 'w': 35, 'h': 64}, + 3: {'top': 68, 'left': 193, 'w': 35, 'h': 64}, + 4: {'top': 71, 'left': 173, 'w': 35, 'h': 64}, + 5: {'top': 71, 'left': 137, 'w': 35, 'h': 64}, + 6: {'top': 73, 'left': 158, 'w': 35, 'h': 64}, + 7: {'top': 73, 'left': 129, 'w': 35, 'h': 64}, + 8: {'top': 73, 'left': 193, 'w': 35, 'h': 64} + } + } + var dConfigObj = { + 1: { + 0: { + 'top': 65, + 'left': 110, + 'w': 1, + 'h': 1 + } + } + , 2: { + 0: { + 'top': 65, + 'left': 110, + 'w': 0.65, + 'h': 0.65 + } + }, + 3: { + 0: { + 'top': 65, + 'left': 110, + 'w': 0.48, + 'h': 0.48 + } + }, + 4: { + 0: { + 'top': 65, + 'left': 110, + 'w': 0.35, + 'h': 0.35 + } + } + } + var prob = { + 0: { + 1: 1, + 2: 0.25, + 3: -0.10, + 4: -0.38 + }, + 1: { + 1: 0.90, + 2: 0.50, + 3: 0.23, + 4: 0.05 + } + }; + + function addObj(v, mz, iii) { + var r = ''; + //355*245 window + var rz = 0; // + if (v[2] >= 1 && v[2] <= 3) { + rz = 1; + } + if (v[2] >= 4 && v[2] <= 6) { + rz = 2; + } + if (v[2] >= 7 && v[2] <= 9) { + rz = 3; + } + if (v[2] >= 10 && v[2] <= 14) { + rz = 4; + } + if (v[2] >= 15 && v[2] <= 19) { + rz = 5; + } + if (v[5] == dsee) { + rz -= 1; + } + if (dConfigObj[rz] != undefined && dConfigObj[rz][v[6]] != undefined) { + new_w = v[7] * dConfigObj[rz][v[6]]['w']; + new_h = v[8] * dConfigObj[rz][v[6]]['h']; + new_left = dConfigObj[rz][v[6]]['left'] - Math.round((v[7] * prob[0][rz]) / 4); + new_top = dConfigObj[rz][v[6]]['top'] - Math.round((v[8] * prob[1][rz]) / 4); + if (v[2] == 6) { + new_left += 195; + new_top -= 5; + } + if (v[2] == 4) { + new_left -= 195; + new_top -= 5; + } + if (v[2] == 9) { + new_left -= 140; + new_top -= 2; + } + if (v[2] == 7) { + new_left += 140; + new_top -= 2; + } + if (v[2] == 13) { + new_left += 100; + new_top -= 1; + } + if (v[2] == 11) { + new_left -= 100; + new_top -= 0; + } + if (v[9] != 0) { + new_left += Math.round(new_left / (100 + (rz - 1) * 10) * v[9] + rz * 0.25); + } + if (v[10] != 0) { + new_top += Math.round(new_h / 2 + new_top / (100 + (rz - 1) * 50) * v[10] - rz * 3.3); + } + if (rz == 4) { + new_top += 3; + } + if (v[11] != 0) { + if (v[11]['t' + rz] != undefined) { + new_top += v[11]['t' + rz]; + } + if (v[11]['l' + rz] != undefined) { + new_left += v[11]['l' + rz]; + } + if (v[11]['w' + rz] != undefined) { + new_w += v[11]['w' + rz]; + } + if (v[11]['h' + rz] != undefined) { + new_h += v[11]['h' + rz]; + } + if (v[11]['rt' + rz] != undefined) { + new_top = v[11]['rt' + rz]; + } + if (v[11]['rl' + rz] != undefined) { + new_left = v[11]['rl' + rz]; + } + } + ////i:{0:id,1:name,2:mapPoint,3:action,4:img,5:type}, + if (rz >= 1 && rz <= 2) { + actionNow = ''; + if (v[11]['use'] != undefined) { + if (v[11]['use'] == 'exit') { + actionNow = 'alert(\' \');'; + } else if (v[11]['use'] == 'takeit') { + actionNow = 'location=\'main.php?take_obj=' + v[0] + '&rnd=' + 0.28626200682069150 + '\';'; + } + } + zfloor0[rz] = '' + zfloor0[rz]; + } else { + zfloor0[rz] = '' + zfloor0[rz]; + } + r = ''; + } + return r; + } + + function addUser(v, mz) { + var r = ''; + var rz = 0; // + if (v[2] >= 1 && v[2] <= 3) { + rz = 1; + } + if (v[2] >= 4 && v[2] <= 6) { + rz = 2; + } + if (v[2] >= 7 && v[2] <= 9) { + rz = 3; + } + if (v[2] >= 10 && v[2] <= 14) { + rz = 4; + } + if (v[2] >= 15 && v[2] <= 19) { + rz = 5; + } + if (dConfig[rz] != undefined && dConfig[rz][v[6]] != undefined) { + new_w = dConfig[rz][v[6]]['w']; + new_h = dConfig[rz][v[6]]['h']; + new_left = dConfig[rz][v[6]]['left']; + new_top = dConfig[rz][v[6]]['top']; + if (v[2] == 6) { + new_left += 215; + new_top -= 5; + } + if (v[2] == 4) { + new_left -= 215; + new_top -= 5; + } + if (v[2] == 9) { + new_left -= 155; + new_top -= 2; + } + if (v[2] == 7) { + new_left += 155; + new_top -= 2; + } + if (v[2] == 13) { + new_left += 115; + new_top -= 1; + } + if (v[2] == 11) { + new_left -= 115; + new_top -= 1; + } + if (v[2] >= 11 && v[2] <= 13) { + new_top += 5; + } + if (rz >= 1 && rz <= 2) { + action = ''; + if (v[5] == 'bot' || 0 > 0) { + action = 'dialogMenu(' + v[0] + ',1,' + v[7] + ',0,0,event);'; + } + zfloor0[rz] += ''; + } else { + zfloor0[rz] += ''; + } + r = ''; + } + return r; + } + + speedLoc = 0; + sLoc1 = 0; + sLoc2 = 0; + tgo = 0; + tgol = 0; + gotoup777 = 0; + gotext777 = ''; + + function cancelgoto() { + document.getElementById('gotext777').innerHTML = ''; + gotoup777 = 0; + gotext777 = ''; + } + + function goToLoca(id, ttl) { + if (tgo < 1) { + location = 'main.php?go=' + id; + } else { + gotoup777 = id; + gotext777 = ttl; + } + } + + function locGoLineDng() { + var line = document.getElementById('pline1'); + if (line != undefined) { + + prc = 100 - Math.floor(tgo / tgol * 100); + sLoc1 = 108 / 100 * prc; + if (sLoc1 < 1) { + sLoc1 = 1; + } + + if (sLoc1 > 108) { + sLoc1 = 108; + } + + line.style.width = sLoc1 + 'px'; + if (tgo > 0) { + tgo -= 1; + setTimeout('locGoLineDng()', 100); + } else { + if (gotoup777 > 0) { + location = "main.php?go=" + gotoup777; + } + } + if (gotoup777 > 0 && gotext777 != '' && document.getElementById('gotext777').innerHTML != ' ' + gotext777 + ' ()') { + //document.getElementById('gotext777').style.display = 'block'; + document.getElementById('gotext777').innerHTML = ' ' + gotext777 + ' ()'; + } else if (document.getElementById('gotext777').innerHTML != '' && gotoup777 == 0 && gotext777 == '') { + //document.getElementById('gotext777').style.display = 'none'; + document.getElementById('gotext777').innerHTML = ''; + } + } + } + + + + + - - - - - - +
    -
    -
    -   #   - - -
    -
    -
    -
    - - - + - + + - - -
    - - -
    -
    -
    -
    - - -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - info['admin']==0){ ?> -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - -
    +
    +
    +
    +   #   + + +
    +
    - - -
    - - - +
    + + + + + + +
    + + +
    +
    +
    +
    +
    +
    + + +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + info['admin'] == 0){ ?> +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    + + + + +
    + + + + +
    +



    '; + } else { + // + $min_x = mysql_fetch_array( + mysql_query( + 'SELECT `x` FROM `dungeon_map` WHERE `id_dng` = "' . mysql_real_escape_string( + $id + ) . '" ORDER BY `x` ASC LIMIT 1' + ) + ); + $max_x = mysql_fetch_array( + mysql_query( + 'SELECT `x` FROM `dungeon_map` WHERE `id_dng` = "' . mysql_real_escape_string( + $id + ) . '" ORDER BY `x` DESC LIMIT 1' + ) + ); + $min_y = mysql_fetch_array( + mysql_query( + 'SELECT `y` FROM `dungeon_map` WHERE `id_dng` = "' . mysql_real_escape_string( + $id + ) . '" ORDER BY `y` ASC LIMIT 1' + ) + ); + $max_y = mysql_fetch_array( + mysql_query( + 'SELECT `y` FROM `dungeon_map` WHERE `id_dng` = "' . mysql_real_escape_string( + $id + ) . '" ORDER BY `y` DESC LIMIT 1' + ) + ); + + $min_x = $min_x[0]; + $max_x = $max_x[0]; + $min_y = $min_y[0]; + $max_y = $max_y[0]; + + $map = []; + $stl = []; + + $sp = mysql_query( + 'SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . mysql_real_escape_string( + $id + ) . '" AND `x` >= ' . $min_x . ' AND `x` <= ' . $max_x . ' AND `y` >= ' . $min_y . ' AND `y` <= ' . $max_y . '' + ); + while ($pl = mysql_fetch_array($sp)) { + $style = 'vertical-align:bottom;'; + + if ($pl['st'][2] == 1) { + $style .= 'border-bottom:1px solid #6e6e6e;'; + } else { + $style .= 'padding-bottom:1px;'; + } + if ($pl['st'][1] == 1) { + $style .= 'border-left:1px solid #6e6e6e;'; + } else { + $style .= 'padding-left:1px;'; + } + if ($pl['st'][0] == 1) { + $style .= 'border-top:1px solid #6e6e6e;'; + } else { + $style .= 'padding-top:1px;'; + } + if ($pl['st'][3] == 1) { + $style .= 'border-right:1px solid #6e6e6e;'; + } else { + $style .= 'padding-right:1px;'; + } + + $map[$pl['x']][$pl['y']] = ''; + } + + echo '
    (X: [' . $min_x . '] - [' . $max_x . '] , Y: [' . $min_y . '] - [' . $max_y . '])


    '; + + $r = ''; + $i = $max_y; + while ($i >= $min_y) { + $j = $min_x; + $r .= ''; + while ($j <= $max_x) { + if (isset($map[$j][$i])) { + $r .= ''; + } else { + $r .= ''; + } + $j++; + } + $r .= ''; + $i--; + } + $r .= '
    ' . $map[$j][$i] . '
    '; + + echo $r; + } + ?> +
    +
    +
    -



    '; - }else{ - // - $min_x = mysql_fetch_array(mysql_query('SELECT `x` FROM `dungeon_map` WHERE `id_dng` = "'.mysql_real_escape_string($id).'" ORDER BY `x` ASC LIMIT 1')); - $max_x = mysql_fetch_array(mysql_query('SELECT `x` FROM `dungeon_map` WHERE `id_dng` = "'.mysql_real_escape_string($id).'" ORDER BY `x` DESC LIMIT 1')); - $min_y = mysql_fetch_array(mysql_query('SELECT `y` FROM `dungeon_map` WHERE `id_dng` = "'.mysql_real_escape_string($id).'" ORDER BY `y` ASC LIMIT 1')); - $max_y = mysql_fetch_array(mysql_query('SELECT `y` FROM `dungeon_map` WHERE `id_dng` = "'.mysql_real_escape_string($id).'" ORDER BY `y` DESC LIMIT 1')); - - $min_x = $min_x[0]; - $max_x = $max_x[0]; - $min_y = $min_y[0]; - $max_y = $max_y[0]; - - $map = array(); - $stl = array(); - - $sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.mysql_real_escape_string($id).'" AND `x` >= '.$min_x.' AND `x` <= '.$max_x.' AND `y` >= '.$min_y.' AND `y` <= '.$max_y.''); - while($pl = mysql_fetch_array($sp)) { - $style = 'vertical-align:bottom;'; - - if($pl['st'][2] == 1) { - $style .= 'border-bottom:1px solid #6e6e6e;'; - }else{ - $style .= 'padding-bottom:1px;'; - } - if($pl['st'][1] == 1) { - $style .= 'border-left:1px solid #6e6e6e;'; - }else{ - $style .= 'padding-left:1px;'; - } - if($pl['st'][0] == 1) { - $style .= 'border-top:1px solid #6e6e6e;'; - }else{ - $style .= 'padding-top:1px;'; - } - if($pl['st'][3] == 1) { - $style .= 'border-right:1px solid #6e6e6e;'; - }else{ - $style .= 'padding-right:1px;'; - } - - $map[$pl['x']][$pl['y']] = ''; - } - - echo '
    (X: ['.$min_x.'] - ['.$max_x.'] , Y: ['.$min_y.'] - ['.$max_y.'])


    '; - - $r = ''; - $i = $max_y; - while($i >= $min_y) { - $j = $min_x; - $r .= ''; - while($j <= $max_x) { - if(isset($map[$j][$i])) { - $r .= ''; - }else{ - $r .= ''; - } - $j++; - } - $r .= ''; - $i--; - } - $r .= '
    '.$map[$j][$i].'
    '; - - echo $r; - } - ?> -
    - -
    - \ No newline at end of file diff --git a/dn_editor_bots.php b/dn_editor_bots.php index 5ba63c44..65aaa2c3 100644 --- a/dn_editor_bots.php +++ b/dn_editor_bots.php @@ -1,91 +1,92 @@ -

    :

    '.$e.'


    (c) '.$c[1].'

    '); -} - -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()); -define('GAME',true); +info['admin'] == 0) { - die(''); +if (!$u->info['admin']) { + die(''); } -if(isset($_GET['id_dn'])) { - $_POST['id_dn'] = $_GET['id_dn']; - $_POST['xx'] = $_GET['xx']; - $_POST['yy'] = $_GET['yy']; +if (isset($_GET['id_dn'])) { + $_POST['id_dn'] = $_GET['id_dn']; + $_POST['xx'] = $_GET['xx']; + $_POST['yy'] = $_GET['yy']; } -if( $_POST['new_bot_colvo'] < 1 ) { - $_POST['new_bot_colvo'] = 1; +if ($_POST['new_bot_colvo'] < 1) { + $_POST['new_bot_colvo'] = 1; } ?>
    -id :
    -x :
    -y :
    - + id :
    + x :
    + y :
    +
    --------------- -------------:
    - 0 ){ - $bot = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$pl['id_bot'].'" LIMIT 1')); - echo $i.'.['.$pl['id2'].'] '.$bot['login'].' [id '.$bot['id'].'] , [x'.$pl['colvo'].']
    '; - } elseif( $pl['bot_group'] != '' ){ - $bots = explode( ',', $pl['bot_group'] ); - $jjj=0; - echo $i.' .['.$pl['id2'].']'; - while( $jjj < count($bots) ){ - $bot = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$bots[$jjj].'" LIMIT 1')); - if( isset($bot['login']) ) echo ' '.$bot['login'].' [id '.$bot['id'].'], '; - $jjj++; - } - echo ' [x'.$pl['colvo'].']
    '; - } - $i++; +while ($pl = mysql_fetch_array($sp)) { + if ($pl['id_bot'] > 0) { + $bot = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $pl['id_bot'] . '" LIMIT 1')); + echo $i . '.[' . $pl['id2'] . '] ' . $bot['login'] . ' [id ' . $bot['id'] . '] , [x' . $pl['colvo'] . ']
    '; + } elseif ($pl['bot_group'] != '') { + $bots = explode(',', $pl['bot_group']); + $jjj = 0; + echo $i . ' .[' . $pl['id2'] . ']'; + while ($jjj < count($bots)) { + $bot = mysql_fetch_array( + mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $bots[$jjj] . '" LIMIT 1') + ); + if (isset($bot['login'])) { + echo ' ' . $bot['login'] . ' [id ' . $bot['id'] . '], '; + } + $jjj++; + } + echo ' [x' . $pl['colvo'] . ']
    '; + } + $i++; } echo '
    '; ?>
    - :
    - - - -ID :
    - :
    -:
    -: (0 - , 1 - )
    - + :
    + + + + ID :
    + :
    + :
    + : (0 - , 1 - )
    +
    \ No newline at end of file diff --git a/dn_editor_botsAll.php b/dn_editor_botsAll.php index 7f8eb2bd..4c1a9500 100644 --- a/dn_editor_botsAll.php +++ b/dn_editor_botsAll.php @@ -1,63 +1,45 @@ -

    :

    '.$e.'


    (c) '.$c[1].'

    '); -} - -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()); -define('GAME',true); +info['id']) || $u->info['ip'] != IP || $u->info['admin'] == 0) { - die(''); +if (!isset($u->info['id']) || $u->info['ip'] != IP || !$u->info['admin']) { + die(''); } -if(isset($_GET['id_dn'])) { - $_POST['id_dn'] = $_GET['id_dn']; - $_POST['xx'] = $_GET['xx']; - $_POST['yy'] = $_GET['yy']; - $_POST['botlogin'] = $_GET['botlogin']; +if (isset($_GET['id_dn'])) { + $_POST['id_dn'] = $_GET['id_dn']; + $_POST['xx'] = $_GET['xx']; + $_POST['yy'] = $_GET['yy']; + $_POST['botlogin'] = $_GET['botlogin']; } -if( $_POST['new_bot_colvo'] < 1 ) { - $_POST['new_bot_colvo'] = 1; +if ($_POST['new_bot_colvo'] < 1) { + $_POST['new_bot_colvo'] = 1; } ?>
    -id :
    -botlogin:
    - + id :
    + botlogin:
    +
    --------------- -------------:
    -[login:'.$bot['login'].']
    [id '.$bot['id'].'] , [stats:'.$bot['stats'].'] '.$bot['obraz'].'&level='.$bot['level'].'
    '; - echo "
    +
    "; - $i++; +while ($pl = mysql_fetch_array($sp)) { + echo "
    +
    "; + $i++; } -?> +?> - - \ No newline at end of file +
    diff --git a/dn_editor_bots_itms.php b/dn_editor_bots_itms.php index 03581cd6..1dc4b25a 100644 --- a/dn_editor_bots_itms.php +++ b/dn_editor_bots_itms.php @@ -1,86 +1,73 @@ -

    :

    '.$e.'


    (c) '.$c[1].'

    '); -} - -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()); -define('GAME',true); +info['admin'] == 0) { - die(''); +if (!$u->info['admin']) { + die(''); } ?> -
    -id :
    - -
    ---------------- -------------
    - + id :
    + + + --------------- -------------
    + -
    -:
    -:
    -:
    -: (0 - . , 1 - .)
    -:
    -: (0-100%)
    - (%):
    -:
    - -
    - ( , 2605 - . id ):
    - -
    - :
    - -
    - +
    + :
    + :
    + :
    + : (0 - . , 1 - .)
    + :
    + : (0-100%)
    + (%):
    + :
    + +
    + ( , 2605 - . id ):
    + +
    + :
    + +
    + \ No newline at end of file diff --git a/dn_editor_class.php b/dn_editor_class.php deleted file mode 100644 index b506fd69..00000000 --- a/dn_editor_class.php +++ /dev/null @@ -1,693 +0,0 @@ - array() // - ) ,$id_dng,$cord = array('x' => 0),$sg = array(1 => array(1=>1,2=>2,3=>3,4=>4),2 => array(1=>2,2=>3,3=>4,4=>1),3 => array(1=>3,2=>4,3=>1,4=>2),4 => array(1=>4,2=>1,3=>2,4=>3)); - public function start() - { - global $u,$c,$code,$id; - $this->info = array( - 'id2' => $id, - 'id' => 0, - 'name' => ' ', - 'room' => 0, - 'time_start' => time(), - 'time_start' => 0, - 'uid' => 0, - 'type' => 0, - 'bsid' => 0 - ); - - $this->id_dng = $this->info['id2']; - $this->gs = $u->info['psevdo_s']; - if($this->gs<1 || $this->gs>4) - { - $this->gs = 1; - } - - if($this->info['bsid']>0) - { - $this->bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "'.$u->info['city'].'" AND `id` = "'.$this->info['bsid'].'" AND `time_start` = "'.$this->info['time_start'].'" LIMIT 1')); - if(isset($this->bs['id'])) - { - // - if($this->bs['users']-$this->bs['users_finish'] < 2) - { - $u->bsfinish($this->bs,false,NULL); - } - } - } - - /* ( ) - $this->gs = 1; // - 2; // - 3; // - 4; // - ( ( ( `y` >= '.$u->info['psevdo_y'].' && `y` <= '.($u->info['psevdo_y']+4).' ) && ( `x` >= '.($u->info['psevdo_x']-1).' && `x` <= '.($u->info['psevdo_x']+1).' ) ) || ( (`x` = '.($u->info['psevdo_x']+2).' || `x` = '.($u->info['psevdo_x']-2).') && ( `y` = '.($u->info['psevdo_y']+3).' || `y` = '.($u->info['psevdo_y']+4).' ) ) ) - */ - - $whr = array( - 1 => ' ((`x` <= '.($u->info['psevdo_x']+2).' && `x` >= '.($u->info['psevdo_x']-2).') && (`y` >= '.$u->info['psevdo_y'].' && `y` <= '.($u->info['psevdo_y']+4).')) ', // - 3 => ' ((`x` <= '.($u->info['psevdo_x']+2).' && `x` >= '.($u->info['psevdo_x']-2).') && (`y` <= '.$u->info['psevdo_y'].' && `y` >= '.($u->info['psevdo_y']-4).')) ', // - 2 => ' ((`x` <= '.$u->info['psevdo_x'].' && `x` >= '.($u->info['psevdo_x']-4).') && (`y` <= '.($u->info['psevdo_y']+2).' && `y` >= '.($u->info['psevdo_y']-2).')) ', // - 4 => ' ((`x` >= '.$u->info['psevdo_x'].' && `x` <= '.($u->info['psevdo_x']+4).') && (`y` <= '.($u->info['psevdo_y']+2).' && `y` >= '.($u->info['psevdo_y']-2).')) ' // - ); - - $i = 1; - $sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.$this->id_dng.'" AND '.$whr[$this->gs].' ORDER BY `y` ASC , `x` ASC LIMIT 25'); - while($pl = mysql_fetch_array($sp)) - { - $this->map[0][$pl['y'].'_'.$pl['x']] = $pl; - $i++; - } - $this->map['good'] = $i; // - $this->map[1] = $this->genMatix(); - $this->lookDungeon(); - - - } - - public function usersDng() - { - global $u,$c; - $r = ''; - /* ( ) */ - } - - public function atack($id) - { - global $u,$c,$code; - /* , ? :) , ? :) */ - } - - public function takeinv($id) - { - global $u,$c,$code; - /* , , :) */ - } - - public function takeit($id) - { - global $u,$c,$code,$magic; - /* ;) */ - } - - public function addItem($i) - { - // ( ) - /* ? ?! */ - } - - public function itemsMap() - { - global $u,$c,$code; - /* ! ! */ - } - - public function testLike($x1,$y1,$x2,$y2) - { - // $x1,$y1 $x2,$y2 - //- - $r = 0; - $c1 = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$x1.'" AND `y` = "'.$y1.'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - $c2 = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$x2.'" AND `y` = "'.$y2.'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - if(isset($c1['id']) && isset($c2['id'])) - { - if($x1==$x2 && $y1==$y2) - { - $r = 1; - }elseif($x1==$x2-1 && $c1['go_1']==1) // - { - $r = 1; - }elseif($x1==$x2+1 && $c1['go_2']==1) // - { - $r = 1; - }elseif($y1==$y2-1 && $c1['go_3']==1) // - { - $r = 1; - }elseif($y1==$y2+1 && $c1['go_4']==1) // - { - $r = 1; - } - } - return $r; - } - - public function genObjects() { - global $u,$c,$code; - ////i:{id,name,mapPoint,action,img,type}, - //'count':1,0:{0:1234,1:'',2:5,3:'',4:'test.gif',5:0,6:position,7:width,8:heigh,9:left,10:top}, - //psition 0 - , 1- , 2- , 3- , 4- - $r = ''; - /* - $whr = array( - 1 => ' ((`u`.`x` <= '.($u->info['psevdo_x']+2).' && `u`.`x` >= '.($u->info['psevdo_x']-2).') && (`u`.`y` >= '.($u->info['psevdo_y']+1).' && `u`.`y` <= '.($u->info['psevdo_y']+4).')) ', // - 3 => ' ((`u`.`x` <= '.($u->info['psevdo_x']+2).' && `u`.`x` >= '.($u->info['psevdo_x']-2).') && (`u`.`y` <= '.($u->info['psevdo_y']-1).' && `u`.`y` >= '.($u->info['psevdo_y']-4).')) ', // - 2 => ' ((`u`.`x` <= '.($u->info['psevdo_x']-1).' && `u`.`x` >= '.($u->info['psevdo_x']-4).') && (`u`.`y` <= '.($u->info['psevdo_y']+2).' && `u`.`y` >= '.($u->info['psevdo_y']-2).')) ', // - 4 => ' ((`u`.`x` >= '.($u->info['psevdo_x']+1).' && `u`.`x` <= '.($u->info['psevdo_x']+4).') && (`u`.`y` <= '.($u->info['psevdo_y']+2).' && `u`.`y` >= '.($u->info['psevdo_y']-2).')) ' // - ); - */ - $whr = array( - 1 => ' (((`u`.`x` <= '.($u->info['psevdo_x']+2).' && `u`.`x` >= '.($u->info['psevdo_x']-2).') && (`u`.`y` >= '.($u->info['psevdo_y']+1).' && `u`.`y` <= '.($u->info['psevdo_y']+4).')) OR (`u`.`y` = '.$u->info['psevdo_y'].' && `u`.`x` = '.$u->info['psevdo_x'].')) ', // - 3 => ' (((`u`.`x` <= '.($u->info['psevdo_x']+2).' && `u`.`x` >= '.($u->info['psevdo_x']-2).') && (`u`.`y` <= '.($u->info['psevdo_y']-1).' && `u`.`y` >= '.($u->info['psevdo_y']-4).')) OR (`u`.`y` = '.$u->info['psevdo_y'].' && `u`.`x` = '.$u->info['psevdo_x'].')) ', // - 2 => ' (((`u`.`x` <= '.($u->info['psevdo_x']-1).' && `u`.`x` >= '.($u->info['psevdo_x']-4).') && (`u`.`y` <= '.($u->info['psevdo_y']+2).' && `u`.`y` >= '.($u->info['psevdo_y']-2).'))OR (`u`.`y` = '.$u->info['psevdo_y'].' && `u`.`x` = '.$u->info['psevdo_x'].')) ', // - 4 => ' (((`u`.`x` >= '.($u->info['psevdo_x']+1).' && `u`.`x` <= '.($u->info['psevdo_x']+4).') && (`u`.`y` <= '.($u->info['psevdo_y']+2).' && `u`.`y` >= '.($u->info['psevdo_y']-2).')) OR (`u`.`y` = '.$u->info['psevdo_y'].' && `u`.`x` = '.$u->info['psevdo_x'].')) ' // - ); - $sp = mysql_query('SELECT `u`.* FROM `dungeon_obj` AS `u` WHERE `u`.`dn` = "0" AND `u`.`for_dn` = "'.$this->id_dng.'" AND ((`u`.`s` = "0" OR `u`.`s` = "'.$this->gs.'") OR `u`.`s2` = "'.$this->gs.'") AND '.$whr[$this->gs].' LIMIT 76'); - # die('SELECT `u`.* FROM `dungeon_obj` AS `u` WHERE `u`.`dn` = "0" AND `u`.`for_dn` = "'.$this->id_dng.'" AND ((`u`.`s` = "0" OR `u`.`s` = "'.$this->gs.'") OR `u`.`s2` = "'.$this->gs.'") AND '.$whr[$this->gs].' LIMIT 76'); - $i = 0; $pos = array(); - while($pl = mysql_fetch_array($sp)) { - - if($pl['fix_x_y'] == 0 || - ($pl['fix_x_y'] == 1 && $pl['x'] == $u->info['psevdo_x']) || - ($pl['fix_x_y'] == 2 && $pl['y'] == $u->info['psevdo_y']) || - ($pl['fix_x_y'] == 3 && $pl['x'] == $u->info['psevdo_x'] && $pl['y'] == $u->info['psevdo_y'])) { - if( - ( - $pl['os1']== 0 && $pl['os2']==0 && $pl['os3']==0 && $pl['os4']==0 - ) || - ( - $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os1'] || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os2'] - || - $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os3'] || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os4'] - ) - ) { - $i++; if(!isset($pos[$this->cord[$pl['y'].'_'.$pl['x']]])){ $pos[$this->cord[$pl['y'].'_'.$pl['x']]] = 0; } $pos[$this->cord[$pl['y'].'_'.$pl['x']]]++; - $r .= ','.($i-1).':{\'x\':'.$pl['x'].',\'y\':'.$pl['y'].',0:'.$pl['id'].',1:\''.$pl['name'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:\'action\',4:\''.$pl['img'].'\',5:'.$pl['type'].',6:0,7:'.$pl['w'].',8:'.$pl['h'].',9:'.$pl['left'].',10:'.$pl['top'].',11:'.$pl['date'].',12:'.$pl['type'].',13:'.$pl['type2'].',14:'.$pl['s'].',15:'.$pl['s2'].',16:'.$pl['os1'].',17:'.$pl['os2'].',18:'.$pl['os3'].',19:'.$pl['os4'].',20:'.$pl['fix_x_y'].'}'; - } elseif( $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os1']-1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os2']-1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os3']-1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os4']-1 ) { - $dt2 = explode(',',ltrim(rtrim($pl['date'],'\}'),'\{')); - $da = array(); - $is = 0; - while($is < count($dt2)) { - $dt2[$is] = explode(':',$dt2[$is]); - $da[$dt2[$is][0]] = $dt2[$is][1]; - $is++; - } - #if(isset($da['rl2']))$da['rl2'] = -round((int)$da['rl2'] * 0.70); // - if(isset($da['rl2']))$da['rl2'] = round((int)$da['rl2'] -230); // - if(isset($da['rl3']))$da['rl3'] = round((int)$da['rl3'] +160); - if(isset($da['rl4']))$da['rl4'] = round((int)$da['rl4'] -120); - $pl['date'] = str_replace('"', '', json_encode($da)); - $i++; if(!isset($pos[$this->cord[$pl['y'].'_'.$pl['x']]])){ $pos[$this->cord[$pl['y'].'_'.$pl['x']]] = 0; } $pos[$this->cord[$pl['y'].'_'.$pl['x']]]++; - $r .= ','.($i-1).':{\'x\':'.$pl['x'].',\'y\':'.$pl['y'].',0:'.$pl['id'].',1:\''.$pl['name'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:\'action\',4:\''.$pl['img'].'\',5:'.$pl['type'].',6:0,7:'.$pl['w'].',8:'.$pl['h'].',9:'.$pl['left'].',10:'.$pl['top'].',11:'.$pl['date'].',12:'.$pl['type'].',13:'.$pl['type2'].',14:'.$pl['s'].',15:'.$pl['s2'].',16:'.$pl['os1'].',17:'.$pl['os2'].',18:'.$pl['os3'].',19:'.$pl['os4'].',20:'.$pl['fix_x_y'].'}'; - } else if( $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os1']+1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os2']+1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os3']+1 || $this->cord[$pl['y'].'_'.$pl['x']] == $pl['os4']+1 ) { - - $dt2 = explode(',',ltrim(rtrim($pl['date'],'\}'),'\{')); - $da = array(); - $is = 0; - while($is < count($dt2)) { - $dt2[$is] = explode(':',$dt2[$is]); - $da[$dt2[$is][0]] = $dt2[$is][1]; - $is++; - } - #if(isset($da['rl2']))$da['rl2'] = 355-round((int)$da['rl2'] * 0.30); // - if(isset($da['rl2']))$da['rl2'] = round((int)$da['rl2'] +230); // - if(isset($da['rl3']))$da['rl3'] = round((int)$da['rl3'] -160); - if(isset($da['rl4']))$da['rl4'] = round((int)$da['rl4'] +120); - $pl['date'] = str_replace('"', '', json_encode($da)); - $i++; if(!isset($pos[$this->cord[$pl['y'].'_'.$pl['x']]])){ $pos[$this->cord[$pl['y'].'_'.$pl['x']]] = 0; } $pos[$this->cord[$pl['y'].'_'.$pl['x']]]++; - $r .= ','.($i-1).':{\'x\':'.$pl['x'].',\'y\':'.$pl['y'].',0:'.$pl['id'].',1:\''.$pl['name'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:\'action\',4:\''.$pl['img'].'\',5:'.$pl['type'].',6:0,7:'.$pl['w'].',8:'.$pl['h'].',9:'.$pl['left'].',10:'.$pl['top'].',11:'.$pl['date'].',12:'.$pl['type'].',13:'.$pl['type2'].',14:'.$pl['s'].',15:'.$pl['s2'].',16:'.$pl['os1'].',17:'.$pl['os2'].',18:'.$pl['os3'].',19:'.$pl['os4'].',20:'.$pl['fix_x_y'].'}'; - } - } - } - $r = 'count:'.$i.$r; - return $r; - } - - public function genUsers(){ - global $u,$c,$code; - ////i:{id,login,mapPoint,sex,obraz,type,users_p}, - //'count':1,0:{0:1015,1:'Test1',2:5,3:0,4:'1',5:'user',6:1}, - $r = ''; - $whr = array( - 1 => ' ((`u`.`x` <= '.($u->info['psevdo_x']+2).' && `u`.`x` >= '.($u->info['psevdo_x']-2).') && (`u`.`y` >= '.$u->info['psevdo_y'].' && `u`.`y` <= '.($u->info['psevdo_y']+4).')) ', // - 3 => ' ((`u`.`x` <= '.($u->info['psevdo_x']+2).' && `u`.`x` >= '.($u->info['psevdo_x']-2).') && (`u`.`y` <= '.$u->info['psevdo_y'].' && `u`.`y` >= '.($u->info['psevdo_y']-4).')) ', // - 2 => ' ((`u`.`x` <= '.$u->info['psevdo_x'].' && `u`.`x` >= '.($u->info['psevdo_x']-4).') && (`u`.`y` <= '.($u->info['psevdo_y']+2).' && `u`.`y` >= '.($u->info['psevdo_y']-2).')) ', // - 4 => ' ((`u`.`x` >= '.$u->info['psevdo_x'].' && `u`.`x` <= '.($u->info['psevdo_x']+4).') && (`u`.`y` <= '.($u->info['psevdo_y']+2).' && `u`.`y` >= '.($u->info['psevdo_y']-2).')) ' // - ); - $i = 0; - // - $sp = mysql_query('SELECT `u`.*,`st`.* FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE '.$whr[$this->gs].' AND `dn` = "0" AND `for_dn` = "'.$this->id_dng.'" AND `u`.`delete` = "0" LIMIT 50'); - while($pl = mysql_fetch_array($sp)){ - $i++; if(!isset($pos[$this->cord[$pl['y'].'_'.$pl['x']]])){ $pos[$this->cord[$pl['y'].'_'.$pl['x']]] = 0; } $pos[$this->cord[$pl['y'].'_'.$pl['x']]]++; - $dlg = 0; - if($pl['dialog']>0){ - $dlg = $pl['dialog']; - } - $r .= ','.($i-1).':{0:'.$pl['id2'].',1:\''.$pl['login'].'\',2:'.(0+$this->cord[$pl['y'].'_'.$pl['x']]).',3:'.$pl['sex'].',4:\''.str_replace('.gif','',$pl['obraz']).'\',5:\'bot\',6:'.$pos[$this->cord[$pl['y'].'_'.$pl['x']]].',7:'.$dlg.'}'; - } - $r = 'count:'.$i.$r; - //$wd = $this->cord['2_0']; - return $r; - } - - public function botAtack($bot,$uid,$bs) { - global $u,$c,$code; - $user = mysql_fetch_array(mysql_query('SELECT `id`,`battle` FROM `users` WHERE `id` = "'.$uid['id'].'" LIMIT 1')); - if($user['battle']>0){ - $btli = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" AND `team_win` = "-1" LIMIT 1')); - } - if(!isset($btli['id'])){ - // - $btl_id = 0; - $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 ( - "'.$this->info['id2'].'", - "'.$this->info['id'].'", - "'.$bot['x'].'", - "'.$bot['y'].'", - "'.$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(); - - if($btl_id>0){ - // - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "0" AND `dn` = "'.$this->info['id'].'" AND `x` = "'.$bot['x'].'" AND `y` = "'.$bot['y'].'" LIMIT 50'); - $j = 0; $logins_bot = array(); - while($pl = mysql_fetch_array($sp)){ - mysql_query('UPDATE `dungeon_bots` SET `inBattle` = "'.$btl_id.'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $jui = 1; - while($jui<=$pl['colvo']){ - $k = $u->addNewbot($pl['id_bot'],NULL,NULL,$logins_bot); - $logins_bot = $k['logins_bot']; - if($k!=false) { - $upd = mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$k['id'].'" LIMIT 1'); - if($upd){ - $upd = mysql_query('UPDATE `stats` SET `x`="'.$bot['x'].'",`y`="'.$bot['y'].'",`team` = "1" WHERE `id` = "'.$k['id'].'" LIMIT 1'); - if($upd){ - $j++; - } - } - } - $jui++; - } - } - unset($logins_bot); - if($j>0) - { - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "2" WHERE `id` = "'.$user['id'].'" LIMIT 1'); - } - } - }else{ - // - - } - } - - public function testGo($id) - { - global $u,$c,$code; - $go = 0; - if($id==1) - { - // - $go = $this->sg[$this->gs][1]; - }elseif($id==2) - { - // - $go = $this->sg[$this->gs][3]; - }elseif($id==3) - { - // - $go = $this->sg[$this->gs][4]; - }elseif($id==4) - { - // - $go = $this->sg[$this->gs][2]; - } - $thp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$u->info['psevdo_x'].'" AND `y` = "'.$u->info['psevdo_y'].'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - $ng = array( - 4=>1, - 2=>2, - 1=>3, - 3=>4 - ); - if(isset($thp['id']) && $thp['go_'.$ng[$go]]==0) - { - $go = 0; - } - $tgo = array(0=>0,1=>0); - if($go==1) - { - $tgo[1] += 1; - }elseif($go==2) - { - $tgo[0] -= 1; - }elseif($go==3) - { - $tgo[1] -= 1; - }elseif($go==4) - { - $tgo[0] += 1; - } - - $tbot = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_bots` WHERE `x` = "'.($u->info['psevdo_x']+(int)$tgo[0]).'" AND `y` = "'.($u->info['psevdo_y']+(int)$tgo[1]).'" AND `dn` = "'.$this->info['id'].'" AND `for_dn` = "0" AND `delete` = "0" LIMIT 1')); - if(isset($tbot['id2']) && $u->info['admin']==0) - { - $go = 0; - } - - $tmap = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$u->info['psevdo_x'].'" AND `y` = "'.$u->info['psevdo_y'].'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - // - if($tmap['tr_items']!='') - { - $ti = explode(',',$tmap['tr_items']); - $i = 0; $trnit = ''; - while($i0 && $ti2[1]>0) - { - $num_rows = mysql_num_rows(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "0" AND `item_id` = "'.((int)$ti2[0]).'" LIMIT '.((int)$ti2[1]).'')); - if($num_rows < (int)$ti2[1]) - { - $tgo = $ti2[2]; - if($tgo!='0000') - { - if($tgo[$ng[$go]-1]==1) - { - $go = 0; - $trm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.((int)$ti2[0]).'" LIMIT 1')); - $trnit .= '"'.$trm['name'].'", '; - } - } - } - } - $i++; - } - if($trnit!='') - { - $trnit = rtrim($trnit,', '); - $this->error = ' . '.$trnit; - } - } - - $tmGo = $u->info['timeGo']-time(); // - if($tmGo>0) - { - $go = 0; - $this->error = ' ...'; - } - - if($u->aves['now']>=$u->aves['max']) - { - $go = 0; - $this->error = ' , ...'; - } - - if($go>0) - { - if($go==1) - { - $u->info['psevdo_y'] += 1; - }elseif($go==2) - { - $u->info['psevdo_x'] -= 1; - }elseif($go==3) - { - $u->info['psevdo_y'] -= 1; - }elseif($go==4) - { - $u->info['psevdo_x'] += 1; - } - $u->info['timeGo'] = time()+$tmap['timeGO']; - $u->info['timeGoL'] = time(); - $upd = mysql_query('UPDATE `stats` SET `x` = "'.$u->info['psevdo_x'].'",`y` = "'.$u->info['psevdo_y'].'",`timeGo` = "'.$u->info['timeGo'].'",`timeGoL` = "'.$u->info['timeGoL'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - - public function testGone($id) - { - global $u,$c,$code; - $go = 0; - if($id==1) - { - // - $go = $this->sg[$this->gs][1]; - }elseif($id==2) - { - // - $go = $this->sg[$this->gs][3]; - }elseif($id==3) - { - // - $go = $this->sg[$this->gs][4]; - }elseif($id==4) - { - // - $go = $this->sg[$this->gs][2]; - } - $thp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$u->info['psevdo_x'].'" AND `y` = "'.$u->info['psevdo_y'].'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - $ng = array( - 4=>1, - 2=>2, - 1=>3, - 3=>4 - ); - if(isset($thp['id']) && $thp['go_'.$ng[$go]]==0) - { - $go = 0; - } - $tgo = array(0=>0,1=>0); - if($go==1) - { - $tgo[1] += 1; - }elseif($go==2) - { - $tgo[0] -= 1; - }elseif($go==3) - { - $tgo[1] -= 1; - }elseif($go==4) - { - $tgo[0] += 1; - } - - $tbot = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_bots` WHERE `x` = "'.($u->info['psevdo_x']+(int)$tgo[0]).'" AND `y` = "'.($u->info['psevdo_y']+(int)$tgo[1]).'" AND `dn` = "'.$this->info['id'].'" AND `for_dn` = "0" AND `delete` = "0" LIMIT 1')); - if(isset($tbot['id2']) && $u->info['admin']==0) - { - $go = 0; - } - - $tmap = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "'.$u->info['psevdo_x'].'" AND `y` = "'.$u->info['psevdo_y'].'" AND `id_dng` = "'.$this->info['id2'].'" LIMIT 1')); - // - /* - if($tmap['tr_items']!='') - { - $ti = explode(',',$tmap['tr_items']); - $i = 0; $trnit = ''; - while($i0 && $ti2[1]>0) - { - $num_rows = mysql_num_rows(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inShop` = "0" AND `item_id` = "'.((int)$ti2[0]).'" LIMIT '.((int)$ti2[1]).'')); - if($num_rows < (int)$ti2[1]) - { - $tgo = $ti2[2]; - if($tgo!='0000') - { - if($tgo[$ng[$go]-1]==1) - { - $go = 0; - } - } - } - } - $i++; - } - } - */ - - return $go; - } - - public function testSt($id,$s) - { - $r = 0; - // - $s = $this->sg[$this->gs][$s]; - if(isset($this->map[1][$id]['id'])) - { - $r = $this->map[1][$id]['st'][($s-1)]; - } - return $r; - } - - public function lookDungeon() - { - global $u,$c,$code,$pd; - /* */ - /* LEVEL 1 */ - if($this->testSt(2,4)>0 || $this->testSt(3,2)>0){ $pd[28] = 1; } - if($this->testSt(1,4)>0 || $this->testSt(2,2)>0){ $pd[27] = 1; } - if($this->testSt(2,1)>0 || $this->testSt(5,3)>0){ $pd[26] = 1; } - if($this->testSt(3,1)>0 || $this->testSt(6,3)>0){ $pd[25] = 1; } - if($this->testSt(1,1)>0 || $this->testSt(4,3)>0){ $pd[24] = 1; } - - /* LEVEL 2 */ - if($this->testSt(5,4)>0 || $this->testSt(6,2)>0){ $pd[23] = 1; } - if($this->testSt(4,4)>0 || $this->testSt(5,2)>0){ $pd[22] = 1; } - if($this->testSt(5,1)>0 || $this->testSt(8,3)>0){ $pd[21] = 1; } - if($this->testSt(6,1)>0 || $this->testSt(7,3)>0){ $pd[20] = 1; } - if($this->testSt(4,1)>0 || $this->testSt(9,3)>0){ $pd[19] = 1; } - - /* LEVEL 3 */ - if($this->testSt(8,4)>0 || $this->testSt(7,2)>0){ $pd[18] = 1; } - if($this->testSt(9,4)>0 || $this->testSt(8,2)>0){ $pd[17] = 1; } - if($this->testSt(8,1)>0 || $this->testSt(12,3)>0){ $pd[16] = 1; } - if($this->testSt(7,1)>0 || $this->testSt(13,3)>0){ $pd[15] = 1; } - if($this->testSt(9,1)>0 || $this->testSt(11,3)>0){ $pd[14] = 1; } - - /* LEVEL 4 */ - if($this->testSt(12,4)>0 || $this->testSt(13,2)>0){ $pd[13] = 1; } - if($this->testSt(12,2)>0 || $this->testSt(11,4)>0){ $pd[12] = 1; } - if($this->testSt(13,1)>0 || $this->testSt(17,3)>0){ $pd[11] = 1; } //8 - if($this->testSt(11,1)>0 || $this->testSt(16,3)>0){ $pd[10] = 1; } //7 - if($this->testSt(12,1)>0 || $this->testSt(15,3)>0){ $pd[9] = 1; } - if($this->testSt(14,1)>0 || $this->testSt(18,3)>0){ $pd[6] = 1; } //2 - if($this->testSt(10,1)>0 || $this->testSt(19,3)>0){ $pd[5] = 1; } //1 - if($this->testSt(16,4)>0 || $this->testSt(15,2)>0){ $pd[4] = 1; } - if($this->testSt(15,4)>0 || $this->testSt(17,2)>0){ $pd[3] = 1; } - - /* */ - - /* */ - - } - - public function getMatrix($y,$x) - { - global $u; - $this->cord['x']++; - $this->cord[($u->info['psevdo_y']+$y).'_'.($u->info['psevdo_x']+$x)] = $this->cord['x']; - return $this->map[0][($u->info['psevdo_y']+$y).'_'.($u->info['psevdo_x']+$x)]; - } - - public function genMatix() - { - $r = array(); - if($this->gs == 1) - { - //1; // - $r[1] = $this->getMatrix(0,-1); - $r[2] = $this->getMatrix(0,0); - $r[3] = $this->getMatrix(0,1); - $r[4] = $this->getMatrix(1,-1); - $r[5] = $this->getMatrix(1,0); - $r[6] = $this->getMatrix(1,1); - $r[7] = $this->getMatrix(2,1); - $r[8] = $this->getMatrix(2,0); - $r[9] = $this->getMatrix(2,-1); - $r[10] = $this->getMatrix(3,-2); - $r[11] = $this->getMatrix(3,-1); - $r[12] = $this->getMatrix(3,0); - $r[13] = $this->getMatrix(3,1); - $r[14] = $this->getMatrix(3,2); - $r[15] = $this->getMatrix(4,0); - $r[16] = $this->getMatrix(4,-1); - $r[17] = $this->getMatrix(4,1); - $r[18] = $this->getMatrix(4,2); - $r[19] = $this->getMatrix(4,-2); - }elseif($this->gs == 2) - { - //2; // - $r[1] = $this->getMatrix(-1,0); - $r[2] = $this->getMatrix(0,0); - $r[3] = $this->getMatrix(1,0); - $r[4] = $this->getMatrix(-1,-1); - $r[5] = $this->getMatrix(0,-1); - $r[6] = $this->getMatrix(1,-1); - $r[7] = $this->getMatrix(1,-2); - $r[8] = $this->getMatrix(0,-2); - $r[9] = $this->getMatrix(-1,-2); - $r[10] = $this->getMatrix(-2,-3); - $r[11] = $this->getMatrix(-1,-3); - $r[12] = $this->getMatrix(0,-3); - $r[13] = $this->getMatrix(1,-3); - $r[14] = $this->getMatrix(2,-3); - $r[15] = $this->getMatrix(0,-4); - $r[16] = $this->getMatrix(-1,-4); - $r[17] = $this->getMatrix(1,-4); - $r[18] = $this->getMatrix(2,-4); - $r[19] = $this->getMatrix(-2,-4); - }elseif($this->gs == 3) - { - //3; // - $r[1] = $this->getMatrix(0,1); - $r[2] = $this->getMatrix(0,0); - $r[3] = $this->getMatrix(0,-1); - $r[4] = $this->getMatrix(-1,1); - $r[5] = $this->getMatrix(-1,0); - $r[6] = $this->getMatrix(-1,-1); - $r[7] = $this->getMatrix(-2,-1); - $r[8] = $this->getMatrix(-2,0); - $r[9] = $this->getMatrix(-2,1); - $r[10] = $this->getMatrix(-3,2); - $r[11] = $this->getMatrix(-3,1); - $r[12] = $this->getMatrix(-3,0); - $r[13] = $this->getMatrix(-3,-1); - $r[14] = $this->getMatrix(-3,-2); - $r[15] = $this->getMatrix(-4,0); - $r[16] = $this->getMatrix(-4,1); - $r[17] = $this->getMatrix(-4,-1); - $r[18] = $this->getMatrix(-4,-2); - $r[19] = $this->getMatrix(-4,2); - }elseif($this->gs == 4) - { - //4; // - $r[1] = $this->getMatrix(1,0); - $r[2] = $this->getMatrix(0,0); - $r[3] = $this->getMatrix(-1,0); - $r[4] = $this->getMatrix(1,1); - $r[5] = $this->getMatrix(0,1); - $r[6] = $this->getMatrix(-1,1); - $r[7] = $this->getMatrix(-1,2); - $r[8] = $this->getMatrix(0,2); - $r[9] = $this->getMatrix(1,2); - $r[10] = $this->getMatrix(2,3); - $r[11] = $this->getMatrix(1,3); - $r[12] = $this->getMatrix(0,3); - $r[13] = $this->getMatrix(-1,3); - $r[14] = $this->getMatrix(-2,3); - $r[15] = $this->getMatrix(0,4); - $r[16] = $this->getMatrix(1,4); - $r[17] = $this->getMatrix(-1,4); - $r[18] = $this->getMatrix(-2,4); - $r[19] = $this->getMatrix(2,4); - } - return $r; - } -} - -$d = new dungeon; -$d->start(); -?> \ No newline at end of file diff --git a/dncon.php b/dncon.php index 05f059de..f5540c4a 100644 --- a/dncon.php +++ b/dncon.php @@ -1,85 +1,78 @@ -'; - } - }elseif( $_GET['step'] == 2 ) { - $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.mysql_real_escape_string($dng).'" ORDER BY `id` ASC'); - while( $pl = mysql_fetch_assoc($sp) ) { - $sql .= array_to_sql('dungeon_obj',$pl,'id','NULL').'
    '; - } - }elseif( $_GET['step'] == 3 ) { - $sm = 200; // - $botadd = array(); - $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.mysql_real_escape_string($dng).'" ORDER BY `id2` ASC'); - while( $pl = mysql_fetch_assoc($sp) ) { - $botsel = mysql_fetch_assoc(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$pl['id_bot'].'" LIMIT 1')); - if(isset($botsel['id'])) { - $pl['id_bot'] += $sm; - if(!isset($botadd[$pl['id_bot']])) { - $botadd[$pl['id_bot']] = true; - $sql .= array_to_sql('test_bot',$botsel,'id','"'.$pl['id_bot'].'"').'
    '; - } - $sql .= array_to_sql('dungeon_bots',$pl,'id2','NULL').'
    '; - } - } - }elseif( $_GET['setp'] == 4 ) { - - } - - - echo $sql; - -}else{ - die(' !'); +if (!isset($_GET['for'])) { + die(' !'); +} +function array_to_sql($t, $m, $id_name, $id) +{ + $k = array_keys($m); + $a = ''; + $b = ''; + $i = 0; + while ($i < count($k)) { + $a .= ',`' . $k[$i] . '`'; + if ($id && $k[$i] == $id_name) { + $b .= ',' . $id; + } else { + $b .= ',"' . str_replace('"', '"', $m[$k[$i]]) . '"'; + } + $i++; + } + $a = ltrim($a, ','); + $b = ltrim($b, ','); + return 'INSERT INTO `' . $t . '` ( ' . $a . ' ) VALUES ( ' . $b . ' );'; } -?> \ No newline at end of file +$dng = (int)$_GET['dng']; + +$sql = ''; + +$test_bot = []; +$dungeon_bots = []; +$dungeon_items = []; +$dungeon_obj = []; +$dungeon_map = []; +$items_main = []; +$eff_main = []; + +// +if ($_GET['step'] == 1) { + $sp = mysql_query( + 'SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . mysql_real_escape_string( + $dng + ) . '" ORDER BY `x`, `y`' + ); + while ($pl = mysql_fetch_assoc($sp)) { + $sql .= array_to_sql('dungeon_map', $pl, 'id', 'NULL') . '
    '; + } +} elseif ($_GET['step'] == 2) { + $sp = mysql_query( + 'SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . mysql_real_escape_string($dng) . '" ORDER BY `id` ASC' + ); + while ($pl = mysql_fetch_assoc($sp)) { + $sql .= array_to_sql('dungeon_obj', $pl, 'id', 'NULL') . '
    '; + } +} elseif ($_GET['step'] == 3) { + $sm = 200; // + $botadd = []; + $sp = mysql_query( + 'SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . mysql_real_escape_string($dng) . '" ORDER BY `id2` ASC' + ); + while ($pl = mysql_fetch_assoc($sp)) { + $botsel = mysql_fetch_assoc( + mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $pl['id_bot'] . '" LIMIT 1') + ); + if (isset($botsel['id'])) { + $pl['id_bot'] += $sm; + if (!isset($botadd[$pl['id_bot']])) { + $botadd[$pl['id_bot']] = true; + $sql .= array_to_sql('test_bot', $botsel, 'id', '"' . $pl['id_bot'] . '"') . '
    '; + } + $sql .= array_to_sql('dungeon_bots', $pl, 'id2', 'NULL') . '
    '; + } + } +} +echo $sql; diff --git a/do.php b/do.php deleted file mode 100644 index 07f467a4..00000000 --- a/do.php +++ /dev/null @@ -1,9 +0,0 @@ -info['login'].'"LIMIT 1'); - -mysql_query(''); \ No newline at end of file diff --git a/dress.php b/dress.php deleted file mode 100644 index f49a59a5..00000000 --- a/dress.php +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
    - - - - - - -
    - , , , - - , , , , , , - - , , , , - - , -
    .
    - - \ No newline at end of file diff --git a/dz.php b/dz.php deleted file mode 100644 index 627d389e..00000000 --- a/dz.php +++ /dev/null @@ -1,54 +0,0 @@ - '; - } -if ($kol >= 9 ){ - echo '
    10 '; // true - }else{ - echo ' '; - } -if ($skovoroda != $kol + $tme){ - echo '
    ' .$yaica;//true - }else{ - echo '' .$plita; - } -if ($tme == 10 && $kol < 50){ - echo ''; //false - } - else if ($tme == 30){ - echo '
    '.$yaica;//true ( ) - }else{ - echo ' '.$yaica; - } - -if ($tme = 31 || $kol = 10){ // true $tme = false a, $kol = true, , '||' 1 true - echo '
    '; - }else{ - echo ' '; - } -if ($tme > 41){ //false = - true - echo '$tme 33 '; - } - else if ($tme == 30){ - echo '
    '.$end_gotovka . $yaica; - }else{ - echo ' '; - } -?> \ No newline at end of file diff --git a/editor_shop.php b/editor_shop.php index 0bc9c8d8..a9d7f367 100644 --- a/editor_shop.php +++ b/editor_shop.php @@ -1,12 +1,13 @@ -info['id']) || $u->info['admin'] < 1) { - header('location: /index.php'); - die(); +if (!$u->info['admin']) { + header('location: /index.php'); + die(); } $sid = round((int)$_GET['sid']); @@ -15,129 +16,154 @@ $r = round((int)$_GET['r']); - - - - + + + + -
    - - - + + + + + + + +

    : - + + - - - - - - - -

    : + - : - -

    -


    -
    -

    -
    -
    (id ): .


    - - - - - - -
    -
    - -:
    - # -
    - -
    -
    - : .
    - : .
    - : .
    - : .
    -



    -

    -
    + "' . mysql_real_escape_string($_POST['item_add']) . '","1000000000","' . $sid . '","' . $r . '","1" + )' + ); + } + + $sp = mysql_query('SELECT `sid` FROM `items_shop` GROUP BY `sid`'); + while ($pl = mysql_fetch_array($sp)) { + echo ''; + } + ?> + + : + +

    +


    +
    +

    +
    +
    (id ): + .

    +
    +
    + + + + + + +
    +
    + -:
    + # +
    + +
    +
    + : .
    + : . +
    + : .
    + : . +
    +



    +
    +
    +
    \ No newline at end of file diff --git a/ekr.bac.php b/ekr.bac.php deleted file mode 100644 index 499641da..00000000 --- a/ekr.bac.php +++ /dev/null @@ -1,1013 +0,0 @@ -0.13
    . ! - - include('_incl_data/__config.php'); - include('_incl_data/class/__db_connect.php'); - include('_incl_data/class/__user.php'); - if(!isset($u->info['id'])) { - header('location: https://new-combats.com/'); - die(); - } - - class upload { - - protected function __construct() { } - - //static $save_path = '/var/www/bk2ru/data/www/new-combats.com/clan_prw/'; - static $save_path = 'clan_prw/'; - static $error = ''; - - static function saveimg($name,$max_mb = 2,$exts = 'jpg|png|jpeg|gif',$cnm = '',$mnw = 0,$mxw = 0,$mnh = 0,$mxh = 0) { - if (isset($_FILES[$name])) { - $f = &$_FILES[$name]; - if(isset($f['tmp_name'])) { - $width = 0; - $height = 0; - list($width, $height) = getimagesize($f['tmp_name']); - } - - if( $mnw != 0 && $mnw > $width ) { - self::$error = ' '.$mnw.' . ( '.$width.'x'.$height.')'; - }elseif( $mxw != 0 && $mxw < $width ) { - self::$error = ' '.$mxw.' . ( '.$width.'x'.$height.')'; - }elseif( $mnh != 0 && $mnh > $height ) { - self::$error = ' '.$mnh.' . ( '.$width.'x'.$height.')'; - }elseif( $mxh != 0 && $mxh < $height ) { - self::$error = ' '.$mxh.' . ( '.$width.'x'.$height.')'; - }elseif( !is_dir( self::$save_path ) ) { - self::$error = ' !'; - }elseif (($f['size'] <= $max_mb*1024*1024) && ($f['size'] > 0)) { - if ( - (preg_match('/\.('.$exts.')$/i',$f['name'],$ext))&& - (preg_match('/image/i',$f['type'])) - ) { - - $ext[1] = strtolower($ext[1]); - $fn = uniqid('f_',true).'.'.$ext[1]; - $fn2 = uniqid('f_',true).'.gif'; - if( $cnm != '' ) { - $fn = $cnm; - $fn2 = $cnm; - } - if (move_uploaded_file($f['tmp_name'], self::$save_path . $fn)) { - // , Rimage - //Rimage::resize(self::$save_path . $fn, self::$save_path . $fn2); - //@unlink(self::$save_path . $fn); // - return array($fn2,$fn,self::$save_path . $fn); - } else { - self::$error = ' '; - } - } else { - self::$error = ' . : '.$exts.''; - } - } else { - self::$error = ' . '.$max_mb.' '; - } - } else { - self::$error = ' '; - } - return false; - } // end saveimg - - } // end class - - $ball = mysql_fetch_array(mysql_query('SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "'.$u->info['id'].'" AND `good` > 0 LIMIT 1')); - $ball = 0+$ball[0]; -}else{ - $ball = mysql_fetch_array(mysql_query('SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "'.$user['id'].'" AND `good` > 0 LIMIT 1')); - $ball = 0+$ball[0]; -} - -$day1def = 50; // . . -$day2def = 1000 * ($u->info['level']-7); // . . - -$day1 = $day1def; -$day2 = $day2def; - -if( $day2 < 0 ) { $day2 = 0; } - -$timetoday = strtotime(date('d.m.Y')); -// -$dc1 = mysql_fetch_array(mysql_query('SELECT SUM(`money2`) FROM `user_operation` WHERE `time` >= "'.$timetoday.'" AND `uid` = "'.$u->info['id'].'" AND `type` = " " LIMIT 1')); -$dc2 = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `user_operation` WHERE `time` >= "'.$timetoday.'" AND `uid` = "'.$u->info['id'].'" AND `type` = " " LIMIT 1')); -$dc1 = $dc1[0]; -$dc2 = $dc2[0]; - -$day1 = round($day1+$dc1,2); -$day2 = round($day2+$dc2,2); - -if($day1 < 0) { $day1 = 0; } -if($day2 < 0) { $day2 = 0; } - - -$b1 = 0; // - -$bt = mysql_fetch_array(mysql_query('SELECT * FROM `bank_table` ORDER BY `time` DESC LIMIT 1')); - -$bns = array( - array( 0 , 0 , 0 ), - array( 10 , 1 , 0 ), - array( 50 , 2 , 0 ), - array( 100 , 3 , 0 ), - array( 200 , 4 , 0 ), - array( 300 , 5 , 0 ), - array( 400 , 6 , 0 ), - array( 500 , 7 , 0 ), - array( 600 , 8 , 0 ), - array( 700 , 9 , 0 ), - array( 800 , 10 , 0 ), - array( 900 , 11 , 0 ), - array( 1000 , 13 , 1 ), - array( 1100 , 15 , 2 ), - array( 1200 , 17 , 3 ), - array( 1300 , 19 , 4 ), - array( 1500 , 21 , 5 ), - array( 1700 , 23 , 6 ), - array( 2000 , 25 , 7 ), - array( 2500 , 27 , 8 ), - array( 3000 , 30 , 9 ) -); - -$bns2 = array( - array(0,0), - array(10,10), - array(20,10), - array(30,10), - array(40,10), - array(50,10), - array(60,10), - array(70,10), - array(80,10), - array(90,10), - array(100,20) -); - -$i = 0; -while( $i < count($bns) ) { - if( isset($bns[$i][0]) && $ball > $bns[$i][0] ) { - $b1 = $i; - } - $i++; -} - -if( isset($backdoor) ) { - $i = 0; - while( $i < count($bns2) ) { - if( isset($bns2[$i][0]) && $pay['ekr'] >= $bns2[$i][0] ) { - $b2 = $i; - } - $i++; - } -} - -if(!isset($backdoor)) { - - if(isset($_POST['do']) && $_POST['do'] == 'newShadow') { - $o = mysql_fetch_array(mysql_query('SELECT * FROM `_obraz` WHERE `uid` = "'.$u->info['id'].'" AND `good` = 0 AND `cancel` = 0 AND `img` = "'.mysql_real_escape_string($_POST['ffinput']).'" LIMIT 1')); - if(!isset($o['id'])) { - $u->error = ' ! !'; - }elseif( $o['price'] > $u->info['money2'] ) { - $u->error = ' '; - }else{ - // - $u->info['money2'] -= $o['price']; - mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - mysql_query('UPDATE `_obraz` SET `good` = "'.time().'" WHERE `id` = "'.$o['id'].'" LIMIT 1'); - if( $o['type'] == 1 || $o['type'] == 2 ) { - // - copy('clan_prw/'.$o['img'],'./img.new-combats.com/i/obraz/'.$o['sex'].'/buy'.$o['id'].'.gif'); - }elseif( $o['type'] == 3 ) { - // - copy('clan_prw/'.$o['img'],'./img.new-combats.com/pet/buy'.$o['id'].'.gif'); - }elseif( $o['type'] == 5 ) { - // - copy('clan_prw/'.$o['img'],'./img.new-combats.com/i/smile/s'.$o['id'].'.gif'); - } - // - if( $_POST['ffsex'] == 1 ) { - $o['sex'] = 1; - }elseif( $_POST['ffsex'] == 0 ) { - $o['sex'] = 0; - } - // - if( $o['clan'] > 0 ) { - $o['uid1'] = 0; - }else{ - $o['uid1'] = $o['uid']; - } - // - if( $o['type'] == 1 || $o['type'] == 2 ) { - // - mysql_query('INSERT INTO `obraz` ( - `sex`,`uid`,`img`,`usr_add`,`clan` - ) VALUES ( - "'.$o['sex'].'","'.$o['uid1'].'","buy'.$o['id'].'.gif","'.$o['uid'].'","'.$o['clan'].'" - )'); - }elseif( $o['type'] == 3 ) { - // - mysql_query('INSERT INTO `obraz_pet` ( - `uid`,`time`,`img` - ) VALUES ( - "'.$u->info['id'].'","'.time().'","'.mysql_real_escape_string('buy'.$o['id'].'.gif').'" - )'); - }elseif( $o['type'] == 5 ) { - // - $u->info['add_smiles'] .= ',s'.$o['id'].''; - $u->info['add_smiles'] = ltrim($u->info['add_smiles'],','); - mysql_query('UPDATE `users` SET `add_smiles` = "'.$u->info['add_smiles'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - // - if( $o['type'] == 1 ) { - $u->error = ' ! , .'; - }elseif( $o['type'] == 2 ) { - $u->error = ' ! , .'; - }elseif( $o['type'] == 3 ) { - $u->error = ' ! , .'; - }elseif( $o['type'] == 5 ) { - $u->error = ' ! . :s'.$o['id'].':'; - } - } - }elseif(isset($_FILES['img'])) { - // - $ekr = 100; - if( $u->info['money2'] < $ekr ) { - echo '{"err":" "}'; - }else{ - $obraz = 'f_shadow1_'.$u->info['id'].'-'.md5((time()-rand(0,1000)).'#shadow1').'.gif'; - // - if($file = upload::saveimg('img',0.5,'gif',$obraz,120,120,220,220)) { - // - //$u->info['money2'] -= $ekr; - //mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - mysql_query('INSERT INTO `_obraz` ( `uid`,`time`,`price`,`good`,`cancel`,`img`,`sex`,`type`,`clan` ) VALUES ( - "'.$u->info['id'].'", - "'.time().'", - "'.mysql_real_escape_string($ekr).'", - "0", - "0", - "'.mysql_real_escape_string($obraz).'", - "'.$u->info['sex'].'", - "1", - "0" - ) '); - echo '{"img":"'.$obraz.'"}'; - }else{ - echo '{"err":"'.upload::$error.'"}'; - } - } - die(); - }elseif(isset($_FILES['img5'])) { - // - $ekr = 10; - $ekr_smile = 10; - if( $u->info['money2'] < $ekr ) { - echo '{"err":" "}'; - }else{ - $obraz = 'f_smile_'.$u->info['id'].'-'.md5((time()-rand(0,1000)).'#smile').'.gif'; - // - if($file = upload::saveimg('img5',0.05,'gif',$obraz,15,100,15,50)) { - // - //$u->info['money2'] -= $ekr; - //mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - mysql_query('INSERT INTO `_obraz` ( `uid`,`time`,`price`,`good`,`cancel`,`img`,`sex`,`type`,`clan` ) VALUES ( - "'.$u->info['id'].'", - "'.time().'", - "'.mysql_real_escape_string($ekr).'", - "0", - "0", - "'.mysql_real_escape_string($obraz).'", - "0", - "5", - "0" - ) '); - echo '{"img":"'.$obraz.'"}'; - }else{ - echo '{"err":"'.upload::$error.'"}'; - } - } - die(); - }elseif(isset($_FILES['img2'])) { - // - $ekr = 49.99; - if( $u->info['clan'] == 0 ) { - echo '{"err":" "}'; - }elseif( $u->info['money2'] < $ekr ) { - echo '{"err":" "}'; - }else{ - $obraz = 'f_shadow2_'.$u->info['id'].'-'.md5((time()-rand(0,1000)).'#shadow2').'.gif'; - // - if($file = upload::saveimg('img2',0.3,'gif',$obraz,120,120,220,220)) { - // - //$u->info['money2'] -= $ekr; - //mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - mysql_query('INSERT INTO `_obraz` ( `uid`,`time`,`price`,`good`,`cancel`,`img`,`sex`,`type`,`clan` ) VALUES ( - "'.$u->info['id'].'", - "'.time().'", - "'.mysql_real_escape_string($ekr).'", - "0", - "0", - "'.mysql_real_escape_string($obraz).'", - "'.$u->info['sex'].'", - "2", - "'.$u->info['clan'].'" - ) '); - echo '{"img":"'.$obraz.'"}'; - }else{ - echo '{"err":"'.upload::$error.'"}'; - } - } - die(); - }elseif(isset($_FILES['img4'])) { - // - $ekr = 4.99; - if( $u->info['money2'] < $ekr ) { - echo '{"err":" "}'; - }else{ - $obraz = 'f_shadow3_'.$u->info['id'].'-'.md5((time()-rand(0,1000)).'#shadow3').'.gif'; - // - if($file = upload::saveimg('img4',0.3,'gif',$obraz,120,120,40,40)) { - // - //$u->info['money2'] -= $ekr; - //mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - mysql_query('INSERT INTO `_obraz` ( `uid`,`time`,`price`,`good`,`cancel`,`img`,`sex`,`type`,`clan` ) VALUES ( - "'.$u->info['id'].'", - "'.time().'", - "'.mysql_real_escape_string($ekr).'", - "0", - "0", - "'.mysql_real_escape_string($obraz).'", - "'.$u->info['sex'].'", - "3", - "'.$u->info['clan'].'" - ) '); - echo '{"img":"'.$obraz.'"}'; - }else{ - echo '{"err":"'.upload::$error.'"}'; - } - } - die(); - }elseif(isset($_POST['kr001'])) { - // . - $kr = round($_POST['kr001'],2); - if( $c['crtoecr'] < 0.01 ) { - $u->error = ' .'; - }elseif( $day2 < 0.01 ) { - $u->error = ' , .'; - }elseif( $kr < round($c['crtoecr']/100,2) ) { - $u->error = ' '.round($c['crtoecr']/100,2).' .'; - }elseif( $kr > $day2 ) { - $u->error = ' '.$day2.' .'; - }elseif( $kr > $u->info['money']) { - $u->error = ' .'; - }else{ - $ekr = round($kr / $c['crtoecr'],2); - $u->error = ' '.$kr.' '.$ekr.' .'; - // - $u->info['money'] -= $kr; - $u->info['money2'] += $ekr; - // - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'",`money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('INSERT INTO `user_operation` ( `uid`,`time`,`money`,`money2`,`type`,`b1`,`b2` ) VALUES ( - "'.$u->info['id'].'","'.time().'","'.round(-$kr,2).'","'.round($ekr,2).'"," ","'.$u->info['money'].'","'.$u->info['money2'].'" - )'); - } - $dc1 = mysql_fetch_array(mysql_query('SELECT SUM(`money2`) FROM `user_operation` WHERE `time` >= "'.$timetoday.'" AND `uid` = "'.$u->info['id'].'" AND `type` = " " LIMIT 1')); - $dc2 = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `user_operation` WHERE `time` >= "'.$timetoday.'" AND `uid` = "'.$u->info['id'].'" AND `type` = " " LIMIT 1')); - $dc1 = $dc1[0]; - $dc2 = $dc2[0]; - $day1 = round($day1def+$dc1,2); - $day2 = round($day2def+$dc2,2); - }elseif(isset($_POST['ekr2'])) { - // . - $ekr = round($_POST['ekr2'],2); - if( $c['ecrtocr']*2.5 < 0.01 ) { - $u->error = ' .'; - }elseif( $day1 < 0.01 ) { - $u->error = ' , .'; - }elseif( $ekr < 0.01 ) { - $u->error = ' 0.01 .'; - }elseif( $ekr > $day1 ) { - $u->error = ' '.$day1.' .'; - }elseif( $ekr > $u->info['money2']) { - $u->error = ' .'; - }else{ - $kr = round($ekr * $c['ecrtocr']*2.5,2); - $u->error = ' '.$ekr.' '.$kr.' .'; - // - $u->info['money'] += $kr; - $u->info['money2'] -= $ekr; - // - mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'",`money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('INSERT INTO `user_operation` ( `uid`,`time`,`money`,`money2`,`type`,`b1`,`b2` ) VALUES ( - "'.$u->info['id'].'","'.time().'","'.round($kr,2).'","'.round(-$ekr,2).'"," ","'.$u->info['money'].'","'.$u->info['money2'].'" - )'); - } - $dc1 = mysql_fetch_array(mysql_query('SELECT SUM(`money2`) FROM `user_operation` WHERE `time` >= "'.$timetoday.'" AND `uid` = "'.$u->info['id'].'" AND `type` = " " LIMIT 1')); - $dc2 = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `user_operation` WHERE `time` >= "'.$timetoday.'" AND `uid` = "'.$u->info['id'].'" AND `type` = " " LIMIT 1')); - $dc1 = $dc1[0]; - $dc2 = $dc2[0]; - $day1 = round($day1def+$dc1,2); - $day2 = round($day2def+$dc2,2); - }elseif(isset($_POST['login'])) { - // - function en_ru($txt) { - $g = false; - $en = preg_match("/^(([0-9a-zA-Z _-])+)$/i", $txt); - $ru = preg_match("/^(([0-9-- _-])+)$/i", $txt); - if(($ru && $en) || (!$ru && !$en)) { - $g = true; - } - return $g; - } - // - function testBad($txt) { - $white = '-_ 0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM޸'; - $r = false; - $i = 0; - while( $i != -1 ) { - if( isset($txt[$i]) ) { - $g = false; - $j = 0; - while( $j != -1 ) { - if(isset($white[$j])) { - if( $white[$j] == $txt[$i] ) { - $g = true; - } - }else{ - $j = -2; - } - $j++; - } - if( $g == false ) { - $r = true; - } - }else{ - $i = -2; - } - $i++; - } - return $r; - } - - function is_login($login) { - $r = true; - // - $login = htmlspecialchars($login,NULL,'cp1251'); - // - $bad = array( - '' => 1, - '' => 1 - ); - // - $login_db = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($login).'" LIMIT 1')); - if( isset($login_db['id']) || isset($bad[$login]) ) { - $r = false; - }else{ - $true = true; - // - /* - 4 16 , , , '_', '-' . - '_', '-' . - */ - // - $login = str_replace(' ',' ',$login); - $login = str_replace('%',' ',$login); - $login = str_replace(' ',' ',$login); - // - if( strlen($login) > 16 ) { - $true = false; - }elseif( strlen($login) < 4 ) { - $true = false; - }elseif( strripos($login,' ') == true ) { - $true = false; - }elseif( substr($login,1) == ' ' || substr($login,-1) == ' ' ) { - $true = false; - }elseif( substr($login,1) == '-' || substr($login,-1) == '-' ) { - $true = false; - }elseif( substr($login,1) == '_' || substr($login,-1) == '_' ) { - $true = false; - }elseif( testBad($login) == true ) { - $true = false; - }elseif( en_ru(str_replace('','',str_replace('','',$login))) == true ) { - $true = false; - } - // - if( $true == false ) { - $r = false; - }else{ - $r = true; - } - } - return $r; - } - if( $u->info['login'] == $_POST['login'] ) { - $u->error = ' ...'; - }elseif( $u->info['money2'] < 25 ) { - $u->error = ' .'; - }else{ - $login = htmlspecialchars($_POST['login'],NULL,'cp1251'); - if( is_login($login) == true ) { - mysql_query('INSERT INTO `lastnames` ( `uid`,`login`,`newlogin`,`time` ) VALUES ( - "'.$u->info['id'].'","'.$u->info['login'].'","'.mysql_real_escape_string($login).'","'.time().'" - )'); - $u->info['login_last'] = $u->info['login']; - $u->info['login'] = $login; - $u->info['money2'] -= 25; - // - mysql_query("UPDATE `items_users` SET `data` = replace( `data` , 'sudba=".$u->info['login_last']."', 'sudba=".mysql_real_escape_string($u->info['login'])."') WHERE `data` LIKE '%sudba=".mysql_real_escape_string($u->info['login_last'])."%' AND `uid` = '".$u->info['id']."'"); - // - mysql_query('UPDATE `users` SET `login` = "'.mysql_real_escape_string($u->info['login']).'", `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->error = ' "'.$u->info['login'].'" .'; - }else{ - $u->error = ' ...'; - } - } - }elseif(isset($_GET['buy_ekr'])) { - // - $mrh_login = "65643"; - $mrh_pass1 = "qtzl0igb"; - // - $inv_id = 0; - // - $out_ekr = round($_POST['ekr'],2); - if( $out_ekr < 0) { - // - $out_ekr = 0; - } - $out_summ = round($out_ekr*$bt['cur'],2); - $inv_desc = ' '.$out_ekr.' ., '.$u->info['id'].', '.round((int)$_POST['ref']).''; - // - $shp_item = 0; - // - // , - $out_ekr0 = $out_ekr; - // - $out_ekr += round($out_ekr0/100*$bns[$b1][1],2); - $i = 0; - while( $i < count($bns2) ) { - if( isset($bns2[$i][0]) && $out_ekr >= $bns2[$i][0] ) { - $b2_2 = $i; - } - $i++; - } - $out_ekr += round($out_ekr0/100*$bns2[$b2_2][1],2); - if($ball == 0) { - $out_ekr += round($out_ekr0/100*20,2); - } - // - // - mysql_query('INSERT INTO `pay_operation` ( - `uid`,`bank`,`code`,`ekr`,`time`,`good`,`cur`,`var`,`val`,`ref`,`ref2`,`ip`,`date` - ) VALUES ( - "'.$u->info['id'].'","'.$u->bank['id'].'","'.mysql_real_escape_string((int)$_GET['code']).'","'.mysql_real_escape_string($out_ekr).'", - "'.time().'","0","'.mysql_real_escape_string($cur['cur']).'","buy_ekr","0","'.mysql_real_escape_string($u->info['host_reg']).'", - "'.mysql_real_escape_string((int)$_GET['ref']).'","'.mysql_real_escape_string(IP).'","'.date('Y-m-d H:i:s').'" - )'); - - $shp_item = mysql_insert_id(); - - if($shp_item > 0) { - // - }else{ - die(' , '); - } - if($out_ekr < 1) { - die(' 1 .'); - } - // - // - // default payment e-currency - $in_curr = ""; - - // - // language - $culture = "ru"; - - // - // generate signature - - - - - //$crc = md5("$mrh_login:$out_summ:$inv_id:$mrh_pass1:Shp_item=$shp_item"); - $crc = md5($mrh_login.':'.$out_summ.':'.$mrh_pass1.':'.$shp_item); - - // - // payment form - $url = 'https://www.free-kassa.ru/merchant/cash.php?'; - $url .= 'm='.$mrh_login.'&'; - $url .= 'oa='.$out_summ.'&'; - $url .= 'InvId='.$inv_id.'&'; - $url .= 'Desc='.$inv_desc.'&'; - $url .= 's='.$crc.'&'; - $url .= 'o='.$shp_item.'&'; - $url .= 'i='.$in_curr.'&'; - $url .= 'lang='.$culture.'&'; - // - header('location: '.$url); - die(); - print "". - "
    ". - " : ".$out_ekr." . ". - "". - "". - "". - "". - "". - "". - "". - "". - "
    ". - "( )". - "
    "; - die(); - } - -?> - - - - - - - - - - - - - - - - -
    - - - - - - - info['id'])) { ?> -
    : '.$u->microLogin($u->info['id'],1).'';?>
    - error != '' ) { - echo '
    '.$u->error.'
    '; - } - ?> - freekassa  - interkassa - - - - - - - - - - - - - - - -
    ! ,
    20% . -
    -
    -
    - : % ( ) -
    - -
    - - -
    - :  
    - - - -
     
     
     
    - - - - - - -
    1
    1 *
    - - * -
    - , ! -

    - , 1 . , FREE-KASSA. -
    -

    -
    - - -
    -
    - -
    - , , . -

    -
    -
    - -
    -
    - : info['money2']?> info['money']?> . -
    - -
    - -
    - 1=:    
    -
    -
    - =1:  
    -
    - -
    - -
    - - - - - - - - - - - - - -
    800 10%3 000 30%
    700 9%2 500 27%
    600 8%2 000 25%
    500 7%1 700 23%
    400 6%1 500 21%
    300 5%1 300 19%
    200 4%1 200 17%
    100 3%1 100 15%
    50 2%1 000 13%
    10 1%900 11%
    -
    - -
    - - - - - - - -
    10%10%10%10%10%
    10 20 30 40 50
    10%10%10%10%20%
    60 70 80 90 100
    -
    - -
    - - - - -
    - - - : 100
    - :
    - GIF- 120x220 () 300 .
    -
    - : - -
    -
    - -
    - - - :
    - :
    - GIF- 15x15 95x21 () 30 .
    -
    - : - -
    -
    - -
    - - - : 25
    - : info['login']?>
    -
    - -
    - -
    - -
    -
    - -
     
    - -
    - - - \ No newline at end of file diff --git a/enter.php b/enter.php index 608a9f82..99cafe08 100644 --- a/enter.php +++ b/enter.php @@ -1,62 +1,39 @@ location = "index.php?error='.$e.'";') - //die('Location: index.php?error='.$e); - die(' + die('
    @@ -64,7 +41,7 @@ function error($e)
    - '.$e.' + ' . $e . '
    @@ -78,99 +55,41 @@ function error($e) function md5m($src) { - - $tar = Array(16); - $res = Array(16); -$src = utf8_encode ($src); - for ($i = 0; $i < strlen($src) || $i < 16; $i++) - { - $res[$i] = ord($src{$i}) ^ $i * 4; - } - for ($i = 0; $i < 4; $i++) - { - for ($j = 0; $j < 4; $j++) - { + + $tar = [16]; + $res = [16]; + $src = utf8_encode($src); + for ($i = 0; $i < strlen($src) || $i < 16; $i++) { + $res[$i] = ord($src[$i]) ^ $i * 4; + } + for ($i = 0; $i < 4; $i++) { + for ($j = 0; $j < 4; $j++) { $tar[$i * 4 + $j] = ($res[$j * 4 + $i] + 256) % 256; - } - } + } + } return ($tar); -} +} + function array2HStr($src) { - $hex = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"); + $hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; $res = ""; - for ($i = 0; $i < 16; $i++) - { + for ($i = 0; $i < 16; $i++) { $res = $res . ($hex[$src[$i] >> 4] . $hex[$src[$i] % 16]); - } + } return ($res); } $socauth = false; -/* -if(isset($_GET['vk-auth'])) { - - $client_id = '5145826'; // ID - $client_secret = 'V90yIzlgSglfgrnHw7Ny'; // - $redirect_uri = 'https://new-combats.com/enter?vk-auth'; // - - $url = 'https://oauth.vk.com/authorize'; - - $params = array( - 'client_id' => $client_id, - 'redirect_uri' => $redirect_uri, - 'response_type' => 'code' - ); - - if(isset($_GET['code'])) { - $result = false; - $params = array( - 'client_id' => $client_id, - 'client_secret' => $client_secret, - 'code' => $_GET['code'], - 'redirect_uri' => $redirect_uri - ); - - $token = json_decode(file_get_contents('httpss://oauth.vk.com/access_token' . '?' . urldecode(https_build_query($params))), true); - - if (isset($token['access_token'])) { - $params = array( - 'uids' => $token['user_id'], - 'fields' => 'uid,first_name,last_name,screen_name,sex,bdate,photo_big', - 'access_token' => $token['access_token'] - ); - - $userInfo = json_decode(file_get_contents('httpss://api.vk.com/method/users.get' . '?' . urldecode(https_build_query($params))), true); - if (isset($userInfo['response'][0]['uid'])) { - $userInfo = $userInfo['response'][0]; - $result = true; - } - } - - if(isset($userInfo['uid'])) { - $scl = mysql_fetch_array(mysql_query('SELECT * FROM `mini_actions` WHERE `val` = "vkauth" AND `ok` = "'.mysql_real_escape_string($userInfo['uid']).'" ORDER BY `time` DESC LIMIT 1')); - if(isset($scl['id'])) { - $scl = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$scl['uid'].'" LIMIT 1')); - $_POST['login'] = $scl['login']; - $socauth = true; - }else{ - error(' #'.$userInfo['uid'].' .'); - } - }else{ - error(' '); - } - } -} -*/ //ReCapthca require_once "./recaptchalib.php"; // $secret = "6Lf3EjsaAAAAALe3zRwxyPGf13ZMWZvCmvad3-jQ"; - + // $response = null; - + // $reCaptcha = new ReCaptcha($secret); @@ -182,332 +101,252 @@ $response = $reCaptcha->verifyResponse( } //ReCapthca -if (1==1)//(($response != null && $response->success=true) || $_POST['code'] != '' || $_GET['code'] != '') -{ - +$u = mysql_fetch_array(mysql_query('SELECT `u`.`pass2`,`u`.`id`,`u`.`auth`,`u`.`login`,`u`.`pass`,`u`.`city`,`u`.`ip`,`u`.`ipreg`,`u`.`online`,`u`.`banned`,`u`.`admin`,`u`.`host_reg`,`u`.`securetime`,`u`.`timereg` FROM `users` AS `u` WHERE `u`.`login`="' . mysql_real_escape_string($_POST['login']) . '" ORDER BY `id` ASC LIMIT 1')); - -$u = mysql_fetch_array(mysql_query('SELECT `u`.`pass2`,`u`.`id`,`u`.`auth`,`u`.`login`,`u`.`pass`,`u`.`city`,`u`.`ip`,`u`.`ipreg`,`u`.`online`,`u`.`banned`,`u`.`admin`,`u`.`host_reg`,`u`.`securetime`,`u`.`timereg` FROM `users` AS `u` WHERE `u`.`login`="'.mysql_real_escape_string($_POST['login']).'" ORDER BY `id` ASC LIMIT 1')); - -$auth = mysql_fetch_array(mysql_query('SELECT * FROM `logs_auth` WHERE `uid` = "'.$u['id'].'" AND `ip` = "'.mysql_real_escape_string(IP).'" LIMIT 1')); -if( $c['securetime'] > 0 && IP != $u['ip'] && IP != $u['ipreg'] && !isset($auth['id']) && $u['securetime'] < $c['securetime'] && $u['timereg'] < $c['securetime'] ) { - error(' "'.$_POST['login'].'".
    . :

    , .
    E-mail: , .'); +$auth = mysql_fetch_array(mysql_query('SELECT * FROM `logs_auth` WHERE `uid` = "' . $u['id'] . '" AND `ip` = "' . mysql_real_escape_string(IP) . '" LIMIT 1')); +if ($c['securetime'] > 0 && IP != $u['ip'] && IP != $u['ipreg'] && !isset($auth['id']) && $u['securetime'] < $c['securetime'] && $u['timereg'] < $c['securetime']) { + error(' "' . $_POST['login'] . '".
    . :

    , .
    E-mail: , .'); } - -/*if($u['host_reg'] == 'new-combats.com' && $u['online'] == 0) { - $_POST['pass'] = md5($_POST['pass']); - if($u['pass'] == md5($_POST['pass'])) { - $u['pass'] = $_POST['pass']; - mysql_query('UPDATE `users` SET `pass` = "'.mysql_real_escape_string($_POST['pass']).'",`online` = "'.time().'" WHERE `id` = "'.mysql_real_escape_string($u['id']).'" LIMIT 1'); - error(' . .'); - } -}*/ - -if( md5(md5($_POST['pass'])) == $u['pass'] ) { - $_POST['pass'] = md5($_POST['pass']); +if (md5(md5($_POST['pass'])) == $u['pass']) { + $_POST['pass'] = md5($_POST['pass']); } -if(!isset($u['id'])) -{ - error(' "'.$_POST['login'].'" .'); -}elseif($u['pass']!=md5($_POST['pass']) && $socauth == false) -{ - error(' "'.$_POST['login'].'".'); - mysql_query("INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('".$u['id']."','".mysql_real_escape_string(IP)."','".mysql_real_escape_string($_SERVER['HTTP_USER_AGENT'])."','3','".time()."','".mysql_real_escape_string($_POST['pass'])."')"); -}elseif($u['banned']>0) -{ - $fm = mysql_fetch_array(mysql_query('SELECT * FROM `users_delo` WHERE `uid` = "'.$u['id'].'" AND `hb`!=0 ORDER BY `id` DESC LIMIT 1')); - if(!isset($fm['id'])) { - $fm['text'] = ' : - .'; - } - error( - ' '.$_POST['login'].' .'. - '
    '.$fm['text'].'
    '. - '
    ! , , , !'. - '
    , .' - .'

    , .' - ); -}else{ - - // - if( $u['pass2'] != '' && $u['pass2'] != '0' ) { - $_SESSION['login'] = $_POST['login']; - $_SESSION['pass'] = $_POST['pass']; - $good2 = false; - $koko = ''; - if( md5(array2HStr(md5m($_POST['code']))) == $u['pass2'] ) { - $good2 = true; - unset($_SESSION['login'],$_SESSION['pass']); - }else{ - if (isset($_POST['code'])) - {$koko = '
    ';}; - setcookie('login','',time()-60*60*24,'',$c['host']); - setcookie('pass','',time()-60*60*24,'',$c['host']); - setcookie('login','',time()-60*60*24); - setcookie('pass','',time()-60*60*24); - } - - if( $koko != '' ) { - $koko = ''.$koko.''; - } - if( $good2 == false ) { -?> - - - - - - - - - -

    .

    - -
    -
    -
    - - -
    -
    - - - -
    - - - -
    - - - -
    - - - -
    -
    - - - - + - -= 13 && (int)date('d') <= 13) { - mysql_query('DELETE FROM `eff_users` WHERE `id_eff` = 365 AND `uid` = "'.$u['id'].'"'); - mysql_query('INSERT INTO `eff_users` ( + function getRandomInt(max) { + return Math.floor(Math.random() * Math.floor(max)); + } + + function keypush(n) { + if (n == 12) { + + if (lenth > 0) { + + dopass = ''; + + lenth = 0; + document.getElementById('pass').setAttribute("src", "i/pin/e" + lenth + ".png"); + } + } else if (n == 11) { + + var $_POST = ; + window.location.replace("https://new-combats.com/enter.php?code=" + dopass + "&login=" + $_POST['login'] + "&pass=" + $_POST['pass']); + + } else { + + if (lenth < 8) { + dopass = dopass + '' + n; + lenth++; + document.getElementById('pass').setAttribute("src", "i/pin/e" + lenth + ".png"); + } + + } + + } + + + = 13 && (int)date('d') <= 13) { + mysql_query('DELETE FROM `eff_users` WHERE `id_eff` = 365 AND `uid` = "' . $u['id'] . '"'); + mysql_query('INSERT INTO `eff_users` ( `id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`no_Ace` ) VALUES ( - "365","'.$u['id'].'"," ","add_speedhp=500|add_speedmp=500|add_speed_dungeon=50|add_repair_discount=1|","47","'.time().'",1 + "365","' . $u['id'] . '"," ","add_speedhp=500|add_speedmp=500|add_speed_dungeon=50|add_repair_discount=1|","47","' . time() . '",1 )'); - $chat->send('',$u['room'],$u['city'],'',$u['login'],' " "! ( )',time(),6,0,0,0,1); - } - - if(isset($_COOKIE['ip']) && $_COOKIE['ip']!=IP) - { - mysql_query("INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('".$u['id']."','".mysql_real_escape_string($_COOKIE['ip'])."','".mysql_real_escape_string($_SERVER['HTTP_USER_AGENT'])."','1','".time()."','".mysql_real_escape_string(md5($_POST['pass']))."')"); - } - - setcookie('login',$_POST['login'],time()+60*60*24*7,'',$c['host']); - setcookie('pass',$u['pass'],time()+60*60*24*7,'',$c['host']); - setcookie('login',$_POST['login'],time()+60*60*24*7); - setcookie('pass',md5($_POST['pass']),time()+60*60*24*7); - setcookie('ip',IP,time()+60*60*24*150,''); - - if($u['online'] < time()-520) { - $sp = mysql_query('SELECT `user` FROM `friends` WHERE `friend` = "'.$u['id'].'"'); - while( $pl = mysql_fetch_array($sp) ) { - $usr = mysql_fetch_array(mysql_query('SELECT `id`,`online`,`login`,`city`,`room` FROM `users` WHERE `id` = "'.$pl['user'].'" LIMIT 1')); - if( isset($usr['id']) && $usr['online'] > time()-600 ) { - $chat->send('',$usr['room'],$usr['city'],'',$usr['login'],' : '.$u['login'].'.',time(),6,0,0,0,1); - } - } - } - - $apu = ''; + $chat->send('', $u['room'], $u['city'], '', $u['login'], ' " "! ( )', time(), 6, 0, 0, 0, 1); + } - mysql_query('UPDATE `dump` SET `ver` = "1",`upd` = "2" WHERE `uid` = "'.$u['id'].'"'); + if (isset($_COOKIE['ip']) && $_COOKIE['ip'] != IP) { + mysql_query("INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('" . $u['id'] . "','" . mysql_real_escape_string($_COOKIE['ip']) . "','" . mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']) . "','1','" . time() . "','" . mysql_real_escape_string(md5($_POST['pass'])) . "')"); + } - if($u['auth'] != md5($u['login'].'AUTH'.IP) || $_COOKIE['auth'] != md5($u['login'].'AUTH'.IP) || $u['auth']=='' || $u['auth']=='0') - { - if($u['auth'] != '' && $u['auth'] != '0' && $u['ip'] != IP) { - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','".$u['login']."',' ".date('d.m.Y H:i',$u['online']).". ( ip: %".$u['ip'].")','-1','6','0')"); - } - $apu = "`auth` = '".md5($u['login'].'AUTH'.IP)."',"; - setcookie('auth',md5($u['login'].'AUTH'.IP),time()+60*60*24*365,'','new-combats.com'); - } - - if($u['repass'] == 0) { - $ipnew = IP; - }else{ - $ipnew = $u['ip']; - } - + setcookie('login', $_POST['login'], time() + 60 * 60 * 24 * 7, '', $c['host']); + setcookie('pass', $u['pass'], time() + 60 * 60 * 24 * 7, '', $c['host']); + setcookie('login', $_POST['login'], time() + 60 * 60 * 24 * 7); + setcookie('pass', md5($_POST['pass']), time() + 60 * 60 * 24 * 7); + setcookie('ip', IP, time() + 60 * 60 * 24 * 150, ''); - mysql_query("INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('".$u['id']."','".IP."','".mysql_real_escape_string($_SERVER['HTTP_USER_AGENT'])."','0','".time()."','".mysql_real_escape_string(md5($_POST['pass']))."')"); + if ($u['online'] < time() - 520) { + $sp = mysql_query('SELECT `user` FROM `friends` WHERE `friend` = "' . $u['id'] . '"'); + while ($pl = mysql_fetch_array($sp)) { + $usr = mysql_fetch_array(mysql_query('SELECT `id`,`online`,`login`,`city`,`room` FROM `users` WHERE `id` = "' . $pl['user'] . '" LIMIT 1')); + if (isset($usr['id']) && $usr['online'] > time() - 600) { + $chat->send('', $usr['room'], $usr['city'], '', $usr['login'], ' : ' . $u['login'] . '.', time(), 6, 0, 0, 0, 1); + } + } + } - mysql_query("UPDATE `users` SET ".$apu."`ip`='".$ipnew."',`dateEnter`='".mysql_real_escape_string($_SERVER['HTTP_USER_AGENT'])."',`online`='".time()."' WHERE `login` = '".mysql_real_escape_string($_POST['login'])."' AND `pass` = '".mysql_real_escape_string(md5($_POST['pass']))."' LIMIT 1"); - - if(isset($_POST['active_code_key'])) { - header('location: /active.php?code='.htmlspecialchars($_POST['active_code_key'],NULL,'cp1251')); - }else{ - header('location: /bk'); - } + $apu = ''; + + mysql_query('UPDATE `dump` SET `ver` = "1",`upd` = "2" WHERE `uid` = "' . $u['id'] . '"'); + + if ($u['auth'] != md5($u['login'] . 'AUTH' . IP) || $_COOKIE['auth'] != md5($u['login'] . 'AUTH' . IP) || $u['auth'] == '' || $u['auth'] == '0') { + if ($u['auth'] != '' && $u['auth'] != '0' && $u['ip'] != IP) { + mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','" . $u['login'] . "',' " . date('d.m.Y H:i', $u['online']) . ". ( ip: %" . $u['ip'] . ")','-1','6','0')"); + } + $apu = "`auth` = '" . md5($u['login'] . 'AUTH' . IP) . "',"; + setcookie('auth', md5($u['login'] . 'AUTH' . IP), time() + 60 * 60 * 24 * 365, '', 'new-combats.com'); + } + + if ($u['repass'] == 0) { + $ipnew = IP; + } else { + $ipnew = $u['ip']; + } + + + mysql_query("INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('" . $u['id'] . "','" . IP . "','" . mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']) . "','0','" . time() . "','" . mysql_real_escape_string(md5($_POST['pass'])) . "')"); + + mysql_query("UPDATE `users` SET " . $apu . "`ip`='" . $ipnew . "',`dateEnter`='" . mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']) . "',`online`='" . time() . "' WHERE `login` = '" . mysql_real_escape_string($_POST['login']) . "' AND `pass` = '" . mysql_real_escape_string(md5($_POST['pass'])) . "' LIMIT 1"); + + if (isset($_POST['active_code_key'])) { + header('location: /active.php?code=' . htmlspecialchars($_POST['active_code_key'], null, 'cp1251')); + } else { + header('location: /bk'); + } } - } - else - { - error(' ReCaptcha!'); - //echo " ReCaptcha!
    "; - - } -?> diff --git a/enter2.php b/enter2.php index 393301ef..af5bae54 100644 --- a/enter2.php +++ b/enter2.php @@ -1,112 +1,77 @@ - - - - - . -
    -
    - - -
    -
    - - - -
    - - - -
    - - - -
    - - - -
    -
    - - + + + + + .

    +

    +
    +
    +
    + + + +
    +
    + + diff --git a/error.css b/error.css index 1ac7e8de..54a88ee7 100644 --- a/error.css +++ b/error.css @@ -1,63 +1,63 @@ -@import url(https://fonts.googleapis.com/css?family=Raleway:700); - -$color1: #EE4B5E; -$color2: #342643; -$color3: #1FA9D6; - -*, *:before, *:after { - box-sizing: border-box; -} -html { - height: 100%; -} -body { - background: url(https://i.imgur.com/76NZB7A.gif) no-repeat center center fixed; - background-size: cover; - font-family: 'Raleway', sans-serif; - background-color: $color2; - height: 100%; -} - -.text-wrapper { - height: 100%; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.title { - font-size: 6em; - font-weight: 700; - color: $color1; -} - -.subtitle { - font-size: 40px; - font-weight: 700; - color: $color3; -} - -.buttons { - margin: 30px; - - a.button { - font-weight: 700; - border: 2px solid $color1; - text-decoration: none; - padding: 15px; - text-transform: uppercase; - color: $color1; - border-radius: 26px; - transition: all 0.2s ease-in-out; - - &:hover { - background-color: $color1; - color: white; - transition: all 0.2s ease-in-out; - } - } - - -} - +@import url(https://fonts.googleapis.com/css?family=Raleway:700); + +$color1: #EE4B5E; +$color2: #342643; +$color3: #1FA9D6; + +*, *:before, *:after { + box-sizing: border-box; +} +html { + height: 100%; +} +body { + background: url(https://i.imgur.com/76NZB7A.gif) no-repeat center center fixed; + background-size: cover; + font-family: 'Raleway', sans-serif; + background-color: $color2; + height: 100%; +} + +.text-wrapper { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.title { + font-size: 6em; + font-weight: 700; + color: $color1; +} + +.subtitle { + font-size: 40px; + font-weight: 700; + color: $color3; +} + +.buttons { + margin: 30px; + + a.button { + font-weight: 700; + border: 2px solid $color1; + text-decoration: none; + padding: 15px; + text-transform: uppercase; + color: $color1; + border-radius: 26px; + transition: all 0.2s ease-in-out; + + &:hover { + background-color: $color1; + color: white; + transition: all 0.2s ease-in-out; + } + } + + +} + diff --git a/fastpanel.php b/fastpanel.php deleted file mode 100644 index 8f428ccc..00000000 --- a/fastpanel.php +++ /dev/null @@ -1,53 +0,0 @@ -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($u->info['activ']>0) { - die(' .
    .'); - } - - if($u->info['repass'] > 0) { - die(); - } - - if(isset($_GET['items'])) { - $itm = mysql_fetch_array(mysql_query('SELECT * FROM `fastpanel` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1')); - if(!isset($itm['id'])) { - mysql_query('INSERT INTO `fastpanel` (`uid`) VALUES ("'.$u->info['id'].'")'); - } - // - $r = explode('|',$_GET['items']); - $i = 0; $v = ''; - while( $i <= 10 ) { - if(isset($r[$i])) { - $id = round((int)$r[$i]); - $id = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `id` = "'.mysql_real_escape_string($id).'" AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `inShop` = 0 LIMIT 1')); - if(isset($id['id'])) { - $v .= $id['id'].'|'; - }else{ - $v .= '0|'; - } - }else{ - $v .= '0|'; - } - $i++; - } - $v = rtrim($v,'|'); - mysql_query('UPDATE `fastpanel` SET `data` = "'.mysql_real_escape_string($v).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - -?> \ No newline at end of file diff --git a/fight/main.c b/fight/main.c index 44b78fa4..56e29b48 100644 --- a/fight/main.c +++ b/fight/main.c @@ -1,173 +1,173 @@ -class Zone { - int id; - int type; - vector pos; - float radius; -} - -enum ZoneType { - SAFE, - PSI, - RAD, - BIO -} - -ref array ga_zones = new array; - -ref ControllerZones ctrl_zones = new ControllerZones; - -class ControllerZones { - void ControllerZones() { - - int id = 0;// - vector pos; - float radius; - int type = 0; - // only RAD param ↓↓↓ - id = id + 1; // Територия янтаратя 200 метров RAD - pos = "2405 0 6541"; - radius = 200.0; - AddZone(id, pos, radius, ZoneType.RAD); - - // only PSI param ↓↓↓ - id = id + 1; // Територия янтаратя 200 метров PSI - pos = "2405 0 6541"; - radius = 200.0; - AddZone(id, pos, radius, ZoneType.PSI); - - GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(CheckZones, 5000, true); - } - - void ~ControllerZones() { - } - - void AddZone(int id, vector pos, float radius, int type) { - ref Zone zone = new ref Zone; - zone.id = id; - zone.pos = pos; - zone.radius = radius; - zone.type = type; - - ga_zones.Insert(zone); - } - - bool InZone(PlayerBase player, ref Zone zone) { - vector player_position = player.GetPosition(); - player_position[1] = 0; - - EntityAI attachment; - ItemBase item; - string className; - float biosafe = 0; - float psisafe = 0; - float damage_player; - float damage_zone = 0; - float damage_zonePSI = 8.0; - float rpu = 1.0; - - if( (vector.Distance(player_position, zone.pos)) < zone.radius && zone.type == ZoneType.RAD) { - - - - attachment = player.FindAttachmentBySlotName("Mask"); // Перечеь защиты от радиации - if ( attachment && attachment.IsItemBase() ) - { - item = Class.Cast(attachment); - className = item.GetType(); - if ( className.Contains("dzrp_GasMask_GP1") ) - { - biosafe = biosafe + 1.0; - } - } - attachment = player.FindAttachmentBySlotName("Body"); - if ( attachment && attachment.IsItemBase() ) - { - item = Class.Cast(attachment); - className = item.GetType(); - if ( className.Contains("Top_Admin") ) - { - biosafe = biosafe + 1.0; - } - } - - if (((ga_zones.Get(j).radius - (vector.Distance(player_position, ga_zones.Get(j).pos)) ) * rpu) > 1 ) - { - radiationcnt = ((ga_zones.Get(j).radius - (vector.Distance(player_position, ga_zones.Get(j).pos)) ) * rpu) + Math.RandomInt(1,10000)*0.00001; - if ( DayZRP_Static.IsItemInInventory( player, "DayZRP_Doz" ) ){ - Param1 m_MessageParamRD = new Param1( "Дозиметр : " + radiationcnt + "м3в" ); - GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParamRD, true, player.GetIdentity()); - } - } - if (biosafe<1) - { - damage_zone=((ga_zones.Get(j).radius - (vector.Distance(player_position, ga_zones.Get(j).pos)) ) * rpu)/50; - damage_player = player.GetHealth("GlobalHealth", "Health"); - player.SetHealth("GlobalHealth", "Health", damage_player - (damage_zone - (damage_zone * biosafe))); - if (biosafe==0) - { - player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_COUGH); //Кашель - Param1 m_MessageParam = new Param1("Воздействие Радиации! Одень противогаз!"); - GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); - } - } - - } - else if((vector.Distance(player_position, zone.pos)) < zone.radius && zone.type == ZoneType.PSI) { - - attachment = player.FindAttachmentBySlotName("Mask");// Перечеь защиты от PSI - if ( attachment && attachment.IsItemBase() ) { - item = Class.Cast(attachment); - className = item.GetType(); - if ( className.Contains("dzrp_GasMask_GP7") ) { - psisafe = psisafe + 1.0; - } - } - attachment = player.FindAttachmentBySlotName("Body"); - if ( attachment && attachment.IsItemBase() ) { - item = Class.Cast(attachment); - className = item.GetType(); - if ( className.Contains("Top_Admin") ) { - psisafe = psisafe + 1.0; - } - } - - damage_player = player.GetHealth("GlobalHealth", "Health"); - player.SetHealth("GlobalHealth", "Health", damage_player - (damage_zonePSI - (damage_zonePSI * psisafe))); - if (psisafe>=1) - { - return true; - } - if (psisafe==0) - { - if (psisafe<0.5) - { - player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT); // рвота // SNEEZE - чихать - } - Param1 m_MessageParamPSI = new Param1("Воздействие PSI! Нужно бежать!"); - GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParamPSI, true, player.GetIdentity()); - } - return true; - } - - - - return false; - } - - void CheckZones() { - ref array players = new array; - GetGame().GetPlayers( players ); - - for ( int i = 0; i < players.Count(); i++ ) - { - PlayerBase player; - Class.CastTo(player, players.Get(i)); - - for ( int j = 0; j < ga_zones.Count(); j++ ) { - if(InZone(player, ga_zones.Get(j))) { - break; - } - } - } - } +class Zone { + int id; + int type; + vector pos; + float radius; +} + +enum ZoneType { + SAFE, + PSI, + RAD, + BIO +} + +ref array ga_zones = new array; + +ref ControllerZones ctrl_zones = new ControllerZones; + +class ControllerZones { + void ControllerZones() { + + int id = 0;// + vector pos; + float radius; + int type = 0; + // only RAD param ↓↓↓ + id = id + 1; // Територия янтаратя 200 метров RAD + pos = "2405 0 6541"; + radius = 200.0; + AddZone(id, pos, radius, ZoneType.RAD); + + // only PSI param ↓↓↓ + id = id + 1; // Територия янтаратя 200 метров PSI + pos = "2405 0 6541"; + radius = 200.0; + AddZone(id, pos, radius, ZoneType.PSI); + + GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(CheckZones, 5000, true); + } + + void ~ControllerZones() { + } + + void AddZone(int id, vector pos, float radius, int type) { + ref Zone zone = new ref Zone; + zone.id = id; + zone.pos = pos; + zone.radius = radius; + zone.type = type; + + ga_zones.Insert(zone); + } + + bool InZone(PlayerBase player, ref Zone zone) { + vector player_position = player.GetPosition(); + player_position[1] = 0; + + EntityAI attachment; + ItemBase item; + string className; + float biosafe = 0; + float psisafe = 0; + float damage_player; + float damage_zone = 0; + float damage_zonePSI = 8.0; + float rpu = 1.0; + + if( (vector.Distance(player_position, zone.pos)) < zone.radius && zone.type == ZoneType.RAD) { + + + + attachment = player.FindAttachmentBySlotName("Mask"); // Перечеь защиты от радиации + if ( attachment && attachment.IsItemBase() ) + { + item = Class.Cast(attachment); + className = item.GetType(); + if ( className.Contains("dzrp_GasMask_GP1") ) + { + biosafe = biosafe + 1.0; + } + } + attachment = player.FindAttachmentBySlotName("Body"); + if ( attachment && attachment.IsItemBase() ) + { + item = Class.Cast(attachment); + className = item.GetType(); + if ( className.Contains("Top_Admin") ) + { + biosafe = biosafe + 1.0; + } + } + + if (((ga_zones.Get(j).radius - (vector.Distance(player_position, ga_zones.Get(j).pos)) ) * rpu) > 1 ) + { + radiationcnt = ((ga_zones.Get(j).radius - (vector.Distance(player_position, ga_zones.Get(j).pos)) ) * rpu) + Math.RandomInt(1,10000)*0.00001; + if ( DayZRP_Static.IsItemInInventory( player, "DayZRP_Doz" ) ){ + Param1 m_MessageParamRD = new Param1( "Дозиметр : " + radiationcnt + "м3в" ); + GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParamRD, true, player.GetIdentity()); + } + } + if (biosafe<1) + { + damage_zone=((ga_zones.Get(j).radius - (vector.Distance(player_position, ga_zones.Get(j).pos)) ) * rpu)/50; + damage_player = player.GetHealth("GlobalHealth", "Health"); + player.SetHealth("GlobalHealth", "Health", damage_player - (damage_zone - (damage_zone * biosafe))); + if (biosafe==0) + { + player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_COUGH); //Кашель + Param1 m_MessageParam = new Param1("Воздействие Радиации! Одень противогаз!"); + GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); + } + } + + } + else if((vector.Distance(player_position, zone.pos)) < zone.radius && zone.type == ZoneType.PSI) { + + attachment = player.FindAttachmentBySlotName("Mask");// Перечеь защиты от PSI + if ( attachment && attachment.IsItemBase() ) { + item = Class.Cast(attachment); + className = item.GetType(); + if ( className.Contains("dzrp_GasMask_GP7") ) { + psisafe = psisafe + 1.0; + } + } + attachment = player.FindAttachmentBySlotName("Body"); + if ( attachment && attachment.IsItemBase() ) { + item = Class.Cast(attachment); + className = item.GetType(); + if ( className.Contains("Top_Admin") ) { + psisafe = psisafe + 1.0; + } + } + + damage_player = player.GetHealth("GlobalHealth", "Health"); + player.SetHealth("GlobalHealth", "Health", damage_player - (damage_zonePSI - (damage_zonePSI * psisafe))); + if (psisafe>=1) + { + return true; + } + if (psisafe==0) + { + if (psisafe<0.5) + { + player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT); // рвота // SNEEZE - чихать + } + Param1 m_MessageParamPSI = new Param1("Воздействие PSI! Нужно бежать!"); + GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParamPSI, true, player.GetIdentity()); + } + return true; + } + + + + return false; + } + + void CheckZones() { + ref array players = new array; + GetGame().GetPlayers( players ); + + for ( int i = 0; i < players.Count(); i++ ) + { + PlayerBase player; + Class.CastTo(player, players.Get(i)); + + for ( int j = 0; j < ga_zones.Count(); j++ ) { + if(InZone(player, ga_zones.Get(j))) { + break; + } + } + } + } } \ No newline at end of file diff --git a/fight/take.team.php b/fight/take.team.php index 956dc2be..7f6ae44c 100644 --- a/fight/take.team.php +++ b/fight/take.team.php @@ -1,93 +1,94 @@ -info['id']) && $u->info['battle'] > 0 ) { - // - function json_fix_cyr($json_str) { - $cyr_chars = array ( - '\u0430' => '', '\u0410' => '', - '\u0431' => '', '\u0411' => '', - '\u0432' => '', '\u0412' => '', - '\u0433' => '', '\u0413' => '', - '\u0434' => '', '\u0414' => '', - '\u0435' => '', '\u0415' => '', - '\u0451' => '', '\u0401' => '', - '\u0436' => '', '\u0416' => '', - '\u0437' => '', '\u0417' => '', - '\u0438' => '', '\u0418' => '', - '\u0439' => '', '\u0419' => '', - '\u043a' => '', '\u041a' => '', - '\u043b' => '', '\u041b' => '', - '\u043c' => '', '\u041c' => '', - '\u043d' => '', '\u041d' => '', - '\u043e' => '', '\u041e' => '', - '\u043f' => '', '\u041f' => '', - '\u0440' => '', '\u0420' => '', - '\u0441' => '', '\u0421' => '', - '\u0442' => '', '\u0422' => '', - '\u0443' => '', '\u0423' => '', - '\u0444' => '', '\u0424' => '', - '\u0445' => '', '\u0425' => '', - '\u0446' => '', '\u0426' => '', - '\u0447' => '', '\u0427' => '', - '\u0448' => '', '\u0428' => '', - '\u0449' => '', '\u0429' => '', - '\u044a' => '', '\u042a' => '', - '\u044b' => '', '\u042b' => '', - '\u044c' => '', '\u042c' => '', - '\u044d' => '', '\u042d' => '', - '\u044e' => '', '\u042e' => '', - '\u044f' => '', '\u042f' => '', - - '\r' => '', - '\n' => '
    ', - '\t' => '' - ); - foreach ($cyr_chars as $cyr_char_key => $cyr_char) { - $json_str = str_replace($cyr_char_key, $cyr_char, $json_str); - } - return $json_str; - } - // - $r = array(); - $p = array(); - $p['sp'] = mysql_query('SELECT +if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { + if (isset($u->info['id']) && $u->info['battle'] > 0) { + // + function json_fix_cyr($json_str) + { + $cyr_chars = [ + '\u0430' => '', '\u0410' => '', + '\u0431' => '', '\u0411' => '', + '\u0432' => '', '\u0412' => '', + '\u0433' => '', '\u0413' => '', + '\u0434' => '', '\u0414' => '', + '\u0435' => '', '\u0415' => '', + '\u0451' => '', '\u0401' => '', + '\u0436' => '', '\u0416' => '', + '\u0437' => '', '\u0417' => '', + '\u0438' => '', '\u0418' => '', + '\u0439' => '', '\u0419' => '', + '\u043a' => '', '\u041a' => '', + '\u043b' => '', '\u041b' => '', + '\u043c' => '', '\u041c' => '', + '\u043d' => '', '\u041d' => '', + '\u043e' => '', '\u041e' => '', + '\u043f' => '', '\u041f' => '', + '\u0440' => '', '\u0420' => '', + '\u0441' => '', '\u0421' => '', + '\u0442' => '', '\u0422' => '', + '\u0443' => '', '\u0423' => '', + '\u0444' => '', '\u0424' => '', + '\u0445' => '', '\u0425' => '', + '\u0446' => '', '\u0426' => '', + '\u0447' => '', '\u0427' => '', + '\u0448' => '', '\u0428' => '', + '\u0449' => '', '\u0429' => '', + '\u044a' => '', '\u042a' => '', + '\u044b' => '', '\u042b' => '', + '\u044c' => '', '\u042c' => '', + '\u044d' => '', '\u042d' => '', + '\u044e' => '', '\u042e' => '', + '\u044f' => '', '\u042f' => '', + + '\r' => '', + '\n' => '
    ', + '\t' => '', + ]; + foreach ($cyr_chars as $cyr_char_key => $cyr_char) { + $json_str = str_replace($cyr_char_key, $cyr_char, $json_str); + } + return $json_str; + } + + // + $r = []; + $p = []; + $p['sp'] = mysql_query( + 'SELECT `u`.`id`,`u`.`login`,`u`.`login2`,`u`.`align`,`u`.`level`, `s`.`hpNow`,`s`.`mpNow`,`s`.`team` - FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`battle` = "'.$u->info['battle'].'" - '); - while( $p['pl'] = mysql_fetch_array($p['sp']) ) { - $p['st'] = $u->getStats($p['pl']['id']); - $r[] = array( - 'id' => $p['pl']['id'], - 'login' => $p['pl']['login'], - 'team' => $p['pl']['team'], - 'hpNow' => $p['pl']['hpNow'], - 'mpNow' => $p['pl']['mpNow'], - 'hpAll' => $p['st']['hpAll'], - 'mpAll' => $p['st']['mpAll'], - 'align' => $p['pl']['align'], - 'clan' => $p['pl']['clan'], - 'level' => $p['pl']['level'] - ); - } - unset($p); - // - echo json_fix_cyr(json_encode($r)); - //echo json_encode($r); - }else{ - echo 'false'; - } + FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`battle` = "' . $u->info['battle'] . '" + ' + ); + while ($p['pl'] = mysql_fetch_array($p['sp'])) { + $p['st'] = $u->getStats($p['pl']['id']); + $r[] = [ + 'id' => $p['pl']['id'], + 'login' => $p['pl']['login'], + 'team' => $p['pl']['team'], + 'hpNow' => $p['pl']['hpNow'], + 'mpNow' => $p['pl']['mpNow'], + 'hpAll' => $p['st']['hpAll'], + 'mpAll' => $p['st']['mpAll'], + 'align' => $p['pl']['align'], + 'clan' => $p['pl']['clan'], + 'level' => $p['pl']['level'], + ]; + } + unset($p); + echo json_fix_cyr(json_encode($r)); + } else { + echo 'false'; + } } -?> \ No newline at end of file diff --git a/fight/take.user.php b/fight/take.user.php index 50245c59..ef9a0964 100644 --- a/fight/take.user.php +++ b/fight/take.user.php @@ -7,7 +7,7 @@ header( 'Pragma: no-cache' ); header( 'Content-Type: text/html; charset=windows-1251' ); define('GAME',true); -include('../_incl_data/class/__db_connect.php'); +require_once('../_incl_data/class/__db_connect.php'); mysql_query('SET NAMES utf8'); if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { diff --git a/forum_script/_forum.class.php b/forum_script/_forum.class.php index 953db596..7d98b339 100644 --- a/forum_script/_forum.class.php +++ b/forum_script/_forum.class.php @@ -1,813 +1,725 @@ ' ',1=>' ',2=>' ',3=>' ',4=>' '); + public $mod = 0, $see = [], $lst = [], $gd = [], $menu = '', $pages = '', $r, $user = false, $fm = false, $error, $acs = [0 => ' ', 1 => ' ', 2 => ' ', 3 => ' ', 4 => ' ']; - - public function paginator($t,$pagers=0){ - if(isset($_GET['search'])) { - $where = '( `text` LIKE "%'.mysql_real_escape_string($_GET['search']).'%" OR `title` LIKE "%'.mysql_real_escape_string($_GET['search']).'%" OR `login` LIKE "%'.mysql_real_escape_string($_GET['search']).'%" ) AND `topic` < "0" AND `delete` = "0"' ; - $pre_url='search='.htmlspecialchars($_GET['search'],NULL,'cp1251').'&read='.$pagers.'&'; - $idpaginator=$pagers; - }elseif($pagers!=0){ - $where = '`topic` = "'.$pagers.'" AND `delete` = "0"' ; - $pre_url='read='.$pagers.'&'; - $idpaginator=$pagers; - }elseif($t==1){ - $where = '`topic` < "0" AND `fid` = "'.$this->r.'" AND `delete` = "0"'; - $pre_url='r='.$this->r.'&'; - $idpaginator=$this->r; - }elseif($t==2){ - $where = '`topic` = "'.$this->see['id'].'" AND `delete` = "0"' ; - $pre_url='read='.$this->see['id'].'&'; - $idpaginator=$this->see['id']; - } - $q="SELECT count(*) FROM forum_msg WHERE ".$where; - $res=mysql_query($q); - $row=mysql_fetch_row($res); - $total_rows=$row[0]; - $num_pages=ceil($total_rows/20); - $plist=''; - for($i=1;$i<=$num_pages;$i++) { - if( (!isset($_GET['page']) || round((int)$_GET['page']) < 1) && $i == 1 && ($t!=2 || isset($_GET['read']))) { - $plist.=''.$i.""; - }elseif( ( $_GET['page']!=$i || $pagers!=0 ) ){ - $plist.='
    '.$i.""; - }else{ - $plist.=''.$i.''; - } + + public function paginator($t, $pagers = 0) + { + if (isset($_GET['search'])) { + $where = '( `text` LIKE "%' . mysql_real_escape_string($_GET['search']) . '%" OR `title` LIKE "%' . mysql_real_escape_string($_GET['search']) . '%" OR `login` LIKE "%' . mysql_real_escape_string($_GET['search']) . '%" ) AND `topic` < "0" AND `delete` = "0"'; + $pre_url = 'search=' . htmlspecialchars($_GET['search'], null, 'cp1251') . '&read=' . $pagers . '&'; + $idpaginator = $pagers; + } elseif ($pagers != 0) { + $where = '`topic` = "' . $pagers . '" AND `delete` = "0"'; + $pre_url = 'read=' . $pagers . '&'; + $idpaginator = $pagers; + } elseif ($t == 1) { + $where = '`topic` < "0" AND `fid` = "' . $this->r . '" AND `delete` = "0"'; + $pre_url = 'r=' . $this->r . '&'; + $idpaginator = $this->r; + } elseif ($t == 2) { + $where = '`topic` = "' . $this->see['id'] . '" AND `delete` = "0"'; + $pre_url = 'read=' . $this->see['id'] . '&'; + $idpaginator = $this->see['id']; + } + $q = "SELECT count(*) FROM forum_msg WHERE " . $where; + $res = mysql_query($q); + $row = mysql_fetch_row($res); + $total_rows = $row[0]; + $num_pages = ceil($total_rows / 20); + $plist = ''; + for ($i = 1; $i <= $num_pages; $i++) { + if ((!isset($_GET['page']) || round((int)$_GET['page']) < 1) && $i == 1 && ($t != 2 || isset($_GET['read']))) { + $plist .= '' . $i . ""; + } elseif (($_GET['page'] != $i || $pagers != 0)) { + $plist .= '' . $i . ""; + } else { + $plist .= '' . $i . ''; } - if($plist == '') { - $plist = '1'; - } - return ''.$plist.''; - } - - public function testAnswer($text) { - - $r = str_replace('[/?]','[?]',$text); - $r = explode('[?]',$r); - $i = 1; - $pr_us_all = 0; - while($i != -1) { - if(isset($r[$i])) { - $ra = explode('[:]',$r[$i]); - $j = 0; - if(isset($this->user['id'])) { - $yg = mysql_fetch_array(mysql_query('SELECT * FROM `forum_answers` WHERE `msg_id` = "'.$this->see['id'].'" AND `q_id` = "'.$i.'" AND `uid` = "'.$this->user['id'].'" AND `delete` = "0" LIMIT 1')); - if(!isset($yg['id'],$_GET['q_now'],$_GET['answer_now']) && $_GET['q_now'] == $i) { - $_GET['answer_now'] = round((int)$_GET['answer_now']); - $_GET['q_now'] = round((int)$_GET['q_now']); - if(isset($ra[$_GET['answer_now']])) { - mysql_query('INSERT INTO `forum_answers` (`uid`,`msg_id`,`q_id`,`answer`,`time`,`city`) VALUES - ("'.$this->user['id'].'","'.$this->see['id'].'","'.mysql_real_escape_string($_GET['q_now']).'","'.mysql_real_escape_string($_GET['answer_now']).'", - "'.time().'","'.$this->user['city'].'")'); - die(''); - } - } - } - $pr_all = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `forum_answers` WHERE `msg_id` = "'.$this->see['id'].'" AND `q_id` = "'.$i.'" AND `delete` = "0" LIMIT 1')); - $pr_all = $pr_all[0]; - $pr_us_all += $pr_all; - $pr_lst = 0; - $pr_asw = 0; - while($j != -1) { - if(isset($ra[$j]) && $ra[$j] != '') { - if($j > 0) { - - $prc = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `forum_answers` WHERE `msg_id` = "'.$this->see['id'].'" AND `answer` = "'.$j.'" AND `q_id` = "'.$i.'" AND `delete` = "0" LIMIT 1')); - $prc = 0+$prc[0]; - $pr_asw += $prc; - if( $pr_asw == $pr_all ) { - $prc = 100-$pr_lst; - $pr_lst += $prc; - if($prc > 0) { - $prc = ''.$prc.''; - } - }else{ - $prc = floor($prc/$pr_all*100); - if($prc > 0) { - $pr_lst += $prc; - $prc = ''.$prc.''; - } - } - if(isset($this->user['id'])) { - if(isset($yg['id'])) { - if($yg['answer'] == $j) { - $zm = '• '.$ra[$j].'     -   '.$prc.'%   ( )'; - }else{ - $zm = '• '.$ra[$j].'     -   '.$prc.'%'; - } - }else{ - $zm = '• '.$ra[$j].'     -   '.$prc.'%'; - } - }else{ - $zm = '• '.$ra[$j].'     -   '.$prc.'%'; - } - - $text = str_replace('[:]'.$ra[$j],$zm,$text); - }else{ - $zm = '

    '.$ra[$j].'

    '; - $text = str_replace(str_replace('
    ','',$ra[$j]),$zm,$text); - } - }else{ - $j = -2; - } - $j++; - } - $text = str_replace('[?]','',$text); - }else{ - $i = -2; - } - $i++; - } - $text = str_replace('[/?]','


    '.$pr_us_all.'
    ',$text); - return $text; - } - - public function startForum() - { - // - $ufr = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "'.mysql_real_escape_string($_COOKIE['login']).'" AND `pass` = "'.mysql_real_escape_string($_COOKIE['pass']).'" AND `banned` = "0" LIMIT 1')); - if(!isset($ufr['id']) || $ufr['banned']>0) - { - unset($u); - }else{ - $ufr['sl'] = ''.$ufr['login'].' ['.$ufr['level'].']'; - $this->user = $ufr; - } - - // - if(isset($_GET['read'])) - { - // - $see = mysql_fetch_array(mysql_query('SELECT * FROM `forum_msg` WHERE `id` = "'.mysql_real_escape_string($_GET['read']).'" AND `delete` = "0" LIMIT 1')); - if(!isset($see['id']) || ($see['fid']==65 && $this->user['admin']==0 && ($this->user['align']<=1 || $this->user['align']>=2)) || ($see['fid']==75 && $this->user['admin']==0 && ($this->user['align']<=3 || $this->user['align']>=4))) - { - $this->r = -2; - $this->error = ' .'; - }else{ - $this->r = -1; - $see['goodAdd'] = 1; - if($see['nocom']>0) - { - if($this->user['align']>1 && $this->user['align']<2) - { - if($see['nocom']==2 || $see['nocom']==4) - { - $see['goodAdd'] = 0; - } - } - if($this->user['align']>3 && $this->user['align']<4) - { - if($see['nocom']==2 || $see['nocom']==3) - { - $see['goodAdd'] = 0; - } - } - if($this->user['admin']>0) - { - $see['goodAdd'] = 1; - } - } - $this->see = $see; - $this->fm = mysql_fetch_array(mysql_query('SELECT * FROM `forum_menu` WHERE `id` = "'.mysql_real_escape_string($see['fid']).'" LIMIT 1')); - } - }else{ - if(isset($_GET['r'])) - { - $this->r = (int)$_GET['r']; - }else{ - $this->r = 1; - } - - $fm = mysql_fetch_array(mysql_query('SELECT * FROM `forum_menu` WHERE `id` = "'.mysql_real_escape_string($this->r).'" LIMIT 1')); - if(!isset($fm['id']) || ($fm['id']==65 && $this->user['admin']==0 && ($this->user['align']<=1 || $this->user['align']>=2)) || ($fm['id']==75 && $this->user['admin']==0 && ($this->user['align']<=3 || $this->user['align']>=4)) ) - { - $this->r = -2; - $this->fm = false; - $this->error = ' .'; - }else{ - $this->fm = $fm; - } - } - - $this->genMenu(); - - $this->lst = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `forum_msg` WHERE `uid` = "'.$this->user['id'].'" AND `delete` = "0" ORDER BY `time` DESC LIMIT 1')); - - // - if($this->gd[$this->fm['id']]==0 && $ufr['admin']==0) - { - // - $this->r = -2; - $this->error = ' .'; - }elseif($this->fm['only_admin']==1 && $this->user['admin']==0) - { - // - $this->r = -2; - $this->error = ' .'; - } - } - - public function seeTopic() - { - global $c; - $fd_limit=20; - if(isset($_GET['page'])){ - $start=$_GET['page']*$fd_limit-$fd_limit; - }else{ - $start=0; - //echo 'SELECT * FROM `forum_msg` WHERE `topic` < "0" AND `fid` = "'.$this->r.'" AND `delete` = "0" ORDER BY `id` DESC LIMIT '.$start.','.$fd_limit; - } - if($this->see['fid']==65 && $this->user['admin']==0 && ($this->user['align']<=1 || $this->user['align']>=2)){ - - }elseif($this->see['fid']==75 && $this->user['admin']==0 && ($this->user['align']<=3 || $this->user['align']>=4)){ - - }elseif(isset($this->see['id'])) - { - // - echo $this->genuser($this->see['uid'],$this->see['login'],$this->see['level'],$this->see['align'],$this->see['clan'],$this->see['invis'],$this->see['city'],$this->see['cityreg']); - if($this->user['admin']>0 || ($this->user['align'] > 1 && $this->user['align'] < 2) || ($this->user['align'] > 3 && $this->user['align'] < 4)) - { - echo ' 
    '; - if($this->user['admin']>0) { - echo ''; - } - echo ''; - echo ''; - echo '
    '; - } - echo '     ('.date('d.m.Y H:i',$this->see['time']).')
    '; - $this->see['text'] = str_replace("\n", "
    ", $this->see['text']); - $this->see['text'] = $this->testAnswer($this->see['text']); - $this->see['text'] = $this->parse_bb_code($this->see['text']); - /* - if($this->see['id'] ==1608) { - $uslist = ''; $xu1 = 0; - $su1 = mysql_query('SELECT `i`.`uid`,`u`.`login`,`u`.`level`,`u`.`online`,`u`.`clan`,`u`.`align` FROM `items_users` AS `i` LEFT JOIN `users` AS `u` ON `i`.`uid` = `u`.`id` WHERE `i`.`item_id` = "2852" LIMIT 25'); - $usrs = array(); - while($pu1 = mysql_fetch_array($su1)) { - if(!isset($usrs[$pu1['uid']])) { - $xu1++; - $usrs[$pu1['uid']] = $xu1; - $uslist .= $xu1.'. '.$pu1['login'].'['.$pu1['level'].']'; - if($pu1['online']>time()-520) { - $uslist .= ' online'; - } - $uslist .= '
    '; - } - } - $this->see['text'] = str_replace("{users-list}", ' ['.$xu1.'/25]:
    '.$uslist.'
    ', $this->see['text']); - unset($uslist,$pu1,$su1,$xu1,$usrs); - }*/ - - $rtrn = ''; - $rtrn .= 'see['fixed'] > 0) { - $rtrn .= ' class="fixed_topik"'; - } - - $rtrn .= ' style="margin-left:31px;">'; - - if($this->see['clear']==0){ - $rtrn .= $this->see['text']; - }else{ - if($this->user['admin'] > 0) { - $rtrn .= '
    '.$this->see['text'].'
    '; - } - $rtrn .= '
    '; - if($this->user['del_admin'] == 0) { - $rtrn .= ', '.$this->see['del_login'].''; - } - $rtrn .= '
    '; - } - - // - $sp1 = mysql_query('SELECT * FROM `forum_msg_mod` WHERE `msg_id` = "'.$this->see['id'].'"'); - while($pl1 = mysql_fetch_array($sp1)) { - $rtrn .= '
    '; - if($pl1['from_admin'] == 1) { - $pl1['login'] = '<>'; - $pl1['city'] = ''; - $pl1['cityreg'] = ''; - $pl1['clan'] = ''; - $pl1['level'] = '??'; - $pl1['uid'] = 0; - } - $rtrn .= $this->genuser($pl1['uid'],$pl1['login'],$pl1['level'],$pl1['align'],$pl1['clan'],$pl1['invis'],$pl1['city'],$pl1['cityreg']); - $rtrn .= ' ('.date('d.m.y H:i',$pl1['time']).'): '; - $pl1['text'] = str_replace("\n", "
    ", $pl1['text']); - $rtrn .= $this->link_it($pl1['text']).'
    '; - } - - $rtrn .= '
    '; - // - $sp = mysql_query('SELECT * FROM `forum_msg` WHERE `topic` = "'.$this->see['id'].'" AND `delete` = "0" ORDER BY `time` ASC LIMIT '.$start.','.$fd_limit ); - while($pl = mysql_fetch_array($sp)) - { - - $rtrn .= $this->genuser($pl['uid'],$pl['login'],$pl['level'],$pl['align'],$pl['clan'],$pl['invis'],$pl['city'],$pl['cityreg']); - if($this->user['admin']>0 || ($this->user['align'] > 1 && $this->user['align'] < 2) || ($this->user['align'] > 3 && $this->user['align'] < 4)) - { - $rtrn .= ' 
    '; - if($this->user['admin']>0) { - $rtrn .= ''; - } - $rtrn .= ''; - $rtrn .= ''; - $rtrn .= '
    '; - } - $rtrn .= '     ('.date('d.m.Y H:i',$pl['time']).')
    '; - $pl['text'] = $this->parse_bb_code($pl['text']); - $pl['text'] = str_replace("\n", "
    ", $pl['text']); - if($pl['clear']==0){ - $rtrn .= '
    '.$pl['text'].'
    '; - }else{ - if($this->user['admin'] > 0) { - $rtrn .= '
    '.$pl['text'].'
    '; - } - $rtrn .= '
    '; - if($this->user['del_admin'] == 0) { - $rtrn .= ', '.$pl['del_login'].''; - } - $rtrn .= '
    '; - } - - // - $sp1 = mysql_query('SELECT * FROM `forum_msg_mod` WHERE `msg_id` = "'.$pl['id'].'"'); - while($pl1 = mysql_fetch_array($sp1)) { - $rtrn .= '
    '; - if($pl1['from_admin'] == 1) { - $pl1['login'] = '<>'; - $pl1['city'] = ''; - $pl1['cityreg'] = ''; - $pl1['clan'] = ''; - $pl1['level'] = '??'; - $pl1['uid'] = 0; - } - $rtrn .= $this->genuser($pl1['uid'],$pl1['login'],$pl1['level'],$pl1['align'],$pl1['clan'],$pl1['invis'],$pl1['city'],$pl1['cityreg']); - $rtrn .= ' ('.date('d.m.y H:i',$pl1['time']).'): '; - $pl1['text'] = str_replace("\n", "
    ", $pl1['text']); - $rtrn .= $this->link_it($pl1['text']).'
    '; - } - - $rtrn .= '
    '; - } - echo $rtrn; - - } - } - - public function link_it($text) { - $text= preg_replace("/(^|[\n ])([\w]*?)((ht|f)tp(s)?:\/\/[\w]+[^ \,\"\n\r\t<]*)/is", "$1$2$3", $text); - $text= preg_replace("/(^|[\n ])([\w]*?)((www|ftp)\.[^ \,\"\t\n\r<]*)/is", "$1$2$3", $text); - $text= preg_replace("/(^|[\n ])([a-z0-9&\-_\.]+?)@([\w\-]+\.([\w\-\.]+)+)/i", "$1$2@$3", $text); - return($text); - } + } + if ($plist == '') { + $plist = '1'; + } + return '' . $plist . ''; + } - - public function genuser($id,$login,$level,$align,$clan,$invis,$city,$cityreg) - { - global $c,$code; - $ufr = ''; - if($align>0) - { - $u .= ''; - } - if($clan>0) - { - $clan = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.((int)$clan).'" LIMIT 1')); - if(isset($clan['id'])) - { - $u .= ''; - } - } - - if($login == '<>') - { - $login = ''; - } - - $u .= ''.$login.' ['.$level.']'; - - if($city!='') - { - $ufr = '   '.$u; - } - return $u; - } - - public function pravasee() - { - $prava = 1; // - if($this->see['fid']==65 && $this->user['admin']==0 && ($this->user['align']<=1 || $this->user['align']>=2)) - { - // - $prava = 0; - }elseif($this->see['fid']==75 && $this->user['admin']==0 && ($this->user['align']<=3 || $this->user['align']>=4)) - { - // - $prava = 0; - }elseif(isset($this->see['id']) && $this->see['nocom']==3 && $this->user['admin']==0 && ($this->user['align']<=3 || $this->user['align']>=4)) - { - $prava = 0; - }elseif(isset($this->see['id']) && $this->see['nocom']==2 && $this->user['admin']==0 && ($this->user['align']<=1 || $this->user['align']>=2)) - { - $prava = 0; - }elseif(isset($this->see['id']) && $this->see['nocom']==1 && $this->user['admin']==0) - { - $prava = 0; - }elseif($this->user['level']<1) - { - $prava = 0; - }elseif($this->lst['time']>time()-60) - { - $prava = 0; - } - return $prava; - } - - public function admintopmsg($read,$id,$text,$color,$adm) { - - $msg = mysql_fetch_array(mysql_query('SELECT `id` FROM `forum_msg` WHERE `id` = "'.mysql_real_escape_string($id).'" LIMIT 1')); - if(!isset($msg['id'])) { - $this->error = ' '; - }elseif(trim($text,' ')=='' || iconv_strlen(trim($text,' '))<2) - { - $this->error = ' 2- '; - }elseif($this->user['molch2']>time()) - { - $this->error = ' , '; - }elseif(isset($this->see['id']) && $this->see['nocom']==3 && $this->user['admin']==0 && ($this->user['align']<=3 || $this->user['align']>=4)) - { - $this->error = ' '; - }elseif(isset($this->see['id']) && $this->see['nocom']==2 && $this->user['admin']==0 && ($this->user['align']<=1 || $this->user['align']>=2)) - { - $this->error = ' '; - }elseif(isset($this->see['id']) && $this->see['nocom']==1 && $this->user['admin']==0) - { - $this->error = ' '; - }elseif($this->user['level'] < 8) - { - $this->error = ' , 8- '; - }else{ - mysql_query('INSERT INTO `forum_msg_mod` (`uid`,`login`,`align`,`level`,`admin`,`clan`,`time`,`text`,`msg_id`,`delete`,`color`,`city`,`cityreg`,`from_admin`) VALUES - ("'.$this->user['id'].'","'.$this->user['login'].'","'.$this->user['align'].'","'.$this->user['level'].'","'.$this->user['admin'].'","'.$this->user['clan'].'", - "'.time().'","'.mysql_real_escape_string($text).'","'.mysql_real_escape_string($msg['id']).'","0","red","'.$this->user['city'].'","'.$this->user['cityreg'].'", - "'.mysql_real_escape_string(round((int)$adm)).'") '); - if(!isset($this->see['id'])) { - header('location: ?r='.round((int)$_GET['r']).'&page='.round((int)$_GET['page'])); - }else{ - header('location: ?read='.$this->see['id'].'&page='.round((int)$_GET['page'])); - } - } - - } - - public function parse_bb_code($text) { - $text = preg_replace('/\[(\/?)(b|i|u|s)\s*\]/', "<$1$2>", $text); - - $text = preg_replace('/\[code\]/', '
    ', $text);
    -		$text = preg_replace('/\[\/code\]/', '
    ', $text); - - $text = preg_replace('/\[(\/?)quote\]/', "<$1blockquote>", $text); - $text = preg_replace('/\[(\/?)quote(\s*=\s*([\'"]?)([^\'"]+)\3\s*)?\]/', "<$1blockquote> $4:
    ", $text); - - //$text = preg_replace('/\[url\](?:https:\/\/)?([a-z0-9-.]+\.\w{2,4})\[\/url\]/', "$1", $text); - $text = preg_replace('/\[url=(.+?)\](.+?)\[\/url\]/', "$2", $text); - $text = preg_replace('/\[url\s?=\s?([\'"]?)(?:https:\/\/)?([a-z0-9-.]+\.\w{2,4})\1\](.*?)\[\/url\]/', "$3", $text); - - - $text = preg_replace('/\[img\s*\]([^\]\[]+)\[\/img\]/', "", $text); - $text = preg_replace('/\[img\s*=\s*([\'"]?)([^\'"\]]+)\1\]/', "", $text); - - $text = $this->close_dangling_tags($text); - - return $text; - } - - // $s - , - // $tags - | (b|u|i) - public function close_dangling_tags($html){ - #put all opened tags into an array - preg_match_all("#<([a-z]+)( .*)?(?!/)>#iU",$html,$result); - $openedtags=$result[1]; - - #put all closed tags into an array - preg_match_all("##iU",$html,$result); - $closedtags=$result[1]; - $len_opened = count($openedtags); - # all tags are closed - if(count($closedtags) == $len_opened){ - return $html; - } - - $openedtags = array_reverse($openedtags); - # close tags - for($i=0;$i < $len_opened;$i++) { - if (!in_array($openedtags[$i],$closedtags)){ - if( $openedtags[$i] != 'br' ) { - $html .= ''; - } - } else { - unset($closedtags[array_search($openedtags[$i],$closedtags)]); - } - } - return $html; - } - - public function addnewtop($title,$text,$ico,$time,$login,$uid,$fid,$topic) - { - if(trim($text,' ')=='' || iconv_strlen(trim($text,' '))<5) - { - $this->error = ' 5- '; - }elseif($this->user['molch2']>time()) - { - $this->error = ' , '; - }elseif((trim($title,' ')=='' || iconv_strlen(trim($title,' '))<5) && $topic == -1) - { - $this->error = ' 5- '; - }elseif(isset($this->see['id']) && $this->see['nocom']==3 && $this->user['admin']==0 && ($this->user['align']<=3 || $this->user['align']>=4)) - { - $this->error = ' '; - }elseif(isset($this->see['id']) && $this->see['nocom']==2 && $this->user['admin']==0 && ($this->user['align']<=1 || $this->user['align']>=2)) - { - $this->error = ' '; - }elseif(isset($this->see['id']) && $this->see['nocom']==1 && $this->user['admin']==0) - { - $this->error = ' '; - }elseif($this->user['level'] < 2) - { - $this->error = ' 2- '; - }elseif($this->gd[$fid]>0 && $this->lst['time']14) - { - $ico = 13; - } - $tl = array(); - if(isset($_POST['adminname']) && $this->user['admin']>0) - { - $tl['login'] = '<>'; - $tl['level'] = '??'; - $tl['align'] = '0'; - $tl['clan'] = '0'; - $tl['cityreg'] = 'newvillage'; - $tl['city'] = 'questcity'; - $tl['id'] = '0'; - }else{ - $tl['login'] = $this->user['login']; - $tl['level'] = $this->user['level']; - $tl['align'] = $this->user['align']; - $tl['clan'] = $this->user['clan']; - $tl['cityreg'] = $this->user['cityreg']; - $tl['city'] = $this->user['city']; - $tl['id'] = $uid; - } - $lst = mysql_fetch_array(mysql_query('SELECT * FROM `forum_msg` WHERE `topic` = "'.mysql_real_escape_string($topic).'" OR (`topic` = "-1" AND `id` = "'.mysql_real_escape_string($topic).'") ORDER BY `time` DESC LIMIT 1')); - $ins = mysql_query('INSERT INTO `forum_msg` (`cityreg`,`city`,`align`,`clan`,`level`,`login`,`fid`,`title`,`topic`,`ico`,`text`,`time`,`ip`,`uid`) VALUES ("'.mysql_real_escape_string($tl['cityreg']).'","'.mysql_real_escape_string($tl['city']).'","'.mysql_real_escape_string($tl['align']).'","'.mysql_real_escape_string($tl['clan']).'","'.mysql_real_escape_string($tl['level']).'","'.mysql_real_escape_string($tl['login']).'","'.mysql_real_escape_string($fid).'","'.mysql_real_escape_string(htmlspecialchars($title, NULL , 'cp1251')).'","'.mysql_real_escape_string($topic).'","'.mysql_real_escape_string($ico).'","'.mysql_real_escape_string(htmlspecialchars($text, NULL , 'cp1251')).'","'.mysql_real_escape_string($time).'","'.$_SERVER['HTTP_X_REAL_IP'].'","'.$tl['id'].'")'); - if(!$ins) - { - $this->error = ' '; - return false; - }else{ - if($topic != -1) { - // - - if($lst['uid']+1!=$this->user['id']) { - $fnt = ''.date('d.m.Y H:i').' , . '; - $ins = ''; $ll = array(); - $sp = mysql_query('SELECT `u`.`city`,`u`.`id`,`u`.`login`,`f`.`uid`,`f`.`login` FROM `forum_msg` AS `f` LEFT JOIN `users` AS `u` ON `f`.`uid` = `u`.`id` WHERE `f`.`delete` = "0" AND (`f`.`topic` = "'.mysql_real_escape_string($topic).'" OR (`f`.`topic` = "-1" AND `f`.`id` = "'.mysql_real_escape_string($topic).'")) LIMIT 1'); - while($pl = mysql_fetch_array($sp)) { - if(!isset($ll[$pl['uid']]) && $pl['uid']!=$this->user['id']) { - $ins .= '("'.$pl['city'].'","1","'.$pl['login'].'","6","-1","'.$fnt.'"),'; - $ll[$pl['uid']] = true; - } - } - unset($ll); - $ins = trim($ins,','); - if($ins!='') { - mysql_query('INSERT INTO `chat` (`city`,`new`,`to`,`type`,`time`,`text`) VALUES '.$ins.''); - } - } - } - $fid = mysql_insert_id(); - $this->lst['time'] = time(); - if(isset($this->see['id'])) { - header('location: ?read='.$this->see['id'].'&page='.round((int)$_GET['page'])); - }else{ - header('location: ?r='.round((int)$_GET['r']).'&page='.round((int)$_GET['page'])); - } - return $fid; - } - }elseif($this->lst['time']>time()-60) - { - $this->error = ' '; - }else{ - $this->error = ' '; - } - } - - public function forumData() - { - $fd_limit = 20; - if(isset($_GET['page'])){ - $start=$_GET['page']*$fd_limit-$fd_limit; - }else{ - $start=0; - //echo 'SELECT * FROM `forum_msg` WHERE `topic` < "0" AND `fid` = "'.$this->r.'" AND `delete` = "0" ORDER BY `id` DESC LIMIT '.$start.','.$fd_limit; - } - global $code,$c,$filter; - // - $re = ''; - if(isset($_GET['search'])) { - $sp = mysql_query('SELECT * FROM `forum_msg` WHERE ( `text` LIKE "%'.mysql_real_escape_string($_GET['search']).'%" OR `title` LIKE "%'.mysql_real_escape_string($_GET['search']).'%" OR `login` LIKE "%'.mysql_real_escape_string($_GET['search']).'%" ) AND `topic` < "0" AND `delete` = "0" ORDER BY `id` DESC LIMIT '.$start.','.$fd_limit ); - }else{ - $sp = mysql_query('SELECT * FROM `forum_msg` WHERE `topic` < "0" AND `fid` = "'.$this->r.'" AND `delete` = "0" ORDER BY `fixed` DESC,`id` DESC LIMIT '.$start.','.$fd_limit ); - } - while($pl = mysql_fetch_array($sp)) - { - $lstDT = $pl['time']; - $row = mysql_num_rows(mysql_query('SELECT `id` FROM `forum_msg` WHERE `topic` = "'.$pl['id'].'" AND `delete` = "0"')); - $plist=''.$this->paginator(2,$pl['id']).''; - if($plist!=''){ - $plist=' '.$plist.'';} - - $re .= ' 0) { - $fxd = ' '; - $re .= ' class="fixed_topik"'; - } - $re .= ' style="margin-top:10px;">'; - $re .= '
    '.$fxd.' '.$pl['title'].' '.$plist.'   '.$this->genuser($pl['uid'],$pl['login'],$pl['level'],$pl['align'],$pl['clan'],$pl['invis'],$pl['city'],$pl['cityreg']).'
    '; - $re .= '
    '.date('d.m.Y H:i',$pl['time']).' » '; - if($pl['fid'] == 24) { - $re .= $filter->str_count(str_replace('[?]',': ',str_replace('[/?]','',str_replace('[:]',', ',$pl['text']))),250); - }else{ - $re .= $filter->str_count(str_replace('[?]',': ',str_replace('[/?]','',str_replace('[:]',', ',$pl['text']))),250); - } - $re .= '
    '; - $re .= '
    : '.$row.' ... '; - - $pku = mysql_query('SELECT `login`,`invis`,`time` FROM `forum_msg` WHERE `topic` = "'.$pl['id'].'" AND `delete` = 0 ORDER BY `id` DESC LIMIT 10'); - $pkusr = ''; - while($plku = mysql_fetch_array($pku)) { - $pkusr = $plku['login'].', '.$pkusr; - $lstDT = $plku['time']; - } - $pkusr = rtrim($pkusr,', '); - $re .= $pkusr; - unset($pkusr); - - $re .= '     ('.date('d.m.Y H:i',$lstDT).')
    '; - $re .= '
    '; - $re .="\n"; - } - echo $re; - } - - public function history($id,$uid,$act,$text) - { - if($type==1) - { - - } - } - - public function actionSee($id) - { - if($id==1) - { - // \ - $up = mysql_query('UPDATE `forum_msg` SET `delete` = "'.time().'",`del_login`="'.$this->user['login'].'" WHERE `id` = "'.$this->see['id'].'" LIMIT 1'); - $this->see['delete'] = time(); - }elseif($id==2) - { - // - mysql_query('UPDATE `forum_msg` SET `nocom` = "1" WHERE `id` = "'.$this->see['id'].'" LIMIT 1'); - $this->see['nocom'] = 1; - }elseif($id==3) - { - // - mysql_query('UPDATE `forum_msg` SET `nocom` = "2" WHERE `id` = "'.$this->see['id'].'" LIMIT 1'); - $this->see['nocom'] = 2; - }elseif($id==4) - { - // - mysql_query('UPDATE `forum_msg` SET `nocom` = "3" WHERE `id` = "'.$this->see['id'].'" LIMIT 1'); - $this->see['nocom'] = 3; - }elseif($id==5) - { - // - mysql_query('UPDATE `forum_msg` SET `nocom` = "4" WHERE `id` = "'.$this->see['id'].'" LIMIT 1'); - $this->see['nocom'] = 4; - }elseif($id==6) - { - // - mysql_query('UPDATE `forum_msg` SET `nocom` = "0" WHERE `id` = "'.$this->see['id'].'" LIMIT 1'); - $this->see['nocom'] = 0; - }elseif($id==9) - { - // - $rzn = mysql_fetch_array(mysql_query('SELECT * FROM `forum_menu` WHERE `id` = "'.mysql_real_escape_string($_GET['trm']).'" LIMIT 1')); - if(isset($rzn['id'])) { - mysql_query('UPDATE `forum_msg` SET `fid` = "'.mysql_real_escape_string($rzn['id']).'" WHERE `id` = "'.$this->see['id'].'" LIMIT 1'); - } - }elseif($id==7) { - // - if( $this->see['fixed'] == 0 ) { - $this->see['fixed'] = time(); - }else{ - $this->see['fixed'] = 0; - } - mysql_query('UPDATE `forum_msg` SET `fixed` = "'.$this->see['fixed'].'" WHERE `id` = "'.$this->see['id'].'" LIMIT 1'); - }elseif($id==8) { - // - $tpdms = mysql_fetch_array(mysql_query('SELECT `id`,`clear`,`delete` FROM `forum_msg` WHERE `id` = "'.mysql_real_escape_string(round((int)$_GET['delete_msg'])).'" LIMIT 1' )); - if(isset($tpdms['id'])) { - // if(isset($this->see['id'])) { - if( $tpdms['clear'] == 0 ) { - $tpdms['clear'] = time(); - }else{ - $tpdms['delete'] = $this->user['id']; - } - mysql_query('UPDATE `forum_msg` SET `clear` = "'.$tpdms['clear'].'",`delete` = "'.$tpdms['delete'].'",`del_login` = "'.$this->user['login'].'",`del_align` = "'.$this->user['align'].'",`del_clan` = "'.$this->user['clan'].'",`del_admin` = "'.$this->user['admin'].'" WHERE `id` = "'.$tpdms['id'].'" LIMIT 1'); - // } - } - } - if(!isset($this->see['id'])) { - header('location: ?r='.round((int)$_GET['r']).'&page='.round((int)$_GET['page'])); - }else{ - header('location: ?read='.$this->see['id'].'&page='.round((int)$_GET['page'])); - } - } - - public function genRz($pl) - { - global $code; - $rt = ''; - if(isset($pl['id'])) - { - //0 - , , 1 - , 2 - , 3 - , 4 - - $ico = 4; - if($pl['level']>$this->user['level']) - { - $ico = 1; - } - // - $this->gd[$pl['id']] = $ico; - $ico = ''; - $rt = ''.$ico.' '.$pl['name'].''; - }else{ - $rt = ' '; - } - return $rt; - } - - public function genMenu() - { - $m = ''; - - - $sp = mysql_query('SELECT * FROM `forum_menu` WHERE `parent` = "0" ORDER BY `pos` DESC'); - while($pl = mysql_fetch_array($sp)) - { - if( $pl['id'] == 65 && $this->user['admin'] == 0 && ($this->user['align'] <= 1 ||$this->user['align'] >= 2) ) { - - }elseif( $pl['id'] == 75 && $this->user['admin'] == 0 && ($this->user['align'] <= 3 ||$this->user['align'] >= 4) ) { - - }elseif($pl['only_admin']==0 || $this->user['admin']>0) - { - $m .= $this->genRz($pl).'
    '; - if($this->r==$pl['id'] || $this->fm['parent']==$pl['id']) - { - $sp2 = mysql_query('SELECT * FROM `forum_menu` WHERE `parent` = "'.$pl['id'].'" AND `parent2`="0"'); - while($pl2 = mysql_fetch_array($sp2)) - { - $m .= '    '.$this->genRz($pl2).'
    '; - if($this->r==$pl2['id'] || $this->fm['parent2']==$pl2['id']) - { - $sp3 = mysql_query('SELECT * FROM `forum_menu` WHERE `parent2` = "'.$pl2['id'].'"'); - while($pl3 = mysql_fetch_array($sp3)) - { - $m .= '        '.$this->genRz($pl3).'
    '; - } - } - } - } - } - } - - $this->menu = $m; - } + public function testAnswer($text) + { + + $r = str_replace('[/?]', '[?]', $text); + $r = explode('[?]', $r); + $i = 1; + $pr_us_all = 0; + while ($i != -1) { + if (isset($r[$i])) { + $ra = explode('[:]', $r[$i]); + $j = 0; + if (isset($this->user['id'])) { + $yg = mysql_fetch_array(mysql_query('SELECT * FROM `forum_answers` WHERE `msg_id` = "' . $this->see['id'] . '" AND `q_id` = "' . $i . '" AND `uid` = "' . $this->user['id'] . '" AND `delete` = "0" LIMIT 1')); + if (!isset($yg['id'], $_GET['q_now'], $_GET['answer_now']) && $_GET['q_now'] == $i) { + $_GET['answer_now'] = round((int)$_GET['answer_now']); + $_GET['q_now'] = round((int)$_GET['q_now']); + if (isset($ra[$_GET['answer_now']])) { + mysql_query('INSERT INTO `forum_answers` (`uid`,`msg_id`,`q_id`,`answer`,`time`,`city`) VALUES + ("' . $this->user['id'] . '","' . $this->see['id'] . '","' . mysql_real_escape_string($_GET['q_now']) . '","' . mysql_real_escape_string($_GET['answer_now']) . '", + "' . time() . '","' . $this->user['city'] . '")'); + die(''); + } + } + } + $pr_all = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `forum_answers` WHERE `msg_id` = "' . $this->see['id'] . '" AND `q_id` = "' . $i . '" AND `delete` = "0" LIMIT 1')); + $pr_all = $pr_all[0]; + $pr_us_all += $pr_all; + $pr_lst = 0; + $pr_asw = 0; + while ($j != -1) { + if (isset($ra[$j]) && $ra[$j] != '') { + if ($j > 0) { + + $prc = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `forum_answers` WHERE `msg_id` = "' . $this->see['id'] . '" AND `answer` = "' . $j . '" AND `q_id` = "' . $i . '" AND `delete` = "0" LIMIT 1')); + $prc = 0 + $prc[0]; + $pr_asw += $prc; + if ($pr_asw == $pr_all) { + $prc = 100 - $pr_lst; + $pr_lst += $prc; + if ($prc > 0) { + $prc = '' . $prc . ''; + } + } else { + $prc = floor($prc / $pr_all * 100); + if ($prc > 0) { + $pr_lst += $prc; + $prc = '' . $prc . ''; + } + } + if (isset($this->user['id'])) { + if (isset($yg['id'])) { + if ($yg['answer'] == $j) { + $zm = '• ' . $ra[$j] . '     -   ' . $prc . '%   ( )'; + } else { + $zm = '• ' . $ra[$j] . '     -   ' . $prc . '%'; + } + } else { + $zm = '• ' . $ra[$j] . '     -   ' . $prc . '%'; + } + } else { + $zm = '• ' . $ra[$j] . '     -   ' . $prc . '%'; + } + + $text = str_replace('[:]' . $ra[$j], $zm, $text); + } else { + $zm = '

    ' . $ra[$j] . '

    '; + $text = str_replace(str_replace('
    ', '', $ra[$j]), $zm, $text); + } + } else { + $j = -2; + } + $j++; + } + $text = str_replace('[?]', '', $text); + } else { + $i = -2; + } + $i++; + } + $text = str_replace('[/?]', '


    ' . $pr_us_all . '
    ', $text); + return $text; + } + + public function startForum() + { + // + $ufr = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string($_COOKIE['login']) . '" AND `pass` = "' . mysql_real_escape_string($_COOKIE['pass']) . '" AND `banned` = "0" LIMIT 1')); + if (!isset($ufr['id']) || $ufr['banned'] > 0) { + unset($u); + } else { + $ufr['sl'] = '' . $ufr['login'] . ' [' . $ufr['level'] . ']'; + $this->user = $ufr; + } + + // + if (isset($_GET['read'])) { + // + $see = mysql_fetch_array(mysql_query('SELECT * FROM `forum_msg` WHERE `id` = "' . mysql_real_escape_string($_GET['read']) . '" AND `delete` = "0" LIMIT 1')); + if (!isset($see['id']) || ($see['fid'] == 65 && $this->user['admin'] == 0 && ($this->user['align'] <= 1 || $this->user['align'] >= 2)) || ($see['fid'] == 75 && $this->user['admin'] == 0 && ($this->user['align'] <= 3 || $this->user['align'] >= 4))) { + $this->r = -2; + $this->error = ' .'; + } else { + $this->r = -1; + $see['goodAdd'] = 1; + if ($see['nocom'] > 0) { + if ($this->user['align'] > 1 && $this->user['align'] < 2) { + if ($see['nocom'] == 2 || $see['nocom'] == 4) { + $see['goodAdd'] = 0; + } + } + if ($this->user['align'] > 3 && $this->user['align'] < 4) { + if ($see['nocom'] == 2 || $see['nocom'] == 3) { + $see['goodAdd'] = 0; + } + } + if ($this->user['admin'] > 0) { + $see['goodAdd'] = 1; + } + } + $this->see = $see; + $this->fm = mysql_fetch_array(mysql_query('SELECT * FROM `forum_menu` WHERE `id` = "' . mysql_real_escape_string($see['fid']) . '" LIMIT 1')); + } + } else { + if (isset($_GET['r'])) { + $this->r = (int)$_GET['r']; + } else { + $this->r = 1; + } + + $fm = mysql_fetch_array(mysql_query('SELECT * FROM `forum_menu` WHERE `id` = "' . mysql_real_escape_string($this->r) . '" LIMIT 1')); + if (!isset($fm['id']) || ($fm['id'] == 65 && $this->user['admin'] == 0 && ($this->user['align'] <= 1 || $this->user['align'] >= 2)) || ($fm['id'] == 75 && $this->user['admin'] == 0 && ($this->user['align'] <= 3 || $this->user['align'] >= 4))) { + $this->r = -2; + $this->fm = false; + $this->error = ' .'; + } else { + $this->fm = $fm; + } + } + + $this->genMenu(); + + $this->lst = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `forum_msg` WHERE `uid` = "' . $this->user['id'] . '" AND `delete` = "0" ORDER BY `time` DESC LIMIT 1')); + + // + if ($this->gd[$this->fm['id']] == 0 && $ufr['admin'] == 0) { + // + $this->r = -2; + $this->error = ' .'; + } elseif ($this->fm['only_admin'] == 1 && $this->user['admin'] == 0) { + // + $this->r = -2; + $this->error = ' .'; + } + } + + public function seeTopic() + { + global $c; + $fd_limit = 20; + if (isset($_GET['page'])) { + $start = $_GET['page'] * $fd_limit - $fd_limit; + } else { + $start = 0; + //echo 'SELECT * FROM `forum_msg` WHERE `topic` < "0" AND `fid` = "'.$this->r.'" AND `delete` = "0" ORDER BY `id` DESC LIMIT '.$start.','.$fd_limit; + } + if ($this->see['fid'] == 65 && $this->user['admin'] == 0 && ($this->user['align'] <= 1 || $this->user['align'] >= 2)) { + + } elseif ($this->see['fid'] == 75 && $this->user['admin'] == 0 && ($this->user['align'] <= 3 || $this->user['align'] >= 4)) { + + } elseif (isset($this->see['id'])) { + // + echo $this->genuser($this->see['uid'], $this->see['login'], $this->see['level'], $this->see['align'], $this->see['clan'], $this->see['invis'], $this->see['city'], $this->see['cityreg']); + if ($this->user['admin'] > 0 || ($this->user['align'] > 1 && $this->user['align'] < 2) || ($this->user['align'] > 3 && $this->user['align'] < 4)) { + echo ' 
    '; + if ($this->user['admin'] > 0) { + echo ''; + } + echo ''; + echo ''; + echo '
    '; + } + echo '     (' . date('d.m.Y H:i', $this->see['time']) . ')
    '; + $this->see['text'] = str_replace("\n", "
    ", $this->see['text']); + $this->see['text'] = $this->testAnswer($this->see['text']); + $this->see['text'] = $this->parse_bb_code($this->see['text']); + + $rtrn = ''; + $rtrn .= 'see['fixed'] > 0) { + $rtrn .= ' class="fixed_topik"'; + } + + $rtrn .= ' style="margin-left:31px;">'; + + if ($this->see['clear'] == 0) { + $rtrn .= $this->see['text']; + } else { + if ($this->user['admin'] > 0) { + $rtrn .= '
    ' . $this->see['text'] . '
    '; + } + $rtrn .= '
    '; + if ($this->user['del_admin'] == 0) { + $rtrn .= ', ' . $this->see['del_login'] . ''; + } + $rtrn .= '
    '; + } + + // + $sp1 = mysql_query('SELECT * FROM `forum_msg_mod` WHERE `msg_id` = "' . $this->see['id'] . '"'); + while ($pl1 = mysql_fetch_array($sp1)) { + $rtrn .= '
    '; + if ($pl1['from_admin'] == 1) { + $pl1['login'] = '<>'; + $pl1['city'] = ''; + $pl1['cityreg'] = ''; + $pl1['clan'] = ''; + $pl1['level'] = '??'; + $pl1['uid'] = 0; + } + $rtrn .= $this->genuser($pl1['uid'], $pl1['login'], $pl1['level'], $pl1['align'], $pl1['clan'], $pl1['invis'], $pl1['city'], $pl1['cityreg']); + $rtrn .= ' (' . date('d.m.y H:i', $pl1['time']) . '): '; + $pl1['text'] = str_replace("\n", "
    ", $pl1['text']); + $rtrn .= $this->link_it($pl1['text']) . '
    '; + } + + $rtrn .= '
    '; + // + $sp = mysql_query('SELECT * FROM `forum_msg` WHERE `topic` = "' . $this->see['id'] . '" AND `delete` = "0" ORDER BY `time` ASC LIMIT ' . $start . ',' . $fd_limit); + while ($pl = mysql_fetch_array($sp)) { + + $rtrn .= $this->genuser($pl['uid'], $pl['login'], $pl['level'], $pl['align'], $pl['clan'], $pl['invis'], $pl['city'], $pl['cityreg']); + if ($this->user['admin'] > 0 || ($this->user['align'] > 1 && $this->user['align'] < 2) || ($this->user['align'] > 3 && $this->user['align'] < 4)) { + $rtrn .= ' 
    '; + if ($this->user['admin'] > 0) { + $rtrn .= ''; + } + $rtrn .= ''; + $rtrn .= ''; + $rtrn .= '
    '; + } + $rtrn .= '     (' . date('d.m.Y H:i', $pl['time']) . ')
    '; + $pl['text'] = $this->parse_bb_code($pl['text']); + $pl['text'] = str_replace("\n", "
    ", $pl['text']); + if ($pl['clear'] == 0) { + $rtrn .= '
    ' . $pl['text'] . '
    '; + } else { + if ($this->user['admin'] > 0) { + $rtrn .= '
    ' . $pl['text'] . '
    '; + } + $rtrn .= '
    '; + if ($this->user['del_admin'] == 0) { + $rtrn .= ', ' . $pl['del_login'] . ''; + } + $rtrn .= '
    '; + } + + // + $sp1 = mysql_query('SELECT * FROM `forum_msg_mod` WHERE `msg_id` = "' . $pl['id'] . '"'); + while ($pl1 = mysql_fetch_array($sp1)) { + $rtrn .= '
    '; + if ($pl1['from_admin'] == 1) { + $pl1['login'] = '<>'; + $pl1['city'] = ''; + $pl1['cityreg'] = ''; + $pl1['clan'] = ''; + $pl1['level'] = '??'; + $pl1['uid'] = 0; + } + $rtrn .= $this->genuser($pl1['uid'], $pl1['login'], $pl1['level'], $pl1['align'], $pl1['clan'], $pl1['invis'], $pl1['city'], $pl1['cityreg']); + $rtrn .= ' (' . date('d.m.y H:i', $pl1['time']) . '): '; + $pl1['text'] = str_replace("\n", "
    ", $pl1['text']); + $rtrn .= $this->link_it($pl1['text']) . '
    '; + } + + $rtrn .= '
    '; + } + echo $rtrn; + + } + } + + public function link_it($text) + { + $text = preg_replace("/(^|[\n ])([\w]*?)((ht|f)tp(s)?:\/\/[\w]+[^ \,\"\n\r\t<]*)/is", "$1$2$3", $text); + $text = preg_replace("/(^|[\n ])([\w]*?)((www|ftp)\.[^ \,\"\t\n\r<]*)/is", "$1$2$3", $text); + $text = preg_replace("/(^|[\n ])([a-z0-9&\-_\.]+?)@([\w\-]+\.([\w\-\.]+)+)/i", "$1$2@$3", $text); + return ($text); + } + + + public function genuser($id, $login, $level, $align, $clan, $invis, $city, $cityreg) + { + global $c, $code; + $ufr = ''; + if ($align > 0) { + $u .= ''; + } + if ($clan > 0) { + $clan = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . ((int)$clan) . '" LIMIT 1')); + if (isset($clan['id'])) { + $u .= ''; + } + } + + if ($login == '<>') { + $login = ''; + } + + $u .= '' . $login . ' [' . $level . ']'; + + if ($city != '') { + $ufr = '   ' . $u; + } + return $u; + } + + private function isAlign1() + { + return $this->user['align'] > 1 && $this->user['align'] < 2; + } + private function isAlign3() + { + return $this->user['align'] > 3 && $this->user['align'] < 4; + } + + public function pravasee() + { + // + return ($this->see['fid'] != 65 || $this->user['admin'] != 0 || $this->isAlign1()) && ($this->see['fid'] != 75 || $this->user['admin'] != 0 || $this->isAlign3()) && (!isset($this->see['id']) || $this->see['nocom'] != 3 || $this->user['admin'] != 0 || $this->isAlign3()) && (!isset($this->see['id']) || $this->see['nocom'] != 2 || $this->user['admin'] != 0 || $this->isAlign1()) && (!isset($this->see['id']) || $this->see['nocom'] != 1 || $this->user['admin'] != 0) && $this->user['level'] >= 1 && $this->lst['time'] <= time() - 60; + } + + public function admintopmsg($read, $id, $text, $color, $adm) + { + + $msg = mysql_fetch_array(mysql_query('SELECT `id` FROM `forum_msg` WHERE `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1')); + if (!isset($msg['id'])) { + $this->error = ' '; + } elseif (trim($text, ' ') == '' || iconv_strlen(trim($text, ' ')) < 2) { + $this->error = ' 2- '; + } elseif ($this->user['molch2'] > time()) { + $this->error = ' , '; + } elseif (isset($this->see['id']) && $this->see['nocom'] == 3 && $this->user['admin'] == 0 && ($this->user['align'] <= 3 || $this->user['align'] >= 4)) { + $this->error = ' '; + } elseif (isset($this->see['id']) && $this->see['nocom'] == 2 && $this->user['admin'] == 0 && ($this->user['align'] <= 1 || $this->user['align'] >= 2)) { + $this->error = ' '; + } elseif (isset($this->see['id']) && $this->see['nocom'] == 1 && $this->user['admin'] == 0) { + $this->error = ' '; + } elseif ($this->user['level'] < 8) { + $this->error = ' , 8- '; + } else { + mysql_query('INSERT INTO `forum_msg_mod` (`uid`,`login`,`align`,`level`,`admin`,`clan`,`time`,`text`,`msg_id`,`delete`,`color`,`city`,`cityreg`,`from_admin`) VALUES + ("' . $this->user['id'] . '","' . $this->user['login'] . '","' . $this->user['align'] . '","' . $this->user['level'] . '","' . $this->user['admin'] . '","' . $this->user['clan'] . '", + "' . time() . '","' . mysql_real_escape_string($text) . '","' . mysql_real_escape_string($msg['id']) . '","0","red","' . $this->user['city'] . '","' . $this->user['cityreg'] . '", + "' . mysql_real_escape_string(round((int)$adm)) . '") '); + if (!isset($this->see['id'])) { + header('location: ?r=' . round((int)$_GET['r']) . '&page=' . round((int)$_GET['page'])); + } else { + header('location: ?read=' . $this->see['id'] . '&page=' . round((int)$_GET['page'])); + } + } + + } + + public function parse_bb_code($text) + { + $text = preg_replace('/\[(\/?)(b|i|u|s)\s*\]/', "<$1$2>", $text); + + $text = preg_replace('/\[code\]/', '
    ', $text);
    +        $text = preg_replace('/\[\/code\]/', '
    ', $text); + + $text = preg_replace('/\[(\/?)quote\]/', "<$1blockquote>", $text); + $text = preg_replace('/\[(\/?)quote(\s*=\s*([\'"]?)([^\'"]+)\3\s*)?\]/', "<$1blockquote> $4:
    ", $text); + + //$text = preg_replace('/\[url\](?:https:\/\/)?([a-z0-9-.]+\.\w{2,4})\[\/url\]/', "$1", $text); + $text = preg_replace('/\[url=(.+?)\](.+?)\[\/url\]/', "$2", $text); + $text = preg_replace('/\[url\s?=\s?([\'"]?)(?:https:\/\/)?([a-z0-9-.]+\.\w{2,4})\1\](.*?)\[\/url\]/', "$3", $text); + + + $text = preg_replace('/\[img\s*\]([^\]\[]+)\[\/img\]/', "", $text); + $text = preg_replace('/\[img\s*=\s*([\'"]?)([^\'"\]]+)\1\]/', "", $text); + + $text = $this->close_dangling_tags($text); + + return $text; + } + + // $s - , + // $tags - | (b|u|i) + public function close_dangling_tags($html) + { + #put all opened tags into an array + preg_match_all("#<([a-z]+)( .*)?(?!/)>#iU", $html, $result); + $openedtags = $result[1]; + + #put all closed tags into an array + preg_match_all("##iU", $html, $result); + $closedtags = $result[1]; + $len_opened = count($openedtags); + # all tags are closed + if (count($closedtags) == $len_opened) { + return $html; + } + + $openedtags = array_reverse($openedtags); + # close tags + for ($i = 0; $i < $len_opened; $i++) { + if (!in_array($openedtags[$i], $closedtags)) { + if ($openedtags[$i] != 'br') { + $html .= ''; + } + } else { + unset($closedtags[array_search($openedtags[$i], $closedtags)]); + } + } + return $html; + } + + public function addnewtop($title, $text, $ico, $time, $login, $uid, $fid, $topic) + { + if (trim($text, ' ') == '' || iconv_strlen(trim($text, ' ')) < 5) { + $this->error = ' 5- '; + } elseif ($this->user['molch2'] > time()) { + $this->error = ' , '; + } elseif ((trim($title, ' ') == '' || iconv_strlen(trim($title, ' ')) < 5) && $topic == -1) { + $this->error = ' 5- '; + } elseif (isset($this->see['id']) && $this->see['nocom'] == 3 && $this->user['admin'] == 0 && ($this->user['align'] <= 3 || $this->user['align'] >= 4)) { + $this->error = ' '; + } elseif (isset($this->see['id']) && $this->see['nocom'] == 2 && $this->user['admin'] == 0 && ($this->user['align'] <= 1 || $this->user['align'] >= 2)) { + $this->error = ' '; + } elseif (isset($this->see['id']) && $this->see['nocom'] == 1 && $this->user['admin'] == 0) { + $this->error = ' '; + } elseif ($this->user['level'] < 2) { + $this->error = ' 2- '; + } elseif ($this->gd[$fid] > 0 && $this->lst['time'] < time() - 60) { + $ico = (int)$ico; + if ($ico < 1 || $ico > 14) { + $ico = 13; + } + $tl = []; + if (isset($_POST['adminname']) && $this->user['admin'] > 0) { + $tl['login'] = '<>'; + $tl['level'] = '??'; + $tl['align'] = '0'; + $tl['clan'] = '0'; + $tl['cityreg'] = 'newvillage'; + $tl['city'] = 'questcity'; + $tl['id'] = '0'; + } else { + $tl['login'] = $this->user['login']; + $tl['level'] = $this->user['level']; + $tl['align'] = $this->user['align']; + $tl['clan'] = $this->user['clan']; + $tl['cityreg'] = $this->user['cityreg']; + $tl['city'] = $this->user['city']; + $tl['id'] = $uid; + } + $lst = mysql_fetch_array(mysql_query('SELECT * FROM `forum_msg` WHERE `topic` = "' . mysql_real_escape_string($topic) . '" OR (`topic` = "-1" AND `id` = "' . mysql_real_escape_string($topic) . '") ORDER BY `time` DESC LIMIT 1')); + $ins = mysql_query('INSERT INTO `forum_msg` (`cityreg`,`city`,`align`,`clan`,`level`,`login`,`fid`,`title`,`topic`,`ico`,`text`,`time`,`ip`,`uid`) VALUES ("' . mysql_real_escape_string($tl['cityreg']) . '","' . mysql_real_escape_string($tl['city']) . '","' . mysql_real_escape_string($tl['align']) . '","' . mysql_real_escape_string($tl['clan']) . '","' . mysql_real_escape_string($tl['level']) . '","' . mysql_real_escape_string($tl['login']) . '","' . mysql_real_escape_string($fid) . '","' . mysql_real_escape_string(htmlspecialchars($title, null, 'cp1251')) . '","' . mysql_real_escape_string($topic) . '","' . mysql_real_escape_string($ico) . '","' . mysql_real_escape_string(htmlspecialchars($text, null, 'cp1251')) . '","' . mysql_real_escape_string($time) . '","' . $_SERVER['HTTP_X_REAL_IP'] . '","' . $tl['id'] . '")'); + if (!$ins) { + $this->error = ' '; + return false; + } else { + if ($topic != -1) { + // - + if ($lst['uid'] + 1 != $this->user['id']) { + $fnt = '' . date('d.m.Y H:i') . ' , . '; + $ins = ''; + $ll = []; + $sp = mysql_query('SELECT `u`.`city`,`u`.`id`,`u`.`login`,`f`.`uid`,`f`.`login` FROM `forum_msg` AS `f` LEFT JOIN `users` AS `u` ON `f`.`uid` = `u`.`id` WHERE `f`.`delete` = "0" AND (`f`.`topic` = "' . mysql_real_escape_string($topic) . '" OR (`f`.`topic` = "-1" AND `f`.`id` = "' . mysql_real_escape_string($topic) . '")) LIMIT 1'); + while ($pl = mysql_fetch_array($sp)) { + if (!isset($ll[$pl['uid']]) && $pl['uid'] != $this->user['id']) { + $ins .= '("' . $pl['city'] . '","1","' . $pl['login'] . '","6","-1","' . $fnt . '"),'; + $ll[$pl['uid']] = true; + } + } + unset($ll); + $ins = trim($ins, ','); + if ($ins != '') { + mysql_query('INSERT INTO `chat` (`city`,`new`,`to`,`type`,`time`,`text`) VALUES ' . $ins . ''); + } + } + } + $fid = mysql_insert_id(); + $this->lst['time'] = time(); + if (isset($this->see['id'])) { + header('location: ?read=' . $this->see['id'] . '&page=' . round((int)$_GET['page'])); + } else { + header('location: ?r=' . round((int)$_GET['r']) . '&page=' . round((int)$_GET['page'])); + } + return $fid; + } + } elseif ($this->lst['time'] > time() - 60) { + $this->error = ' '; + } else { + $this->error = ' '; + } + } + + public function forumData() + { + $fd_limit = 20; + $start = isset($_GET['page']) ? $_GET['page'] * $fd_limit - $fd_limit : 0; + global $code; + $filter = new Filter(); + // + $re = ''; + if (isset($_GET['search'])) { + $sp = mysql_query('SELECT * FROM `forum_msg` WHERE ( `text` LIKE "%' . mysql_real_escape_string($_GET['search']) . '%" OR `title` LIKE "%' . mysql_real_escape_string($_GET['search']) . '%" OR `login` LIKE "%' . mysql_real_escape_string($_GET['search']) . '%" ) AND `topic` < "0" AND `delete` = "0" ORDER BY `id` DESC LIMIT ' . $start . ',' . $fd_limit); + } else { + $sp = mysql_query('SELECT * FROM `forum_msg` WHERE `topic` < "0" AND `fid` = "' . $this->r . '" AND `delete` = "0" ORDER BY `fixed` DESC,`id` DESC LIMIT ' . $start . ',' . $fd_limit); + } + while ($pl = mysql_fetch_array($sp)) { + $lstDT = $pl['time']; + $row = mysql_num_rows(mysql_query('SELECT `id` FROM `forum_msg` WHERE `topic` = "' . $pl['id'] . '" AND `delete` = "0"')); + $plist = '' . $this->paginator(2, $pl['id']) . ''; + if ($plist != '') { + $plist = ' ' . $plist . ''; + } + + $re .= ' 0) { + $fxd = ' '; + $re .= ' class="fixed_topik"'; + } + $re .= ' style="margin-top:10px;">'; + $re .= '
    ' . $fxd . ' ' . $pl['title'] . ' ' . $plist . '   ' . $this->genuser($pl['uid'], $pl['login'], $pl['level'], $pl['align'], $pl['clan'], $pl['invis'], $pl['city'], $pl['cityreg']) . '
    '; + $re .= '
    ' . date('d.m.Y H:i', $pl['time']) . ' » '; + if ($pl['fid'] == 24) { + $re .= $filter->str_count(str_replace('[?]', ': ', str_replace('[/?]', '', str_replace('[:]', ', ', $pl['text']))), 250); + } else { + $re .= $filter->str_count(str_replace('[?]', ': ', str_replace('[/?]', '', str_replace('[:]', ', ', $pl['text']))), 250); + } + $re .= '
    '; + $re .= '
    : ' . $row . ' ... '; + + $pku = mysql_query('SELECT `login`,`invis`,`time` FROM `forum_msg` WHERE `topic` = "' . $pl['id'] . '" AND `delete` = 0 ORDER BY `id` DESC LIMIT 10'); + $pkusr = ''; + while ($plku = mysql_fetch_array($pku)) { + $pkusr = $plku['login'] . ', ' . $pkusr; + $lstDT = $plku['time']; + } + $pkusr = rtrim($pkusr, ', '); + $re .= $pkusr; + unset($pkusr); + + $re .= '     (' . date('d.m.Y H:i', $lstDT) . ')
    '; + $re .= '
    '; + $re .= "\n"; + } + echo $re; + } + + public function history($id, $uid, $act, $text) + { + if ($type == 1) { + + } + } + + public function actionSee($id) + { + if ($id == 1) { + // \ + $up = mysql_query('UPDATE `forum_msg` SET `delete` = "' . time() . '",`del_login`="' . $this->user['login'] . '" WHERE `id` = "' . $this->see['id'] . '" LIMIT 1'); + $this->see['delete'] = time(); + } elseif ($id == 2) { + // + mysql_query('UPDATE `forum_msg` SET `nocom` = "1" WHERE `id` = "' . $this->see['id'] . '" LIMIT 1'); + $this->see['nocom'] = 1; + } elseif ($id == 3) { + // + mysql_query('UPDATE `forum_msg` SET `nocom` = "2" WHERE `id` = "' . $this->see['id'] . '" LIMIT 1'); + $this->see['nocom'] = 2; + } elseif ($id == 4) { + // + mysql_query('UPDATE `forum_msg` SET `nocom` = "3" WHERE `id` = "' . $this->see['id'] . '" LIMIT 1'); + $this->see['nocom'] = 3; + } elseif ($id == 5) { + // + mysql_query('UPDATE `forum_msg` SET `nocom` = "4" WHERE `id` = "' . $this->see['id'] . '" LIMIT 1'); + $this->see['nocom'] = 4; + } elseif ($id == 6) { + // + mysql_query('UPDATE `forum_msg` SET `nocom` = "0" WHERE `id` = "' . $this->see['id'] . '" LIMIT 1'); + $this->see['nocom'] = 0; + } elseif ($id == 9) { + // + $rzn = mysql_fetch_array(mysql_query('SELECT * FROM `forum_menu` WHERE `id` = "' . mysql_real_escape_string($_GET['trm']) . '" LIMIT 1')); + if (isset($rzn['id'])) { + mysql_query('UPDATE `forum_msg` SET `fid` = "' . mysql_real_escape_string($rzn['id']) . '" WHERE `id` = "' . $this->see['id'] . '" LIMIT 1'); + } + } elseif ($id == 7) { + // + if ($this->see['fixed'] == 0) { + $this->see['fixed'] = time(); + } else { + $this->see['fixed'] = 0; + } + mysql_query('UPDATE `forum_msg` SET `fixed` = "' . $this->see['fixed'] . '" WHERE `id` = "' . $this->see['id'] . '" LIMIT 1'); + } elseif ($id == 8) { + // + $tpdms = mysql_fetch_array(mysql_query('SELECT `id`,`clear`,`delete` FROM `forum_msg` WHERE `id` = "' . mysql_real_escape_string(round((int)$_GET['delete_msg'])) . '" LIMIT 1')); + if (isset($tpdms['id'])) { + // if(isset($this->see['id'])) { + if ($tpdms['clear'] == 0) { + $tpdms['clear'] = time(); + } else { + $tpdms['delete'] = $this->user['id']; + } + mysql_query('UPDATE `forum_msg` SET `clear` = "' . $tpdms['clear'] . '",`delete` = "' . $tpdms['delete'] . '",`del_login` = "' . $this->user['login'] . '",`del_align` = "' . $this->user['align'] . '",`del_clan` = "' . $this->user['clan'] . '",`del_admin` = "' . $this->user['admin'] . '" WHERE `id` = "' . $tpdms['id'] . '" LIMIT 1'); + // } + } + } + if (!isset($this->see['id'])) { + header('location: ?r=' . round((int)$_GET['r']) . '&page=' . round((int)$_GET['page'])); + } else { + header('location: ?read=' . $this->see['id'] . '&page=' . round((int)$_GET['page'])); + } + } + + public function genRz($pl) + { + global $code; + $rt = ''; + if (isset($pl['id'])) { + //0 - , , 1 - , 2 - , 3 - , 4 - + $ico = 4; + if ($pl['level'] > $this->user['level']) { + $ico = 1; + } + // + $this->gd[$pl['id']] = $ico; + $ico = ''; + $rt = '' . $ico . ' ' . $pl['name'] . ''; + } else { + $rt = ' '; + } + return $rt; + } + + public function genMenu() + { + $m = ''; + + + $sp = mysql_query('SELECT * FROM `forum_menu` WHERE `parent` = "0" ORDER BY `pos` DESC'); + while ($pl = mysql_fetch_array($sp)) { + if ($pl['id'] == 65 && $this->user['admin'] == 0 && ($this->user['align'] <= 1 || $this->user['align'] >= 2)) { + + } elseif ($pl['id'] == 75 && $this->user['admin'] == 0 && ($this->user['align'] <= 3 || $this->user['align'] >= 4)) { + + } elseif ($pl['only_admin'] == 0 || $this->user['admin'] > 0) { + $m .= $this->genRz($pl) . '
    '; + if ($this->r == $pl['id'] || $this->fm['parent'] == $pl['id']) { + $sp2 = mysql_query('SELECT * FROM `forum_menu` WHERE `parent` = "' . $pl['id'] . '" AND `parent2`="0"'); + while ($pl2 = mysql_fetch_array($sp2)) { + $m .= '    ' . $this->genRz($pl2) . '
    '; + if ($this->r == $pl2['id'] || $this->fm['parent2'] == $pl2['id']) { + $sp3 = mysql_query('SELECT * FROM `forum_menu` WHERE `parent2` = "' . $pl2['id'] . '"'); + while ($pl3 = mysql_fetch_array($sp3)) { + $m .= '        ' . $this->genRz($pl3) . '
    '; + } + } + } + } + } + } + + $this->menu = $m; + } } $f = new forum; diff --git a/forum_script/index.php b/forum_script/index.php index 5f0b08b9..c10fe8a1 100644 --- a/forum_script/index.php +++ b/forum_script/index.php @@ -1,888 +1,1200 @@ -startForum(); -if(($f->user['align']>1 && $f->user['align']<2) || ($f->user['align']>3 && $f->user['align']<4) || $f->user['admin']>0) -{ - if(isset($_GET['mod_use'])) - { - if(!isset($_COOKIE['mod'])) - { - setcookie('mod',true,time()+60*60*24*30); - $_COOKIE['mod'] = true; - }else{ - setcookie('mod',true,time()-60*60*24*30); - unset($_COOKIE['mod']); - } - }elseif(isset($_GET['mod_use2']) && $f->user['admin']>0) - { - if(!isset($_COOKIE['mod2'])) - { - setcookie('mod2',true,time()+60*60*24*30); - $_COOKIE['mod2'] = true; - }else{ - setcookie('mod2',true,time()-60*60*24*30); - unset($_COOKIE['mod2']); - } - } - - $mod = 'on'; - $mod2 = 'off'; - - if(isset($_COOKIE['mod'])) - { - $mod = 'off'; - $f->mod = 1; - } - if(isset($_COOKIE['mod2']) && $f->user['admin']>0) - { - $mod2 = 'on'; - $f->user['admin'] = 0; - } +if (($f->user['align'] > 1 && $f->user['align'] < 2) || ($f->user['align'] > 3 && $f->user['align'] < 4) || $f->user['admin'] > 0) { + if (isset($_GET['mod_use'])) { + if (!isset($_COOKIE['mod'])) { + setcookie('mod', true, time() + 60 * 60 * 24 * 30); + $_COOKIE['mod'] = true; + } else { + setcookie('mod', true, time() - 60 * 60 * 24 * 30); + unset($_COOKIE['mod']); + } + } elseif (isset($_GET['mod_use2']) && $f->user['admin'] > 0) { + if (!isset($_COOKIE['mod2'])) { + setcookie('mod2', true, time() + 60 * 60 * 24 * 30); + $_COOKIE['mod2'] = true; + } else { + setcookie('mod2', true, time() - 60 * 60 * 24 * 30); + unset($_COOKIE['mod2']); + } + } + + $mod = 'on'; + $mod2 = 'off'; + + if (isset($_COOKIE['mod'])) { + $mod = 'off'; + $f->mod = 1; + } + if (isset($_COOKIE['mod2']) && $f->user['admin'] > 0) { + $mod2 = 'on'; + $f->user['admin'] = 0; + } } -if(isset($f->user['id'])) -{ - if(isset($_POST['add_otv_adm']) && (($f->user['align']>1 && $f->user['align']<2) || ($f->user['align']>3 && $f->user['align']<4) || $f->user['admin']>0)) { - - $f->admintopmsg(round((int)$_GET['read']),round((int)$_POST['add_otv_adm']),$_POST['text2_adm'],'Red',round((int)$_POST['adminname_adm'])); - - }elseif(isset($_POST['add_top'])) - { - //if($f->gd[$f->fm['id']]==3 || $f->gd[$f->fm['id']]==4 || $f->user['admin']>0) - //{ - $add = $f->addnewtop($_POST['title'],$_POST['text'],$_POST['icon'],time(),$f->user['login'],$f->user['id'],$_POST['add_top'],-1); - if($add>0) - { - $fnt = ' , "" "'.$_POST['title'].'". '; - mysql_query('INSERT INTO `chat` (`type`,`time`,`text`) VALUES ("45","'.time().'","'.$fnt.'")'); - } - //} - }elseif(isset($_POST['add_otv'])) - { - $addTo = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`delete`,`fid` FROM `forum_msg` WHERE `id` = "'.mysql_real_escape_string($_POST['add_otv']).'" LIMIT 1')); - if(isset($addTo['id'])) - { - //if($f->gd[$addTo['fid']]==2 || $f->gd[$addTo['fid']]==4 || $f->user['admin']>0) - //{ - $add = $f->addnewtop('',$_POST['text2'],0,time(),$f->user['login'],$f->user['id'],$addTo['fid'],$addTo['id']); - //} - } - } +if (isset($f->user['id'])) { + if (isset($_POST['add_otv_adm']) && (($f->user['align'] > 1 && $f->user['align'] < 2) || ($f->user['align'] > 3 && $f->user['align'] < 4) || $f->user['admin'] > 0)) { + + $f->admintopmsg( + round((int)$_GET['read']), round((int)$_POST['add_otv_adm']), $_POST['text2_adm'], 'Red', + round((int)$_POST['adminname_adm']) + ); + + } elseif (isset($_POST['add_top'])) { + //if($f->gd[$f->fm['id']]==3 || $f->gd[$f->fm['id']]==4 || $f->user['admin']>0) + //{ + $add = $f->addnewtop( + $_POST['title'], $_POST['text'], $_POST['icon'], time(), $f->user['login'], $f->user['id'], + $_POST['add_top'], -1 + ); + if ($add > 0) { + $fnt = ' , "" "' . $_POST['title'] . '". '; + mysql_query('INSERT INTO `chat` (`type`,`time`,`text`) VALUES ("45","' . time() . '","' . $fnt . '")'); + } + //} + } elseif (isset($_POST['add_otv'])) { + $addTo = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`time`,`delete`,`fid` FROM `forum_msg` WHERE `id` = "' . mysql_real_escape_string( + $_POST['add_otv'] + ) . '" LIMIT 1' + ) + ); + if (isset($addTo['id'])) { + //if($f->gd[$addTo['fid']]==2 || $f->gd[$addTo['fid']]==4 || $f->user['admin']>0) + //{ + $add = $f->addnewtop( + '', $_POST['text2'], 0, time(), $f->user['login'], $f->user['id'], $addTo['fid'], $addTo['id'] + ); + //} + } + } } -if(isset($_GET['read']) && $f->mod==1) -{ - - if(isset($_GET['trm']) && (($f->user['align']>1 && $f->user['align']<2) || ($f->user['align']>3 && $f->user['align']<4) || $f->user['admin']>0)) { - $f->actionSee(9); - }elseif(isset($_GET['delete_msg']) && (($f->user['align']>=1.5 && $f->user['align']<2) || ($f->user['align']>=3.05 && $f->user['align']<4) || $f->user['admin']>0)) { - $f->actionSee(8); - }elseif(isset($_GET['delete']) && isset($f->see['id']) && (($f->user['align']>=1.5 && $f->user['align']<2) || ($f->user['align']>=3.05 && $f->user['align']<4) || $f->user['admin']>0)) - { - $f->actionSee(1); - }elseif(isset($_GET['nocomment']) && isset($f->see['id']) && (($f->user['align']>=1.5 && $f->user['align']<2) || ($f->user['align']>=3.05 && $f->user['align']<4) || $f->user['admin']>0)) - { - $f->actionSee(2); - }elseif(isset($_GET['fixed']) && isset($f->see['id']) && (($f->user['align']>=1.5 && $f->user['align']<2) || ($f->user['align']>=3.05 && $f->user['align']<4) || $f->user['admin']>0)) - { - $f->actionSee(7); - }elseif(isset($_GET['onlyadmin']) && isset($f->see['id']) && $f->user['admin']>0) - { - $f->actionSee(3); - }elseif(isset($_GET['onlymoder']) && isset($f->see['id']) && (($f->user['align']>=3.05 && $f->user['align']<4) || ($f->user['admin']>0 && $_GET['onlymoder']==2))) - { - $f->actionSee(5); - }elseif(isset($_GET['onlymoder']) && isset($f->see['id']) && (($f->user['align']>=1.5 && $f->user['align']<2) || ($f->user['admin']>0 && $_GET['onlymoder']==1))) - { - $f->actionSee(4); - }elseif(isset($_GET['onlyall']) && isset($f->see['id']) && (($f->user['align']>=1.5 && $f->user['align']<2) || ($f->user['align']>=3.05 && $f->user['align']<4) || $f->user['admin']>0)) - { - $f->actionSee(6); - } +if (isset($_GET['read']) && $f->mod == 1) { + + if (isset($_GET['trm']) && (($f->user['align'] > 1 && $f->user['align'] < 2) || ($f->user['align'] > 3 && $f->user['align'] < 4) || $f->user['admin'] > 0)) { + $f->actionSee(9); + } elseif (isset($_GET['delete_msg']) && (($f->user['align'] >= 1.5 && $f->user['align'] < 2) || ($f->user['align'] >= 3.05 && $f->user['align'] < 4) || $f->user['admin'] > 0)) { + $f->actionSee(8); + } elseif (isset($_GET['delete']) && isset($f->see['id']) && (($f->user['align'] >= 1.5 && $f->user['align'] < 2) || ($f->user['align'] >= 3.05 && $f->user['align'] < 4) || $f->user['admin'] > 0)) { + $f->actionSee(1); + } elseif (isset($_GET['nocomment']) && isset($f->see['id']) && (($f->user['align'] >= 1.5 && $f->user['align'] < 2) || ($f->user['align'] >= 3.05 && $f->user['align'] < 4) || $f->user['admin'] > 0)) { + $f->actionSee(2); + } elseif (isset($_GET['fixed']) && isset($f->see['id']) && (($f->user['align'] >= 1.5 && $f->user['align'] < 2) || ($f->user['align'] >= 3.05 && $f->user['align'] < 4) || $f->user['admin'] > 0)) { + $f->actionSee(7); + } elseif (isset($_GET['onlyadmin']) && isset($f->see['id']) && $f->user['admin'] > 0) { + $f->actionSee(3); + } elseif (isset($_GET['onlymoder']) && isset($f->see['id']) && (($f->user['align'] >= 3.05 && $f->user['align'] < 4) || ($f->user['admin'] > 0 && $_GET['onlymoder'] == 2))) { + $f->actionSee(5); + } elseif (isset($_GET['onlymoder']) && isset($f->see['id']) && (($f->user['align'] >= 1.5 && $f->user['align'] < 2) || ($f->user['admin'] > 0 && $_GET['onlymoder'] == 1))) { + $f->actionSee(4); + } elseif (isset($_GET['onlyall']) && isset($f->see['id']) && (($f->user['align'] >= 1.5 && $f->user['align'] < 2) || ($f->user['align'] >= 3.05 && $f->user['align'] < 4) || $f->user['admin'] > 0)) { + $f->actionSee(6); + } } -$dost = array(0=>' ',1=>' ',2=>' ',3=>' ',4=>' '); +$dost = [0 => ' ', 1 => ' ', 2 => ' ', 3 => ' ', 4 => ' ']; ?> - - - - - - - - - - - + + + + + + + + + + + - - + + //--> +
    -
    -*/ ?> - +
    - - - - - + + -
       - - error) && $f->error!='' && $f->r!=-2) - { - echo ''.$f->error.''; - } - if($f->user['admin']>0 && isset($_GET['aem'])) - { - ?> -
    -

    -
    -


    '; - }else{ - $fm = mysql_fetch_array(mysql_query('SELECT * FROM `forum_menu` WHERE `id` = "'.$ed['fid'].'" LIMIT 1')); - echo 'ID: '.$ed['id'].'
    : '.$fm['name'].'
    '; - } - ?> -
    - - +
    - - - -
    - - - - - - - - - - - - - - - -
    user==false){ echo '
    '; }else{ echo ' :
    '.$u->microLogin($u->info['id'],1).'

    '; } ?> - user['align']>1 && $f->user['align']<2) || ($f->user['align']>3 && $f->user['align']<4) || $f->user['admin']>0){ echo '
    ['.$mod.']'; } - if($f->user['admin']>0 || $mod2=='on'){ echo '
    ['.$mod2.']'; } ?> -
    -
    -
    -
    -
    - menu; ?> -
    -


    - - - - - - - - - - - - - - - - -
    - : "'.$word.'". '.$limw.' .
    '; ?>
    - - - paginator(1); - ?> - - - -
    :
    :
    -
    - forumData(); ?> -
    :
     
    -
    - r>=1){ - // - ?> - - - - - + r == -2) { + //- + ?> +
    - - - - - - - - - - - - - - - -
    user==false){ echo '
    '; }else{ echo ' :
    '.$u->microLogin($u->info['id'],1).'

    '; } ?> - user['align']>1 && $f->user['align']<2) || ($f->user['align']>3 && $f->user['align']<4) || $f->user['admin']>0){ echo '
    ['.$mod.']'; } - if($f->user['admin']>0 || $mod2=='on'){ echo '
    ['.$mod2.']'; } ?> -
    -
    -
    -
    -
    - menu; ?> -
    -


    - - - - - - - - - - - - - - - - - - - -
    - "'.$f->fm['name'].'"

    '.$f->fm['opisan']; ?>
    - - - paginator(1); - ?> - - - -
    :
    :
    -
    - forumData(); ?> -
    :
     
    - user['id'])){ ?> -
    - gd[$f->fm['id']]!=2 && $f->gd[$f->fm['id']]!=4 && $f->user['admin']==0) - { - echo '



    '; - }elseif($f->lst['time'] -
    - - - - - - - - - - - -

    - -
    - -
    - -
    - -
    - -
    + + + - -
       + + error) && $f->r != -2? '' . $f->error . '' : ''?> + user['admin'] > 0 && isset($_GET['aem'])) { + ?> +
    +

    +
    +


    '; + } else { + $fm = mysql_fetch_array( + mysql_query('SELECT * FROM `forum_menu` WHERE `id` = "' . $ed['fid'] . '" LIMIT 1') + ); + echo 'ID: ' . $ed['id'] . '
    : ' . $fm['name'] . '
    '; + } + ?> +
    + + - - + + -
    user['admin']>0) - { - echo '

    '; - } - ?> - -   - -   - -   - -   - -   - -   - -
    - -   - -   - -   - -   - -   - -   - -
    - - - + + + + + + + + + + + + + + + + +
    +
    user) { + echo '
    '; + } else { + echo ' :
    ' . $u->microLogin( + $u->info['id'], 1 + ) . '

    '; + } ?> + user['align'] > 1 && $f->user['align'] < 2) || ($f->user['align'] > 3 && $f->user['align'] < 4) || $f->user['admin'] > 0) { + echo '
    [' . $mod . ']'; + } + if ($f->user['admin'] > 0 || $mod2 == 'on') { + echo '
    [' . $mod2 . ']'; + } ?> +
    +
    +
    +
    +
    +
    +
    + menu; ?> +
    +
    +
    +
    +


    +
    +
    + + + + + + + + + + + + + + + + +
    +
    + : "' . $word . '". ' . $limw . ' .
    '; ?>
    +
    +
    + + + paginator(1); + ?> + + + +
    +
    :
    +
    +
    + : + +
    +
    +
    +
    + forumData(); ?> +
    +
    +
    :
    +
     
    +
    +
    - -
    .
    '.round($f->lst['time']+61-time()).' .

    '; } ?> - - -
    -
    - r==-1){ - // - ?> - - - - - - - - - - - - - - -
    - - - - - - - - - - - paginator(2); - ?> - - - -
     
    - see['fid'].'" AND `topic` = "-1" AND `delete` = "0" AND `id` > '.$f->see['id'].' ORDER BY `id` ASC LIMIT 1')); - $url2 = mysql_fetch_array(mysql_query('SELECT `id`,`title` FROM `forum_msg` WHERE `fid` = "'.$f->see['fid'].'" AND `topic` = "-1" AND `delete` = "0" AND `id` < '.$f->see['id'].' ORDER BY `id` DESC LIMIT 1')); - - if(isset($url1['id'])) { - $url1 = '« '; - }else{ - $url1 = '« '; - } - if(isset($url2['id'])) { - $url2 = ' »'; - }else{ - $url2 = ' »'; - } - - ?> -
    ||
    -
    -
     
    :
    -

    fm['name']; ?> > see['title']; ?>

    - user['align']>1.5 || $f->user['align']>3.05 || $f->user['admin']>0) && $f->mod == 1){ ?> -
    - : see['nocom']]; ?>
    -
    user['admin'] > 0) { - $rtn .= ''; - } - } - echo $rtn; - ?> -
    - + + + + +
    + + + + + + + + + + + + + + + + +
    +
    user == false) { + echo '
    '; + } else { + echo ' :
    ' . $u->microLogin( + $u->info['id'], 1 + ) . '

    '; + } ?> + user['align'] > 1 && $f->user['align'] < 2) || ($f->user['align'] > 3 && $f->user['align'] < 4) || $f->user['admin'] > 0) { + echo '
    [' . $mod . ']'; + } + if ($f->user['admin'] > 0 || $mod2 == 'on') { + echo '
    [' . $mod2 . ']'; + } ?> +
    +
    +
    +
    +
    +
    +
    + menu; ?> +
    +
    +
    +
    +


    +
    +
    + + + + + + + + + + + + + + + + + + + +
    +
    + "' . $f->fm['name'] . '"

    ' . $f->fm['opisan']; ?>
    +
    +
    + + + paginator(1); + ?> + + + +
    +
    :
    +
    +
    +
    :
    +
    +
    +
    +
    + forumData(); ?> +
    +
    +
    :
    +
     
    + user['id'])) { ?> +
    + gd[$f->fm['id']] != 2 && $f->gd[$f->fm['id']] != 4 && $f->user['admin'] == 0) { + echo '



    '; + } elseif ($f->lst['time'] < time() - 60) { ?> +
    + + + + + + + + + + + +

    +

    + + +
    + +
    + +
    + +
    + +
    + + + + + +
    user['admin'] > 0) { + echo '

    '; + } + ?> + + +   + + +   + + +   + + +   + + +   + + +   + +
    + + +   + + +   + + +   + + +   + + +   + + +   + + +
    + + +
    +
    +
    +
    .
    ' . round( + $f->lst['time'] + 61 - time() + ) . ' .

    '; + } ?> +
    + +
    +
    +
    see['nocom']==0) - { - if($f->user['admin']>0) - { - ?> - - user['align']>1.5 && $f->user['align']<2) || $f->user['admin']>0) - { - ?> - - user['align']>3.05 && $f->user['align']<4) || $f->user['admin']>0) - { - ?> - - - - - - - -
    seeTopic(); ?>
    :
    user['id']) || !isset($f->user['id'])){ ?> -
    - see['nocom']>0) - { - echo '



    '; - }elseif($f->see['goodAdd']!=1 || $f->pravasee()!=1) - { - echo '

    .
    '.round($f->lst['time']+62-time()).' .

    '; - }/*elseif($f->gd[$f->see['fid']]!=3 && $f->gd[$f->see['fid']]!=4 && $f->user['admin']==0) + } elseif ($f->r == -1) { + // + ?> + + + + + +
    + + + + + + + + + + + + paginator(2); + ?> + + + + + + + + + + + + + + +
     
    +
    + see['fid'] . '" AND `topic` = "-1" AND `delete` = "0" AND `id` > ' . $f->see['id'] . ' ORDER BY `id` ASC LIMIT 1' + ) + ); + $url2 = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`title` FROM `forum_msg` WHERE `fid` = "' . $f->see['fid'] . '" AND `topic` = "-1" AND `delete` = "0" AND `id` < ' . $f->see['id'] . ' ORDER BY `id` DESC LIMIT 1' + ) + ); + + if (isset($url1['id'])) { + $url1 = '« '; + } else { + $url1 = '« '; + } + if (isset($url2['id'])) { + $url2 = ' »'; + } else { + $url2 = ' »'; + } + + ?> +
    ||
    +
    +
    +
     
    :
    +

    fm['name']; ?> > see['title']; ?>

    + user['align'] > 1.5 || $f->user['align'] > 3.05 || $f->user['admin'] > 0) && $f->mod == 1) { ?> +
    + : see['nocom']]; ?>
    +
    + +
    + +
    seeTopic(); ?>
    :
    user['id']) || !isset($f->user['id'])) { ?> +
    + see['nocom'] > 0) { + echo '



    '; + } elseif ($f->see['goodAdd'] != 1 || $f->pravasee() != 1) { + echo '

    .
    ' . round( + $f->lst['time'] + 62 - time() + ) . ' .

    '; + }/*elseif($f->gd[$f->see['fid']]!=3 && $f->gd[$f->see['fid']]!=4 && $f->user['admin']==0) { echo '



    '; - }*/elseif($f->lst['time'] -
    - - - - - - - - - - - + }*/ elseif ($f->lst['time'] < time() - 60) { ?> + +

    -
    - -
    - -
    -
    - - - - -
    user['admin']>0) - { - echo '

    '; - } - ?>
    - -
    + + + + + + + + + + +

    + +
    + +
    + +
    +
    + + + + + +
    user['admin'] > 0) { + echo '

    '; + } + ?>
    + +
    +
    +
    +
    .

    '; + } ?> +
    +
    +
     
    - -
    .

    '; } ?> -
    -
     
    + + + +
    : error; ?>
    + + +
      
    - r==-2){ - //- - ?> - - - - -
    : error; ?>
    - - - -   -   - - +
    \ No newline at end of file diff --git a/getbattle.php b/getbattle.php index 84a293d1..5c185ee6 100644 --- a/getbattle.php +++ b/getbattle.php @@ -1,16 +1,8 @@ 0) { echo '{ "btl":"'.(0+$bt['id']).'" , "hod":"'.(0+$bt['hod']).'" , "you":"'.(0+$user['id']).'" , "enemy":"'.(0+$stats['enemy']).'" , "pr": [ "'.$stats['priems'].'" , "'.$stats['priems_z'].'" , '.(0+$stats['priemslot']).' ] , "dm":"'.floor($stats['battle_yron']).'" , "to":"'.round($bt['timeout']/60,2).'" , "r":{ '.ltrim($r,',').' } , "e":"'.$error.'" , "t1":"'.$stats['tactic1'].'" , "t2":"'.$stats['tactic2'].'" , "t3":"'.$stats['tactic3'].'" , "t4":"'.$stats['tactic4'].'" , "t5":"'.$stats['tactic5'].'" , "t6":"'.$stats['tactic6'].'" , "t7":"'.$stats['tactic7'].'" }'; -?> \ No newline at end of file diff --git a/head/buttons.php b/head/buttons.php deleted file mode 100644 index 0083285e..00000000 --- a/head/buttons.php +++ /dev/null @@ -1,1114 +0,0 @@ -

    :

    '.$e.'


    (c) '.$c[1].'

    '); -} - -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()); - -include_once('_incl_data/__config.php'); -include_once('_incl_data/class/__db_connect.php'); -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' ); - -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(''); -}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
    .'); -} - -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); - -if($u->info['activ']>0) { - include('activnew.php'); - die(); -} - -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -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 ''; -}*/ -// -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 ''; -?> - - - - - - - - - - - - -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 '
    -
    - ?
    :


    -  , ! ? , , - " " .., , , . - , . - , ! ! , , , - - . - !
    -  - ! , . -



    - , ! ! ;-) -
    ';*/ -//} -?> - -info['bithday'] == '01.01.1800') { -?> - - - -info['active']!='' && $u->info['mail']=='No E-mail') { - if($error!='') { - echo ''; - } -?> - - - - -
    - - - -
    -
    -
    -
    -
    - :
    -
    : -
    -
    -
    - -
        
    -
    - - -
    - -
    - - - -
    -
    - -
    -
    - -
    - - - - - - - - - -
    - - - - - -
    - - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
    -
    - -
    -
    - - - - - -
    -
    -
    -
    - - - - - - -
    -
    -
    */ ?> - -
    - -
    - - - -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    - -
    -
    - -
    - info['admin'] > 0 ) { ?> - -
    - -
    -
    -
    -
    - - - - - - - - - info['level']>9){ ?> - - - - - - - - - - - - - info['level']>7){ ?> - - info['level']>=0){ ?> - - - info['align']==50 || $u->info['align2']==50 || $u->info['admin'] == 1) {?> - - info['align']>=1.1 && $u->info['align']<2 ){ ?> - - info['align']>=3.01 && $u->info['align']<4){ ?> - - info['vip']>time() || $u->stats['silvers']>0 || $u->stats['bronze']>0 || $u->stats['gold']>0 ){ ?> - - - - info['level']>= 0){ ?> - - info['align']>=1 && $u->info['align']<2){ ?> - - info['align']>=3 && $u->info['align']<4){ ?> - - info['align']==7) { ?> - - info['bukmeker']==1 || $u->info['admin']==1){ ?> - - info['admin'] > 0 || $u->info['align'] == 50){ ?> - - info['level']>-1){ ?> - - info['clan']>0){ ?> - - info['admin']>0){ ?> - - - - - - - - - - - - -
    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="">  - - - - - - - - -   - -
    -
    - - - - -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 ''; - //$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(''); - } - } - */ -} -?> - - - - \ No newline at end of file diff --git a/hmonitor.php b/hmonitor.php index 6a608e8e..38a84cac 100644 --- a/hmonitor.php +++ b/hmonitor.php @@ -1,194 +1,204 @@ -get(); +$u = User::start(); ?> - + - - - - - - + + + + + + -
    : microLogin($u->info['id'],1)?>
    +
    : microLogin($u->info['id'], 1) ?>

    -
    -

                          

    -
    +

                           +

    +microLogin($plu['id'],1).','; - } - // - if( $users == '' ) { - $users = ' !'; - }else{ - $users = rtrim($users,','); - } - // - $html .= $i . '. '.date('H:i',$pl['time']).' '; - $html .= ' '; - $html .= ' ('.$users.') ('.$pl['min_lvl_1'].'-'.$pl['max_lvl_1'].') : '; - if( $pl['noinc'] > 0 ) { - $html .= ''; - } - if( $pl['fastfight'] > 0 ) { - $html .= ''; - } - if( $pl['arand'] > 0 ) { - $html .= ''; - } - $html .= ' '.$u->timeOut($pl['time']+$pl['time_start']-time()).', '.$u->timeOut($pl['timeout']).''; - if( $pl['priz'] > 0 ) { - $html .= '( )
    '; - } - $html .= '
    '; +while ($pl = mysql_fetch_array($sp)) { + $i++; + // + $users = ''; + // + $spu = mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "' . $pl['id'] . '"'); + while ($plu = mysql_fetch_array($spu)) { + $users .= $u->microLogin($plu['id'], 1) . ','; + } + // + if ($users == '') { + $users = ' !'; + } else { + $users = rtrim($users, ','); + } + // + $html .= $i . '. ' . date('H:i', $pl['time']) . ' '; + $html .= ' '; + $html .= ' (' . $users . ') (' . $pl['min_lvl_1'] . '-' . $pl['max_lvl_1'] . ') : '; + if ($pl['noinc'] > 0) { + $html .= ''; + } + if ($pl['fastfight'] > 0) { + $html .= ''; + } + if ($pl['arand'] > 0) { + $html .= ''; + } + $html .= ' ' . $u->timeOut( + $pl['time'] + $pl['time_start'] - time() + ) . ', ' . $u->timeOut($pl['timeout']) . ''; + if ($pl['priz'] > 0) { + $html .= '( )
    '; + } + $html .= '
    '; } -if( $html == '' ) { - $html = '
    ( )
    '; +if ($html == '') { + $html = '
    ( )
    '; } -echo $html; $html = ''; +echo $html; +$html = ''; ?>

    -microLogin($plu['id'],1).','; - } - // - if( count($usersa) > 0 ) { - $j = 0; - while( $j < count($userst) ) { - if( $users != '' ) { - $users .= '    '; - } - $users .= $usersa[$userst[$j]]; - $users = rtrim($users,','); - $j++; - } - // - $i++; - // - - $html .= $i . '. '.date('d.m.Y H:i',$pl['time_start']).' '; - $html .= ' '; - $html .= ' ('.$users.') : '; - if( $pl['noinc'] > 0 ) { - $html .= ''; - } - if( $pl['fastfight'] > 0 ) { - $html .= ''; - } - if( $pl['arand'] > 0 ) { - $html .= ''; - } - $html .= ', '.$u->timeOut($pl['timeout']).''; - if( $pl['priz'] > 0 ) { - $html .= '( )
    '; - } - $html .= ' »» '; - $html .= '
    '; - } - // +while ($pl = mysql_fetch_array($sp)) { + // + $users = ''; + $usersa = []; + $userst = []; + // + $spu = mysql_query( + 'SELECT `a`.`id`,`b`.`team` FROM `users` AS `a` LEFT JOIN `stats` AS `b` ON `a`.`id` = `b`.`id` WHERE `a`.`battle` = "' . $pl['id'] . '"' + ); + while ($plu = mysql_fetch_array($spu)) { + if (!isset($usersa[$plu['team']])) { + $userst[] = $plu['team']; + } + $usersa[$plu['team']] .= $u->microLogin($plu['id'], 1) . ','; + } + // + if (count($usersa) > 0) { + $j = 0; + while ($j < count($userst)) { + if ($users != '') { + $users .= '    '; + } + $users .= $usersa[$userst[$j]]; + $users = rtrim($users, ','); + $j++; + } + // + $i++; + // + + $html .= $i . '. ' . date('d.m.Y H:i', $pl['time_start']) . ' '; + $html .= ' '; + $html .= ' (' . $users . ') : '; + if ($pl['noinc'] > 0) { + $html .= ''; + } + if ($pl['fastfight'] > 0) { + $html .= ''; + } + if ($pl['arand'] > 0) { + $html .= ''; + } + $html .= ', ' . $u->timeOut($pl['timeout']) . ''; + if ($pl['priz'] > 0) { + $html .= '( )
    '; + } + $html .= ' »» '; + $html .= '
    '; + } + // } -if( $html == '' ) { - $html = '
    ( )
    '; +if ($html == '') { + $html = '
    ( )
    '; } -echo $html; $html = ''; +echo $html; +$html = ''; ?>

    -city_name[$pl['city']].'" src="https://img.new-combats.com/i/city_ico/'.$pl['city'].'.gif">'; - // - $html .= ' ['.$pl['level'].']'; - if( $pl['status'] == 0 ) { - // - $html .= ' " " : '.date('d.m.Y H:i',$pl['time_start']).' ( '.$u->timeOut($pl['time_start']-time()).') : '.round(($pl['money']/100*85),2).' . : '.$pl['users'].''; - }else{ - // - $users = ''; - $spu = mysql_query('SELECT `id` FROM `users` WHERE `inTurnir` = "'.$pl['id'].'"'); - while( $plu = mysql_fetch_array($spu) ) { - $users .= $u->microLogin($plu['id'],1). ','; - } - $users = rtrim($users,','); - $html .= ' .'; - $html .= ' : '.$users.', : »»'; - } - // - $html .= '
    '; - // +while ($pl = mysql_fetch_array($sp)) { + $i++; + // + $html .= $i . '. '; + // + $html .= ' [' . $pl['level'] . ']'; + if ($pl['status'] == 0) { + // + $html .= ' " " : ' . date( + 'd.m.Y H:i', $pl['time_start'] + ) . ' ( ' . $u->timeOut( + $pl['time_start'] - time() + ) . ') : ' . round( + ($pl['money'] / 100 * 85), 2 + ) . ' . : ' . $pl['users'] . ''; + } else { + // + $users = ''; + $spu = mysql_query('SELECT `id` FROM `users` WHERE `inTurnir` = "' . $pl['id'] . '"'); + while ($plu = mysql_fetch_array($spu)) { + $users .= $u->microLogin($plu['id'], 1) . ','; + } + $users = rtrim($users, ','); + $html .= ' .'; + $html .= ' : ' . $users . ', : »»'; + } + // + $html .= '
    '; + // } -if( $html == '' ) { - $html = '
    ( )
    '; +if ($html == '') { + $html = '
    ( )
    '; } -echo $html; $html = ''; +echo $html; +$html = ''; ?>

    -( )'; +( )'; } -echo $html; $html = ''; +echo $html; +$html = ''; ?>

    -( )'; +( )'; } -echo $html; $html = ''; +echo $html; +$html = ''; ?> -

    v2.1 © , www.new-combats.com    
    -

    +
    +
    + v2.1 © , www.new-combats.com    
    +

    -
    - - - - - -
    + diff --git a/html/library.php b/html/library.php index 9e625ee5..ca50a3a9 100644 --- a/html/library.php +++ b/html/library.php @@ -49,7 +49,7 @@ if( $url[2] == 'upload' && $u->info['admin'] > 0 ) { }else{ if( isset($_FILES['filename']) && $u->info['admin'] > 0 ) { - include('class.upload.php'); + require_once('class.upload.php'); $handle = new upload($_FILES['filename']); $count = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `uid` = "'.$u->info['id'].'" AND `time` > '.(time()-60).' LIMIT 1')); if( $count > 3 && $u->info['admin'] == 0 ) { diff --git a/index.php b/index.php index 90010a9d..9ecd5369 100644 --- a/index.php +++ b/index.php @@ -1,218 +1,237 @@ -'.date('d.m.Y H:i:s',(int)$_GET['time']); - die(); +if (isset($_GET['time'])) { + echo time() . '
    ' . date('d.m.Y H:i:s', (int)$_GET['time']); + die(); } ?> - - - - - - - - - - - - - - -
             new-combats.com -
    -

    -
    -

    - -

    - -

    -        -        -        -        -        -        -
    -
    -
    -

    - + + + Новый «Бойцовский Клуб» - легендарная браузерная онлайн игра + + + + + + + + + +
    Старый бойцовский клуб играть и общаться вместе с нами new-combats.com + +

    +
    +

    +

    + +

    + Новости проекта        + Восстановление пароля        + Регистрация в игре        + Форум проекта        + Рейтинг персонажей        + Рейтинг кланов        +
    +
    +
    +

    Новый Бойцовский Клуб

    + -

    , . combats.com , BBMMORPG. , . - - combats.com 2006-2009 . . , , , . , . +

    Новый Бойцовский Клуб — это проект, предоставляющий возможность окунуться в игровой мир старого «Бойцовского Клуба». Бойцовский клуб «combats.com» — это бесплатная + браузерная игра, которая является одним из родоначальников жанра BBMMORPG. В «Бойцовский клуб играть» Вы сможете лишь имея доступ к интернету, используя любой веб браузер. - , , , . , . + За основу взята старая версия игры «combats.com» за 2006-2009 года. Мы постарались сохранить все лучшие традиции старой версии бойцовского клуба и добавили массу новых обновлений и нововведений. Как и в старой доброй + игре «Бойцовский Клуб», Вас ждёт масса эпических сражений между игроками, кланами, склонностями. В зависимости от Вашего выбора персонаж будет иметь определенную склонность, которые отлично помогут усилить вашего + персонажа. - , , , , . , , - , . + В процессе игры Вас ждет масса интересного общения в чате с другими игроками, более того, Вы можете использовать голосовые сообщения, чтобы облегчить процесс коммуникации с игроками и вникания в проект «Старого Бойцовского Клуба». В + зависимости от игровых предпочтений каждый игрок сможет вступать в различные игровые кланы или же создать свой собственный, став главой клана. - . - -
    -

    - - -

    oldbk. . ( , , ) ( , , , , ). , , , . . + Для каждого клана и каждого персонажа в отдельности предусмотрен динамический игровой рейтинг игроков и кланов, а так же ежедневные игровые события, которые не оставят игроков со скукой на едине, клановых сражений, проведения + хаотических поединков. Ну а если у Вас возникнут трудности с игрой, служба поддержки всегда готова Вам помочь и ответить на ваши игровые вопросы, ну а если и это не поможет - гайды на форуме проекта всегда прийдут на + помощь и подскажут Вам, как правильно прокачивать вашего персонажа. - , , . . , . , . + Желаем Вам побед и преданных союзников в проекте «Нового Бойцовского Клуба». - combats.com. . +
    +

    Игровой мир «Бойцовский клуб»

    + - , , , , , , , , , , . - -
    -

    .

    - - -

    - , 2004 2009 . combats.com 2, MMORPG. , , . +

    Игровой процесс сохранен в жанре старого бойцовского клуба «oldbk». Ваш персонаж создается в мире Новый Бойцовский Клуб. При создании персонажа Вас ждет выбор пути Одного из + четырех магов ( Воздуха, Воды, Огня или Земли ) или же Одного из пяти воинов ( Критовик, Уворот, Танк, Топор, Критоуворот ). В самой игре Вас ждет масса локаций, где Вы сможете обмениваться боевым опытом, повышать + мастерство, прокачивать своего героя. Если возникнут какие — либо вопросы на помощь всегда придут подсказки в общем чате или статьи в новостях проекта. - , . , . . + Основой игрового процесса являются хаотические поединки, а так же обычные физические поединки, которые вы осуществляете с другими персонажами. Каждый бой заключается в обмене ударами с противником с использованием приемов. Чем больше + поединков Вы проводите, тем сильнее становится персонаж. Каждые выходные, мы увеличиваем награду за проведение поединков для наших любимых игроков. - , >. -
    -

    , combats.com , old-combats.com, likebk.com


    - -
    - - + Стиль боя сохранен также в традициях старого бойцовского клуба «combats.com». Тактику и развитие персонажа Вы выбираете по своему желанию. + + Также Вас ждут захватывающие походы в пещеры, а именно Катакомбы, Бездная, Пещера Мглы, Потерянный Вход, Пещера Тысячи Проклятий, Тропа Инвизиции, Гора Легиона, Туманные Низины, Грибница или Канализация, ну а в дополнение у Вас будет + возможность проверить своего бойца в Изломе Хаоса. + +
    +

    Социальная составляющая игры «Бойцовский клуб».

    + + +

    Новый Бойцовский клуб - это игра, которая покорила сердца многих пользователей рунета в 2004 — 2009 годах. «combats.com» версии 2, отличался особым жанром игры на тот момент — MMORPG. + Одной из основных особенностей игры «Бойцовский Клуб», помимо захватывающих боев, также являлась социальная составляющая. + + В процессе игры каждый игрок имел возможность общаться с другими игроками в общем, клановом или приватном чате. Обмениваться опытом, делиться важной информацией или просто весело проводить время. При отсутствии социальных сетей в тот + момент — это было немаловажным фактором для выбора подходящих проектов «Браузерной Игры». + + В проекте Новый Бойцовский Клуб также сохранен стиль общения «Старого Бойцовского Клуба», а так же добавлена уникальная в своем роде функция: Голосовые Сообщения. +
    +

    Проект Старого Бойцовского клуба, который использует как основание игру «combats.com» , «old-combats.com», «likebk.com» и многие другие проекты по типу «Бойцовский Клуб»


    + +
    + + + + + + +
    + + + Рейтинг Ролевых Ресурсов - RPG TOP + + + + + + +
    + + - -
    - - -   - RPG TOP - - - - - - -
    -
    -     -     -     -     -     -
    - - - - - + + diff --git a/index2.php b/index2.php deleted file mode 100644 index cada02b0..00000000 --- a/index2.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/inf.php b/inf.php index 4ee7f69f..55118618 100644 --- a/inf.php +++ b/inf.php @@ -1,150 +1,195 @@ 1 && $inf['info_delete'] < time() ) { - $inf['info_delete'] = 0; - mysql_query('UPDATE `users` SET `info_delete` = 0 WHERE `id` = "'.$inf['id'].'" LIMIT 1'); - } - } +if ($uplogin == 'delete' || $utf8Login == 'delete' || $utf8Login2 == 'delete') { + +} else { + $inf = mysql_fetch_array( + mysql_query( + 'SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id`=`st`.`id`) WHERE ((`u`.`login`="' . mysql_real_escape_string( + $_GET['login'] + ) . '" OR `u`.`login`="' . mysql_real_escape_string( + $utf8Login2 + ) . '" OR `u`.`login`="' . mysql_real_escape_string( + $utf8Login + ) . '" OR `u`.`login`="' . mysql_real_escape_string($uplogin) . '") ) LIMIT 1' + ) + ); + if (!isset($inf['id'])) { + $inf = mysql_fetch_array( + mysql_query( + 'SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id`=`st`.`id`) WHERE (`u`.`id`="' . mysql_real_escape_string( + $_GET['id'] + ) . '" OR `u`.`id`="' . mysql_real_escape_string($uplogin) . '") LIMIT 1' + ) + ); + } + if ($inf['login'] == 'delete' || $inf['login'] == 'DELETE') { + unset($inf); + } else { + if ($inf['info_delete'] > 1 && $inf['info_delete'] < time()) { + $inf['info_delete'] = 0; + mysql_query('UPDATE `users` SET `info_delete` = 0 WHERE `id` = "' . $inf['id'] . '" LIMIT 1'); + } + } } -if(!isset($inf['id'])) -{ - unset($inf); -}else{ +if (!isset($inf['id'])) { + unset($inf); +} else { - 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']info['admin']>0) - { - if(isset($_GET['wipe']) && $u->newAct($_GET['sd4'])==true) - { - $upd = mysql_query('UPDATE `stats` SET `wipe` = "1" WHERE `id` = "'.$inf['id'].'" LIMIT 1'); - if($upd) - { - $uer = '
    '; - }else{ - $uer = ' ...
    '; - } - } - } - if(($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4) || $u->info['admin']>0) - { - if(isset($_GET['molchMax']) && $u->newAct($_GET['sd4'])==true) - { - $upd = mysql_query('UPDATE `users` SET `molch3` = "'.$inf['molch1'].'" WHERE `id` = "'.$inf['id'].'" LIMIT 1'); - if($upd) - { - $uer = ' ...
    '; - }else{ - $uer = '...
    '; - } - } - } + 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; + mysql_query('UPDATE `users` SET `align` = "0",`haos` = "0" WHERE `id` = "' . $inf['id'] . '" LIMIT 1'); + } + } + if ($u->info['admin'] > 0) { + if (isset($_GET['wipe']) && $u->newAct($_GET['sd4']) == true) { + $upd = mysql_query('UPDATE `stats` SET `wipe` = "1" WHERE `id` = "' . $inf['id'] . '" LIMIT 1'); + if ($upd) { + $uer = '
    '; + } else { + $uer = ' ...
    '; + } + } + } + if (($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4) || $u->info['admin'] > 0) { + if (isset($_GET['molchMax']) && $u->newAct($_GET['sd4']) == true) { + $upd = mysql_query( + 'UPDATE `users` SET `molch3` = "' . $inf['molch1'] . '" WHERE `id` = "' . $inf['id'] . '" LIMIT 1' + ); + if ($upd) { + $uer = ' ...
    '; + } else { + $uer = '...
    '; + } + } + } } -if( $inf['room'] == 303 && $u->info['admin'] == 0 ) { - unset($inf); +if ($inf['room'] == 303 && $u->info['admin'] == 0) { + unset($inf); } - -if(!isset($inf['id'])) -{ - die('. .'); - die(' + +if (!isset($inf['id'])) { + die('. .'); + die( + ' @@ -152,2112 +197,2537 @@ if(!isset($inf['id'])) :
       ...


    -

    © '.$c['title'].'

    - '.$c['counters'].' - '); +

    © ' . $c['title'] . '

    + ' . $c['counters'] . ' + ' + ); } -if($u->info['align'] > 1 && $u->info['align'] < 2) { - -}elseif($u->info['align'] > 3 && $u->info['align'] < 4) { - -}elseif($inf['redirect'] != '0' && $u->info['admin'] == 0 && $u->info['id'] != $inf['id']) { - header('location: '.$inf['redirect']); - die(); +if ($u->info['align'] > 1 && $u->info['align'] < 2) { + +} elseif ($u->info['align'] > 3 && $u->info['align'] < 4) { + +} elseif ($inf['redirect'] != '0' && $u->info['admin'] == 0 && $u->info['id'] != $inf['id']) { + header('location: ' . $inf['redirect']); + die(); } -function zodiak($d,$m,$y) +function zodiak($d, $m, $y) { -$dr = $d; -switch($m) -{ - case '03': - $zodiac_id = 12; - if($dr > 20) $zodiac_id = 1; - break; - case '04': - $zodiac_id = 1; - if($dr > 19) $zodiac_id = 2; - break; - case '05': - $zodiac_id = 2; - if($dr > 20) $zodiac_id = 3; - break; - case '06': - $zodiac_id = 3; - if($dr > 21) $zodiac_id = 4; - break; - case '07': - $zodiac_id = 4; - if($dr > 22) $zodiac_id = 5; - break; - case '08': - $zodiac_id = 5; - if($dr > 22) $zodiac_id = 6; - break; - case '09': - $zodiac_id = 6; - if($dr > 22) $zodiac_id = 7; - break; - case '10': - $zodiac_id = 7; - if($dr > 22) $zodiac_id = 8; - break; - case '11': - $zodiac_id = 8; - if($dr > 21) $zodiac_id = 9; - break; - case '12': - $zodiac_id = 9; - if($dr > 21) $zodiac_id = 10; - break; - case '01': - $zodiac_id = 10; - if($dr > 19) $zodiac_id = 11; - break; - case '02': - $zodiac_id = 11; - if($dr > 18) $zodiac_id = 12; - break; - } - return $zodiac_id; + $dr = $d; + switch ($m) { + case '03': + $zodiac_id = 12; + if ($dr > 20) { + $zodiac_id = 1; + } + break; + case '04': + $zodiac_id = 1; + if ($dr > 19) { + $zodiac_id = 2; + } + break; + case '05': + $zodiac_id = 2; + if ($dr > 20) { + $zodiac_id = 3; + } + break; + case '06': + $zodiac_id = 3; + if ($dr > 21) { + $zodiac_id = 4; + } + break; + case '07': + $zodiac_id = 4; + if ($dr > 22) { + $zodiac_id = 5; + } + break; + case '08': + $zodiac_id = 5; + if ($dr > 22) { + $zodiac_id = 6; + } + break; + case '09': + $zodiac_id = 6; + if ($dr > 22) { + $zodiac_id = 7; + } + break; + case '10': + $zodiac_id = 7; + if ($dr > 22) { + $zodiac_id = 8; + } + break; + case '11': + $zodiac_id = 8; + if ($dr > 21) { + $zodiac_id = 9; + } + break; + case '12': + $zodiac_id = 9; + if ($dr > 21) { + $zodiac_id = 10; + } + break; + case '01': + $zodiac_id = 10; + if ($dr > 19) { + $zodiac_id = 11; + } + break; + case '02': + $zodiac_id = 11; + if ($dr > 18) { + $zodiac_id = 12; + } + break; + } + return $zodiac_id; } + $id_zodiak = null; -$bday = explode('.',$inf['bithday']); -if(isset($bday[0],$bday[1],$bday[2])) -{ -$id_zodiak = zodiak($bday[0],$bday[1],$bday[2]); +$bday = explode('.', $inf['bithday']); +if (isset($bday[0], $bday[1], $bday[2])) { + $id_zodiak = zodiak($bday[0], $bday[1], $bday[2]); } -if($id_zodiak==null) -{ - $id_zodiak = 1; +if ($id_zodiak == null) { + $id_zodiak = 1; } -$name_zodiak = array(1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>'',8=>'',9=>'',10=>'',11=>'',12=>''); +$name_zodiak = [1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '', 7 => '', 8 => '', 9 => '', 10 => '', 11 => '', 12 => '']; $name_zodiak = $name_zodiak[$id_zodiak]; function statInfo($s) { - global $st,$st2; - $st[$s] = 0+$st[$s]; - $st2[$s] = 0+$st2[$s]; - if($st[$s]!=$st2[$s]) - { - $s1 = '+'; - if($st2[$s]>$st[$s]) - { - $s1 = '-'; - } - -$cl = array( --2=>"#550000", --1=>"#990000", -0 =>"#000000", -33=>"#004000", -34=>"#006000", -35=>"#006100", -36=>"#006200", -37=>"#006300", -38=>"#006400", -39=>"#006500", -40=>"#006600", -41=>"#006700", -42=>"#006800", -43=>"#006900", -44=>"#006A00", -45=>"#006B00", -46=>"#006C00", -47=>"#006D00", -48=>"#006E00", -49=>"#006F00", -50=>"#007000", -51=>"#007100", -52=>"#007100", -53=>"#007200", -54=>"#007300", -55=>"#007400", -56=>"#007500", -57=>"#007600", -58=>"#007700", -59=>"#007800", -60=>"#007900", -61=>"#007A00", -62=>"#007B00", -63=>"#007C00", -64=>"#007D00", -65=>"#007E00", -66=>"#007F00", -67=>"#008000", -68=>"#008100", -69=>"#008200", -70=>"#008300", -71=>"#008400", -72=>"#008500", -73=>"#008600", -74=>"#008700", -75=>"#008700", -76=>"#008800", -77=>"#008900", -78=>"#008A00", -79=>"#008B00", -80=>"#008C00", -81=>"#008D00", -82=>"#008E00", -83=>"#008F00", -84=>"#009000", -85=>"#009100", -86=>"#009200", -87=>"#009300", -88=>"#009400", -89=>"#009500", -90=>"#009600", -91=>"#009700", -92=>"#009800", -93=>"#009900", -94=>"#009A00", -95=>"#009B00", -96=>"#009C00", -97=>"#009D00", -98=>"#009E00", -99=>"#009F00", -100=>"#00A000" -); - - - //$cl = array(0=>'#003C00',1=>'green',2=>'#0DAC0D',3=>'#752415',4=>''); - $si = 4; - if($s1=='-') - { - $si = 0; - } - $t = $st[$s]; - $j = $st[$s]-$st2[$s]; - $t = $t-$j; - if($j>0) - { - if($t==0) - { - $t = 1; - } - if($t==0) - { - $t = 1; - } - $d = $j*100/$t; - if($d<0 && $t+$j>=0) - { - $d = 100; - } - if($d < 33) - { - $si = 0; - }elseif($d > 100) - { - $si = 100; - } - }elseif($j<0) - { - $si = 3; - } - - if($st[$s] <- 0) { - $si = -1; - }elseif($st[$s] <= round($st2[$s])) { - $si = -2; - } - echo ''.$st[$s].' ('.$st2[$s].' '.$s1.' '.abs($st[$s]-$st2[$s]).')'; - }else{ - echo ''.$st[$s].''; - } + global $st, $st2; + $st[$s] = 0 + $st[$s]; + $st2[$s] = 0 + $st2[$s]; + if ($st[$s] != $st2[$s]) { + $s1 = '+'; + if ($st2[$s] > $st[$s]) { + $s1 = '-'; + } + + $cl = [ + -2 => "#550000", + -1 => "#990000", + 0 => "#000000", + 33 => "#004000", + 34 => "#006000", + 35 => "#006100", + 36 => "#006200", + 37 => "#006300", + 38 => "#006400", + 39 => "#006500", + 40 => "#006600", + 41 => "#006700", + 42 => "#006800", + 43 => "#006900", + 44 => "#006A00", + 45 => "#006B00", + 46 => "#006C00", + 47 => "#006D00", + 48 => "#006E00", + 49 => "#006F00", + 50 => "#007000", + 51 => "#007100", + 52 => "#007100", + 53 => "#007200", + 54 => "#007300", + 55 => "#007400", + 56 => "#007500", + 57 => "#007600", + 58 => "#007700", + 59 => "#007800", + 60 => "#007900", + 61 => "#007A00", + 62 => "#007B00", + 63 => "#007C00", + 64 => "#007D00", + 65 => "#007E00", + 66 => "#007F00", + 67 => "#008000", + 68 => "#008100", + 69 => "#008200", + 70 => "#008300", + 71 => "#008400", + 72 => "#008500", + 73 => "#008600", + 74 => "#008700", + 75 => "#008700", + 76 => "#008800", + 77 => "#008900", + 78 => "#008A00", + 79 => "#008B00", + 80 => "#008C00", + 81 => "#008D00", + 82 => "#008E00", + 83 => "#008F00", + 84 => "#009000", + 85 => "#009100", + 86 => "#009200", + 87 => "#009300", + 88 => "#009400", + 89 => "#009500", + 90 => "#009600", + 91 => "#009700", + 92 => "#009800", + 93 => "#009900", + 94 => "#009A00", + 95 => "#009B00", + 96 => "#009C00", + 97 => "#009D00", + 98 => "#009E00", + 99 => "#009F00", + 100 => "#00A000", + ]; + + + //$cl = array(0=>'#003C00',1=>'green',2=>'#0DAC0D',3=>'#752415',4=>''); + $si = 4; + if ($s1 == '-') { + $si = 0; + } + $t = $st[$s]; + $j = $st[$s] - $st2[$s]; + $t = $t - $j; + if ($j > 0) { + if ($t == 0) { + $t = 1; + } + if ($t == 0) { + $t = 1; + } + $d = $j * 100 / $t; + if ($d < 0 && $t + $j >= 0) { + $d = 100; + } + if ($d < 33) { + $si = 0; + } elseif ($d > 100) { + $si = 100; + } + } elseif ($j < 0) { + $si = 3; + } + + if ($st[$s] < -0) { + $si = -1; + } elseif ($st[$s] <= round($st2[$s])) { + $si = -2; + } + echo '' . $st[$s] . ' (' . $st2[$s] . ' ' . $s1 . ' ' . abs( + $st[$s] - $st2[$s] + ) . ')'; + } else { + echo '' . $st[$s] . ''; + } } -$room = mysql_fetch_array(mysql_query('SELECT * FROM `room` WHERE `id`="'.$inf['room'].'" LIMIT 1')); +$room = mysql_fetch_array(mysql_query('SELECT * FROM `room` WHERE `id`="' . $inf['room'] . '" LIMIT 1')); -if($inf['clan']>0) -{ - $pc = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="'.$inf['clan'].'" LIMIT 1')); +if ($inf['clan'] > 0) { + $pc = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="' . $inf['clan'] . '" LIMIT 1')); } $nopal = false; -if( $u->info['align'] < $inf['align'] && $inf['align'] > 1 && $inf['align'] < 2 && $u->info['admin'] == 0 ) { - $nopal = true; -}elseif( $u->info['admin'] == 0 && $inf['admin'] > 0 ) { - $nopal = true; +if ($u->info['align'] < $inf['align'] && $inf['align'] > 1 && $inf['align'] < 2 && $u->info['admin'] == 0) { + $nopal = true; +} elseif ($u->info['admin'] == 0 && $inf['admin'] > 0) { + $nopal = true; } -if( $u->info['admin'] == 0 ) { - $nopal = true; +if ($u->info['admin'] == 0) { + $nopal = true; } -if( $inf['inTurnir'] > 0 && ($u->info['inTurnir'] == $inf['inTurnir'] || $u->info['admin'] > 0) ) { - $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "'.$inf['inTurnir'].'" LIMIT 1')); - if( isset($bs['id']) && ( $bs['users'] <= 2 || $bs['type_btl'] == 1 ) ) { - $bs_rm = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `bs_map` WHERE `mid` = "'.$bs['type_map'].'" AND `x` = "'.$inf['x'].'" AND `y` = "'.$inf['y'].'" LIMIT 1')); - if( isset($bs_rm['id']) ) { - $room['name'] .= ' - '.$bs_rm['name']; - } - } +if ($inf['inTurnir'] > 0 && ($u->info['inTurnir'] == $inf['inTurnir'] || $u->info['admin'] > 0)) { + $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "' . $inf['inTurnir'] . '" LIMIT 1')); + if (isset($bs['id']) && ($bs['users'] <= 2 || $bs['type_btl'] == 1)) { + $bs_rm = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`name` FROM `bs_map` WHERE `mid` = "' . $bs['type_map'] . '" AND `x` = "' . $inf['x'] . '" AND `y` = "' . $inf['y'] . '" LIMIT 1' + ) + ); + if (isset($bs_rm['id'])) { + $room['name'] .= ' - ' . $bs_rm['name']; + } + } } ?> - - <? echo $inf['login']; ?> - - - - - - - - - - + .pg_btn1 { + background-image: url(https://img.new-combats.com/pg_btn_left.png); + width: 27px; + height: 78px; + cursor: pointer; + display: block; + } + + .pg_btn1:hover { + background-position: -27px; + cursor: pointer; + } + + .pg_btn1:active { + background-position: -55px; + cursor: pointer; + } + + .pg_btn2 { + background-image: url(https://img.new-combats.com/pg_btn_right.png); + background-position: -54px; + width: 27px; + height: 78px; + cursor: pointer; + display: block; + } + + .pg_btn2:hover { + background-position: -27px; + cursor: pointer; + } + + .pg_btn2:active { + background-position: 1px; + cursor: pointer; + } + + progress { + -webkit-appearance: none; + appearance: none; + } + + .prog0 { + width: 10em; + height: 1em; + } + + .prog0::-webkit-progress-bar { + background-color: #eee; + border-radius: 2px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset; + } + + .prog0[value]::-webkit-progress-value { + background-image: -webkit-linear-gradient(-45deg, + transparent 33%, rgba(0, 0, 0, .1) 33%, + rgba(0, 0, 0, .1) 66%, transparent 66%), + -webkit-linear-gradient(top, + rgba(255, 255, 255, .25), + rgba(0, 0, 0, .25)), + -webkit-linear-gradient(left, #09c, #7FFFD4); + + border-radius: 2px; + background-size: 35px 20px, 100% 100%, 100% 100%; + } + + .prog1 { + width: 10em; + height: 1em; + } + + .prog1::-webkit-progress-bar { + background-color: #eee; + border-radius: 2px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset; + } + + .prog1[value]::-webkit-progress-value { + background-image: -webkit-linear-gradient(-45deg, + transparent 33%, rgba(0, 0, 0, .1) 33%, + rgba(0, 0, 0, .1) 66%, transparent 66%), + -webkit-linear-gradient(top, + rgba(255, 255, 255, .25), + rgba(0, 0, 0, .25)), + -webkit-linear-gradient(left, #7FFFD4, #F4A460); + + border-radius: 2px; + background-size: 35px 20px, 100% 100%, 100% 100%; + } + + .prog2 { + width: 10em; + height: 1em; + } + + .prog2::-webkit-progress-bar { + background-color: #eee; + border-radius: 2px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset; + } + + .prog2[value]::-webkit-progress-value { + background-image: -webkit-linear-gradient(-45deg, + transparent 33%, rgba(0, 0, 0, .1) 33%, + rgba(0, 0, 0, .1) 66%, transparent 66%), + -webkit-linear-gradient(top, + rgba(255, 255, 255, .25), + rgba(0, 0, 0, .25)), + -webkit-linear-gradient(left, #F4A460, #FFC0CB); + + border-radius: 2px; + background-size: 35px 20px, 100% 100%, 100% 100%; + } + + .prog3 { + width: 10em; + height: 1em; + } + + .prog3::-webkit-progress-bar { + background-color: #eee; + border-radius: 2px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset; + } + + .prog3[value]::-webkit-progress-value { + background-image: -webkit-linear-gradient(-45deg, + transparent 33%, rgba(0, 0, 0, .1) 33%, + rgba(0, 0, 0, .1) 66%, transparent 66%), + -webkit-linear-gradient(top, + rgba(255, 255, 255, .25), + rgba(0, 0, 0, .25)), + -webkit-linear-gradient(left, #FFC0CB, #FFD700); + + border-radius: 2px; + background-size: 35px 20px, 100% 100%, 100% 100%; + } + + .prog4 { + width: 10em; + height: 1em; + } + + .prog4::-webkit-progress-bar { + background-color: #eee; + border-radius: 2px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset; + } + + .prog4[value]::-webkit-progress-value { + background-image: -webkit-linear-gradient(-45deg, + transparent 33%, rgba(0, 0, 0, .1) 33%, + rgba(0, 0, 0, .1) 66%, transparent 66%), + -webkit-linear-gradient(top, + rgba(255, 255, 255, .25), + rgba(0, 0, 0, .25)), + -webkit-linear-gradient(left, #FFD700, #FF0000); + + border-radius: 2px; + background-size: 35px 20px, 100% 100%, 100% 100%; + } + + .prog5 { + width: 10em; + height: 1em; + } + + .prog5::-webkit-progress-bar { + background-color: #eee; + border-radius: 2px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset; + } + + .prog5[value]::-webkit-progress-value { + background-image: -webkit-linear-gradient(-45deg, + transparent 33%, rgba(0, 0, 0, .1) 33%, + rgba(0, 0, 0, .1) 66%, transparent 66%), + -webkit-linear-gradient(top, + rgba(255, 255, 255, .25), + rgba(0, 0, 0, .25)), + -webkit-linear-gradient(left, #FF0000, #FF0000); + + border-radius: 2px; + background-size: 35px 20px, 100% 100%, 100% 100%; + } + + .dvfirs { + overflow: hidden; + white-space: nowrap; + float: left; + margin-left: 20px; + width: 350px; + text-align: center; + } + + .dvsec { + overflow: hidden; + white-space: nowrap; + float: left; + width: 140px; + } + + .dvtre { + overflow: hidden; + white-space: nowrap; + float: left; + width: 60px; + } + + - + -'.$uer.'

    '; } ?> +' . $uer . '

    '; +} ?> - - -
    - - - + '; + } + echo '

    -
    getStats($inf['id'],1,0,true); $st2 = $st[1]; $st = $st[0]; - - $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] = '








    ,
    .






    '; } if($us!=false){ echo $us[0]; }else{ echo 'information is lost.'; } ?>
    - -
    - 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 -); +
    + + + - '; - } - echo '

    +
    getStats($inf['id'], 1, 0, true); + $st2 = $st[1]; + $st = $st[0]; -?> - - 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 '

    '; - } - } - }elseif( $inf['room'] != 303 ) { - echo '
    '; - - - if($inf['online']>time()-520 && $inf['banned']==0 && $inf['invis']!=1 && $inf['invis'] < time()) - { - echo ' .
    "'.$room['name'].'"'; - }else{ - if($inf['admin']==0 || $inf['admin']==2) - { - if($inf['online']==0) - { - $inf['online'] = $inf['timeREG']; - } - echo ' '; - if(date('Y',$inf['online']) == date('Y')) { - echo ', :
    '.date('d.m.Y H:i',$inf['online']).''; - $out = ''; - $time_still = time()-$inf['online']; - $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.' .'; - } - echo '
    ('.$out.' )'; - } - }elseif($inf['admin']>0) - { - echo ' .'; - } - } - if($inf['inUser']>0 AND $inf['id']!=12059 ) - { - echo '
    '; - } - 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 '
    '; - } - } - echo '
    '; - }else{ - if( $inf['res_x']-time() > 0 ) { - echo '
    '.($u->timeOut(($inf['res_x']-time()))).'
    '; - }else{ - echo '
    ...
    '; - } - } - // - if($u->info['admin'] > 0) { - - if(isset($_GET['cancel_eff'])) { - mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.mysql_real_escape_string((int)$_GET['cancel_eff']).'" AND `uid` = "'.$inf['id'].'" LIMIT 1'); - die(''); - } - - function eff_adm($pl) { - global $u; - $r = ''; - 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']).''; - } - $r .= ''; - return $r; - } - - $eff_adm = ''; - $sp = mysql_query('SELECT `id_eff`,`uid`,`id`,`name`,`img2`,`v1`,`v2`,`timeUse` FROM `eff_users` WHERE `uid` = "'.$inf['id'].'" AND `delete` = "0"'); - while($pl = mysql_fetch_array($sp)) { - $eff_adm .= eff_adm($pl); - } - if($eff_adm != '') { - echo '
    :
    '.$eff_adm.'
    '; - } - } - if($u->info['admin'] > 0) { - ?> -
    - - -
    -
    -
    - -
    - + + +
    info['admin'] > 0 ) { - $nodell = mysql_fetch_array(mysql_query('SELECT `id`,`inUser` FROM `users` WHERE `login` = "'.$inf['login'].'" ORDER BY `id` ASC LIMIT 1')); - $sp = mysql_query('SELECT `id`,`level`,`inTurnir`,`room`,`battle`,`inTurnirnew`,`inUser` FROM `users` WHERE `login` = "'.$inf['login'].'" AND `id` != "'.$inf['id'].'"'); - while( $pl = mysql_fetch_array($sp)) { - if( isset($_GET['del_copy']) && $_GET['del_copy'] == $pl['id'] ) { - if( $nodell['inUser'] != $pl['id'] && $pl['id'] != $nodell['id'] ) { - mysql_query('UPDATE `users` SET `login` = "DELETE" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - }else{ - $nolog .= '
    '.$u->microLogin($pl['id'],1); - if( $nodell['inUser'] != $pl['id'] && $pl['id'] != $nodell['id'] ) { - $nolog .= ' ( )'; - } - if( $pl['id'] == $nodell['id'] ) { - $nolog .= ' ( )'; - } - $nolog .= '
    '; - } - } - if( $nolog != '' ) { - $nolog = ' :'.$nolog.''; - echo $nolog; - } - - } - ?>
    :
    - :
    - :
    - :
    - 3 || $st['s5']!=0){ ?>:
    - 6 || $st['s6']!=0){ ?>:
    - 9 || $st['s7']!=0){ ?>:
    - 11 || $st['s8']!=0){ ?>:
    - 14 || $st['s9']!=0){ ?> :
    - 19 || $st['s10']!=0){ ?>:
    - 0 ) { ?> - :
    - - :
    -
    -
    -
    - info['admin'] > 0 ) { echo ':'; }else{ echo ':'; } ?>
    - - : '.number_format($inf['win'], 0, ",", " ").''; } ?>
    - :
    - :
    - - - '; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '
    '; } ?> - '; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '
    '; } ?> - 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] = '








    ,
    .






    '; + } + if ($us != false) { + echo $us[0]; + } else { + echo 'information is lost.'; + } ?>
    + +
    +
    + + 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, + ]; - if($inf['clan']>0) - { - $pc = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="'.$inf['clan'].'" LIMIT 1')); - if(isset($pc['id'])) - { - $pc['img'] = $pc['name_mini'].'.gif'; - if($inf['clan_prava']=='glava') - { - $inf['mod_zvanie'] = '- '; - }elseif($inf['mod_zvanie']!='') - { - $inf['mod_zvanie'] = '- '.htmlspecialchars($inf['mod_zvanie'],NULL,'cp1251'); - $inf['mod_zvanie'] = str_replace('<b>','',$inf['mod_zvanie']); - $inf['mod_zvanie'] = str_replace('</b>','',$inf['mod_zvanie']); - $inf['mod_zvanie'] = str_replace('<u>','',$inf['mod_zvanie']); - $inf['mod_zvanie'] = str_replace('</u>','',$inf['mod_zvanie']); - $inf['mod_zvanie'] = str_replace('<i>','',$inf['mod_zvanie']); - $inf['mod_zvanie'] = str_replace('</i>','',$inf['mod_zvanie']); + ?> + + 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 '

    '; + } + } + } elseif ($inf['room'] != 303) { + echo '
    '; + + + if ($inf['online'] > time( + ) - 520 && $inf['banned'] == 0 && $inf['invis'] != 1 && $inf['invis'] < time()) { + echo ' .
    "' . $room['name'] . '"'; + } else { + if ($inf['admin'] == 0 || $inf['admin'] == 2) { + if ($inf['online'] == 0) { + $inf['online'] = $inf['timeREG']; + } + echo ' '; + if (date('Y', $inf['online']) == date('Y')) { + echo ', :
    ' . date( + 'd.m.Y H:i', $inf['online'] + ) . ''; + $out = ''; + $time_still = time() - $inf['online']; + $tmp = floor($time_still / 2592000); + $id = 0; + if ($tmp > 0) { + $id++; + if ($id < 3) { + $out .= $tmp . " . "; + } + $time_still = $time_still - $tmp * 2592000; } - echo ': '.$pc['name'].' '.$inf['mod_zvanie'].'
    '; + $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 . ' .'; + } + echo '
    (' . $out . ' )'; } + } elseif ($inf['admin'] > 0) { + echo ' .'; } - - if( $inf['admin'] == 0 && ( ($inf['align'] > 1 && $inf['align'] < 2) || ($inf['align'] > 3 && $inf['align'] < 4) ) ) { - echo '
    '; - } - ?> - - '.$u->city_name[$inf['city2']].'
    '; } ?> - :
    - time() ) { ?> - :
    -
    '; - } - if($inf['redirect'] != '0' && ($u->info['admin'] > 0 || $u->info['id'] == $inf['id'])) { - echo ': '.htmlspecialchars($inf['redirect']).'
    '; - } - if( $u->info['admin'] > 0 ) { - echo '
    : '.(0+$st['prckr']).' .
    '; - echo ' : '.(0+$st['preckr']).' e.
    '; - echo ' : '.(0+$st['pbe']).'
    '; - } - ?> - '.$pl['login'].' ['.$pl['level'].']'; - }else{ - $twk .= ''.$pl['login'].' ['.$pl['level'].']'; - } - } - } - if( $twk != '' ) { - echo ' : '.$twk.'
    '; - } - ?> - 0) - { - $names .= '                      '; + } + if ($inf['inUser'] > 0 and $inf['id'] != 12059) { + echo '
    '; + } + 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 '
    '; + } + } + echo '
    '; + } else { + if ($inf['res_x'] - time() > 0) { + echo '
    ' . ($u->timeOut( + ($inf['res_x'] - time()) + )) . '
    '; + } else { + echo '
    ...
    '; + } + } + // + if ($u->info['admin'] > 0) { + + if (isset($_GET['cancel_eff'])) { + mysql_query( + 'UPDATE `eff_users` SET `delete` = "' . time( + ) . '" WHERE `id` = "' . mysql_real_escape_string( + (int)$_GET['cancel_eff'] + ) . '" AND `uid` = "' . $inf['id'] . '" LIMIT 1' + ); + die(''); + } + + function eff_adm($pl) + { + global $u; + $r = ''; + 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'] + ) . ''; + } + $r .= ''; + return $r; + } + + $eff_adm = ''; + $sp = mysql_query( + 'SELECT `id_eff`,`uid`,`id`,`name`,`img2`,`v1`,`v2`,`timeUse` FROM `eff_users` WHERE `uid` = "' . $inf['id'] . '" AND `delete` = "0"' + ); + while ($pl = mysql_fetch_array($sp)) { + $eff_adm .= eff_adm($pl); + } + if ($eff_adm != '') { + echo '
    :
    ' . $eff_adm . '
    '; + } + } + if ($u->info['admin'] > 0) { + ?> +
    + + +
    +
    +
    +
    + +
    + + - -
    info['admin'] > 0) { + $nodell = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`inUser` FROM `users` WHERE `login` = "' . $inf['login'] . '" ORDER BY `id` ASC LIMIT 1' + ) + ); + $sp = mysql_query( + 'SELECT `id`,`level`,`inTurnir`,`room`,`battle`,`inTurnirnew`,`inUser` FROM `users` WHERE `login` = "' . $inf['login'] . '" AND `id` != "' . $inf['id'] . '"' + ); + while ($pl = mysql_fetch_array($sp)) { + if (isset($_GET['del_copy']) && $_GET['del_copy'] == $pl['id']) { + if ($nodell['inUser'] != $pl['id'] && $pl['id'] != $nodell['id']) { + mysql_query( + 'UPDATE `users` SET `login` = "DELETE" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); + } + } else { + $nolog .= '
    ' . $u->microLogin($pl['id'], 1); + if ($nodell['inUser'] != $pl['id'] && $pl['id'] != $nodell['id']) { + $nolog .= ' ( )'; + } + if ($pl['id'] == $nodell['id']) { + $nolog .= ' ( )'; + } + $nolog .= '
    '; + } + } + if ($nolog != '') { + $nolog = ' :' . $nolog . ''; + echo $nolog; + } + } - $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 '
    : '; - if( $algnt['delete'] > 0 ) { - echo ' ( '.date('d.m.Y H:i',$algnt['delete']).')'; - } - echo '
    '; - }elseif($algnt['align'] == 3) { - echo '
    : '; - if( $algnt['delete'] > 0 ) { - echo ' ( '.date('d.m.Y H:i',$algnt['delete']).')'; - } - echo '
    '; - }elseif($algnt['align'] == 7) { - echo '
    : '; - if( $algnt['delete'] > 0 ) { - echo ' ( '.date('d.m.Y H:i',$algnt['delete']).')'; - } - echo '
    '; - } - } - if( $st['silver'] > 0 ) { - echo '
    '; - echo ' : '; - echo '
    '; - } - - if($inf['win_t'] > 0) { ?> -
    - :
    - :
    - - - info['align'] == 50 ) { - $bnk = ''; $bmn1 = 0; $bmn2 = 0; - $sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "'.$inf['id'].'"'); - while($pl = mysql_fetch_array($sp)) { - if($pl['useNow'] > 0) { - $bnk .= '
    '; - }else{ - $bnk .= '
    '; - } - $bnk .= '  • '.$pl['id'].''; - $bnk .= '
    '; - } - if($bnk != '') { - echo '
    :  '.$bnk.'
    '; - } - echo '
    '; - } - ?> -
    -
    - - - '; - } - } - - $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)) - { - $stlico = ''; - - if( $pl['type'] == 2 ) { - $stlico .= 'width:37px;height:37xp;padding:2px;'; - } - - if($stlico != '') { - $stlico = 'style="'.$stlico.'"'; - } - $icon = ' '; - - if( $pl['href'] != '#' && $pl['href'] != '' ) { - $ico[$pl['type']] .= ''.$icon.''; - }else{ - $ico[$pl['type']] .= $icon; - } - } - unset($icon); - - - if($inf['vip']==1) { - $ico[1] .= ' '; - } - - // - if($st['silver']>0) { - $ico[1] .= ' '; - } +
    :
    + :
    + :
    + :
    + 3 || $st['s5'] != 0) { ?> + :
    + 6 || $st['s6'] != 0) { ?> + :
    + 9 || $st['s7'] != 0) { ?> + :
    + 11 || $st['s8'] != 0) { ?>:
    + 14 || $st['s9'] != 0) { ?> + :
    + 19 || $st['s10'] != 0) { ?> + :
    + 0) { ?> + :
    + + :
    +
    +
    +
    + info['admin'] > 0) { + echo ':'; + } else { + echo ':'; + } ?>
    + + : ' . number_format( + $inf['win'], 0, ",", " " + ) . ''; + } ?>
    + :
    + :
    + - $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] .= ''; - }elseif($irep['repdreamscity']>4999) - { - $ico[1] .= ''; - } - elseif($irep['repdreamscity']>999) - { - $ico[1] .= ''; - } - - // - if($irep['rep1']>9999) - { - $ico[1] .= ''; - }elseif($irep['rep1']>999) - { - $ico[1] .= ''; - }elseif($irep['rep1']>99) - { - $ico[1] .= ''; - } - - // - if($irep['rep2']>99) - { - $ico[1] .= ''; - } - - // - if($irep['repizlom']>24999) - { - $ico[1] .= ''; - }elseif($irep['repizlom']>9999) - { - $ico[1] .= ''; - }elseif($irep['repizlom']>999) - { - $ico[1] .= ''; - }elseif($irep['repizlom']>99) - { - $ico[1] .= ''; - } - - - //capitalcity - if($irep['repcapitalcity']>24999) - { - $ico[1] .= ''; - }elseif($irep['repcapitalcity']>9999) - { - $ico[1] .= ''; - } - - //angelscity - if($irep['repangelscity']>24999) - { - $ico[1] .= ''; - }elseif($irep['repangelscity']>9999) - { - $ico[1] .= ''; - } - - //demonscity - if($irep['repdemonscity']>24999) - { - $ico[1] .= ''; - }elseif($irep['repdemonscity']>9999) - { - $ico[1] .= ''; - } - - //devilscity - if($irep['repdevilscity']>24999) - { - $ico[1] .= ''; - }elseif($irep['repdevilscity']>9999) - { - $ico[1] .= ''; - } - - //suncity - if($irep['repsuncity']>24999) - { - $ico[1] .= ''; - }elseif($irep['repsuncity']>9999) - { - $ico[1] .= ''; - } - // ( ) by R - if($irep['repabandonedplain']>9999) - { - $ico[1] .= ''; - }elseif($irep['repabandonedplain']>999) - { - $ico[1] .= ''; - } - - //emeraldscity - if($irep['repemeraldscity']>24999) - { - $ico[1] .= ''; - }elseif($irep['repemeraldscity']>9999) - { - $ico[1] .= ''; - } - - //sandcity - if($irep['repsandcity']>24999) - { - $ico[1] .= ''; - }elseif($irep['repsandcity']>9999) - { - $ico[1] .= ''; - } - - //mooncity - if($irep['repmooncity']>24999) - { - $ico[1] .= ''; - }elseif($irep['repmooncity']>9999) - { - $ico[1] .= ''; - } - if($inf['referals'] >= 3000) // - { - $ico[1] .= ''; - }elseif($inf['referals'] > 1500) - { - $ico[1] .= ''; - }elseif($inf['referals'] > 600) - { - $ico[1] .= ''; - } - } + '; + if ($inf['mod_zvanie'] != '') { + echo ' - ' . $inf['mod_zvanie']; + } + echo '
    '; + } ?> + '; + if ($inf['mod_zvanie'] != '') { + echo ' - ' . $inf['mod_zvanie']; + } + echo '
    '; + } ?> + '; - foreach ($ai->getTypes() as $type) { - $tmp_1 = $ai->getInfo($inf['id']); - if (!empty($tmp_1[$type])) { - $ico[3].= '
    '.$tmp_1['name'.$type].'
    '.$tmp_1['klas'.$type].' :
    '.$tmp_1['name'.$type].'
    '; - } - } + if ($inf['clan'] > 0) { + $pc = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `clan` WHERE `id`="' . $inf['clan'] . '" LIMIT 1' + ) + ); + if (isset($pc['id'])) { + $pc['img'] = $pc['name_mini'] . '.gif'; + if ($inf['clan_prava'] == 'glava') { + $inf['mod_zvanie'] = '- '; + } elseif ($inf['mod_zvanie'] != '') { + $inf['mod_zvanie'] = '- ' . htmlspecialchars( + $inf['mod_zvanie'], null, 'cp1251' + ); + $inf['mod_zvanie'] = str_replace( + '<b>', '', $inf['mod_zvanie'] + ); + $inf['mod_zvanie'] = str_replace( + '</b>', '', $inf['mod_zvanie'] + ); + $inf['mod_zvanie'] = str_replace( + '<u>', '', $inf['mod_zvanie'] + ); + $inf['mod_zvanie'] = str_replace( + '</u>', '', $inf['mod_zvanie'] + ); + $inf['mod_zvanie'] = str_replace( + '<i>', '', $inf['mod_zvanie'] + ); + $inf['mod_zvanie'] = str_replace( + '</i>', '', $inf['mod_zvanie'] + ); + } + echo ': ' . $pc['name'] . ' ' . $inf['mod_zvanie'] . '
    '; + } + } - $ico[3].='
    '; - } - + if ($inf['admin'] == 0 && (($inf['align'] > 1 && $inf['align'] < 2) || ($inf['align'] > 3 && $inf['align'] < 4))) { + echo '
    '; + } + ?> + + ' . $u->city_name[$inf['city2']] . '
    '; + } ?> + :
    + time()) { ?> + : +
    +
    '; + } + if ($inf['redirect'] != '0' && ($u->info['admin'] > 0 || $u->info['id'] == $inf['id'])) { + echo ': ' . htmlspecialchars($inf['redirect']) . '
    '; + } + if ($u->info['admin'] > 0) { + echo '
    : ' . (0 + $st['prckr']) . ' .
    '; + echo ' : ' . (0 + $st['preckr']) . ' e.
    '; + echo ' : ' . (0 + $st['pbe']) . '
    '; + } + ?> + ' . $pl['login'] . ' [' . $pl['level'] . ']'; + } else { + $twk .= '' . $pl['login'] . ' [' . $pl['level'] . ']'; + } + } + } + if ($twk != '') { + echo ' : ' . $twk . '
    '; + } + ?> + 0) { + $names .= '                      '; + } + $names .= '\'' . $pl['login'] . '\' ' . date( + 'd.m.Y H:i', $pl['time'] + ) . '
    '; + $i++; + } + if ($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 '
    : '; + if ($algnt['delete'] > 0) { + echo ' ( ' . date('d.m.Y H:i', $algnt['delete']) . ')'; + } + echo '
    '; + } elseif ($algnt['align'] == 3) { + echo '
    : '; + if ($algnt['delete'] > 0) { + echo ' ( ' . date('d.m.Y H:i', $algnt['delete']) . ')'; + } + echo '
    '; + } elseif ($algnt['align'] == 7) { + echo '
    : '; + if ($algnt['delete'] > 0) { + echo ' ( ' . date('d.m.Y H:i', $algnt['delete']) . ')'; + } + echo '
    '; + } + } + if ($st['silver'] > 0) { + echo '
    '; + echo ' : '; + echo '
    '; + } - function timeOut($ttm,$travm=false) - { - if($travm==false){ - $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/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=='') - { - if($time_still<0) - { - $time_still = 0; - } - $out = $time_still.' .'; - } - } - return $out; - } - - if( $ico[1] != '' ) { - echo $ico[1]; - } - - echo ''; - if($inf['jail']>time()) - { - echo '
    '.timeOut($inf['jail']-time()).' '; - } - if(isset($st['puti'])) - { - echo '
    '.timeOut($st['puti']-time()).' '; - } - if($inf['molch1']>time()) - { - echo '
    . '.timeOut($inf['molch1']-time()).' '; - } - if($inf['molch2']>time()) - { - echo '
    . '.timeOut($inf['molch2']-time()).' '; - } - if($inf['clan_delay']>time()) - { - echo '
    : '.timeOut($inf['clan_delay']-time()).' '; - } - if($inf['info_delete'] > time() || $inf['info_delete'] == 1) - { - echo '
    .'; - if( $inf['info_delete'] > 1 ) { - echo ' '.timeOut($inf['info_delete']-time()).''; - } - } + if ($inf['win_t'] > 0) { + ?> +
    + : +
    + :
    + + + info['align'] == 50) { + $bnk = ''; + $bmn1 = 0; + $bmn2 = 0; + $sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $inf['id'] . '"'); + while ($pl = mysql_fetch_array($sp)) { + if ($pl['useNow'] > 0) { + $bnk .= '
    '; + } else { + $bnk .= '
    '; + } + $bnk .= '  • ' . $pl['id'] . ''; + $bnk .= '
    '; + } + if ($bnk != '') { + echo '
    :  ' . $bnk . '
    '; + } + echo '
    '; + } + ?> +
    +
    + + + - "'.$pl['name'].'" '.$u->timeOut($pl['timeUse']-time()+$pl['timeAce']); - } - - // - , 4 . 24 . - if($inf['level']>=4) - { - $nn = 0; - while($nn - , '.timeOut($st['effects'][$nn]['timeUse']+$st['effects'][$nn]['timeAce']+$osl['actionTime']-time()).' '; - $nn = count($st['effects'])+1; - } - $nn++; - } - } - - echo ''; + $ico = []; - if( $ico[3] != '' ) { - echo '
    :
    '.$ico[3].'
    '; - } + if ($inf['marry'] != 0) { + $marry = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login` FROM `users` WHERE `id` = "' . $inf['marry'] . '" LIMIT 1' + ) + ); + if (isset($marry['id'])) { + $mrtxt = ''; + if ($inf['sex'] == 0) { + $mrtxt = ' '; + } else { + $mrtxt = ' '; + } + $ico[1] .= ''; + } + } - unset($ico); - - if( - ( - $inf['align']>=2 && - $inf['align'] < 3 && - ( - $inf['haos']>time() || - $inf['haos']==1 - ) - ) || - $inf['banned']>0 || - $inf['jail']>time()) - { - $to = ''; - if($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1)) - { - $to = ''; - } - if($inf['banned']>0) - { - if($to='') - { - $to = ''; - }else{ - $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 '
    '; - if(isset($fm['id'])) - { - $from = ''; - if($fm['hb']==2) - { - $from = ''; - }elseif($fm['hb']==3) - { - $from = ''; - } - echo ' :
    '; - echo ''.$fm['text'].'
    '; - } - if($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1)) - { - if($inf['haos']==1) - { - echo ' .'; - }else{ - echo ' '.timeOut($inf['haos']-time()).''; - } - } - echo '
    '; - } - - // - if(($inf['info_delete']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; - $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')) { - $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'] = ''; - }else{ - $pl['gift2'] = $pl['gift']; - } - $gs[0] .= ''; - $ij1++; - } - $ij2 = 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` = "63" OR `im`.`type` = "37" OR `iu`.`data` LIKE "%|giftsee=2%") 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($pl['type'] == 63 || $pl['type'] == 37) { - // - if( $pl['gift'] == 1 ) { - $pl['gift2'] = ''; - }else{ - $pl['gift2'] = $pl['gift']; - } - $gs[1] .= ''; - //} - $ij2++; - } - $ij3 = 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` = 28 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($pl['type'] == 28) { - // - if( $pl['gift'] == 1 ) { - $pl['gift2'] = ''; - }else{ - $pl['gift2'] = $pl['gift']; - } - $gs[2] .= ''; - } - $ij3++; - } - - if($gs[0]!='' || $gs[1]!='' || $gs[2]!=''){ - if($gs[2] != '') { - $gs[2] = '
    :

    '.$gs[2].'
    '.$gs[2].'
    :

    '.$gs[0].'
    '.$gs[1].'
    '; - $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 ' , ...'; - }else{ - echo ' , '; - } - } - } - - } - if( $inf['no_ip'] == 'trupojor' && $u->info['admin'] > 0 ) { - if( isset($_GET['emonster']) ) { - - $monster = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_monsters` WHERE `uid` = "'.mysql_real_escape_string($inf['id']).'" LIMIT 1')); - - if(isset($_POST['bot_sroom'])) { - $monster['start_room'] = (int)$_POST['bot_sroom']; - - $monster['start_day'] = (int)$_POST['bot_sday']; - $monster['start_dd'] = (int)$_POST['bot_sdd']; - $monster['start_mm'] = (int)$_POST['bot_smm']; - $monster['start_hh'] = (int)$_POST['bot_shh']; - $monster['start_min'] = (int)$_POST['bot_smin']; - - $monster['back_day'] = (int)$_POST['bot_bday']; - $monster['back_dd'] = (int)$_POST['bot_bdd']; - $monster['back_mm'] = (int)$_POST['bot_bmm']; - $monster['back_hh'] = (int)$_POST['bot_bhh']; - $monster['back_min'] = (int)$_POST['bot_bmin']; - - $monster['start_text'] = $_POST['bot_stext']; - $monster['back_text'] = $_POST['bot_btext']; - $monster['win_text'] = $_POST['bot_wintext']; - $monster['lose_text'] = $_POST['bot_losetext']; - $monster['nich_text'] = $_POST['bot_nichtext']; - - $monster['win_back'] = $_POST['bot_winback']; - $monster['time_restart'] = $_POST['bot_trs']; - - $monster['win_itm'] = $_POST['bot_winitm']; - $monster['win_money1'] = $_POST['bot_winmoney1']; - $monster['win_money2'] = $_POST['bot_winmoney2']; - $monster['win_exp'] = $_POST['bot_winexp']; - $monster['win_eff'] = $_POST['bot_wineff']; - $monster['win_ico'] = $_POST['bot_winico']; - - $monster['lose_itm'] = $_POST['bot_loseitm']; - $monster['lose_money1'] = $_POST['bot_losemoney1']; - $monster['lose_money2'] = $_POST['bot_losemoney2']; - $monster['lose_exp'] = $_POST['bot_loseexp']; - $monster['lose_eff'] = $_POST['bot_loseeff']; - $monster['lose_ico'] = $_POST['bot_loseico']; - - if( !isset($monster['id']) ) { - mysql_query('INSERT INTO `aaa_monsters` ( + $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)) { + $stlico = ''; + + if ($pl['type'] == 2) { + $stlico .= 'width:37px;height:37xp;padding:2px;'; + } + + if ($stlico != '') { + $stlico = 'style="' . $stlico . '"'; + } + $icon = ' '; + + if ($pl['href'] != '#' && $pl['href'] != '') { + $ico[$pl['type']] .= '' . $icon . ''; + } else { + $ico[$pl['type']] .= $icon; + } + } + unset($icon); + + + if ($inf['vip'] == 1) { + $ico[1] .= ' '; + } + + // + if ($st['silver'] > 0) { + $ico[1] .= ' '; + } + + $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] .= ''; + } elseif ($irep['repdreamscity'] > 4999) { + $ico[1] .= ''; + } elseif ($irep['repdreamscity'] > 999) { + $ico[1] .= ''; + } + + // + if ($irep['rep1'] > 9999) { + $ico[1] .= ''; + } elseif ($irep['rep1'] > 999) { + $ico[1] .= ''; + } elseif ($irep['rep1'] > 99) { + $ico[1] .= ''; + } + + // + if ($irep['rep2'] > 99) { + $ico[1] .= ''; + } + + // + if ($irep['repizlom'] > 24999) { + $ico[1] .= ''; + } elseif ($irep['repizlom'] > 9999) { + $ico[1] .= ''; + } elseif ($irep['repizlom'] > 999) { + $ico[1] .= ''; + } elseif ($irep['repizlom'] > 99) { + $ico[1] .= ''; + } + + + //capitalcity + if ($irep['repcapitalcity'] > 24999) { + $ico[1] .= ''; + } elseif ($irep['repcapitalcity'] > 9999) { + $ico[1] .= ''; + } + + //angelscity + if ($irep['repangelscity'] > 24999) { + $ico[1] .= ''; + } elseif ($irep['repangelscity'] > 9999) { + $ico[1] .= ''; + } + + //demonscity + if ($irep['repdemonscity'] > 24999) { + $ico[1] .= ''; + } elseif ($irep['repdemonscity'] > 9999) { + $ico[1] .= ''; + } + + //devilscity + if ($irep['repdevilscity'] > 24999) { + $ico[1] .= ''; + } elseif ($irep['repdevilscity'] > 9999) { + $ico[1] .= ''; + } + + //suncity + if ($irep['repsuncity'] > 24999) { + $ico[1] .= ''; + } elseif ($irep['repsuncity'] > 9999) { + $ico[1] .= ''; + } + // ( ) by R + if ($irep['repabandonedplain'] > 9999) { + $ico[1] .= ''; + } elseif ($irep['repabandonedplain'] > 999) { + $ico[1] .= ''; + } + + //emeraldscity + if ($irep['repemeraldscity'] > 24999) { + $ico[1] .= ''; + } elseif ($irep['repemeraldscity'] > 9999) { + $ico[1] .= ''; + } + + //sandcity + if ($irep['repsandcity'] > 24999) { + $ico[1] .= ''; + } elseif ($irep['repsandcity'] > 9999) { + $ico[1] .= ''; + } + + //mooncity + if ($irep['repmooncity'] > 24999) { + $ico[1] .= ''; + } elseif ($irep['repmooncity'] > 9999) { + $ico[1] .= ''; + } + if ($inf['referals'] >= 3000) // + { + $ico[1] .= ''; + } elseif ($inf['referals'] > 1500) { + $ico[1] .= ''; + } elseif ($inf['referals'] > 600) { + $ico[1] .= ''; + } + } + + if ($inf['banned'] == 0) { + $ai = new \Insallah\Achievements($u); + $ico[3] .= '
    '; + + foreach ($ai->getTypes() as $type) { + $tmp_1 = $ai->getInfo($inf['id']); + if (!empty($tmp_1[$type])) { + $ico[3] .= '
    ' . $tmp_1['name' . $type] . '
    ' . $tmp_1['klas' . $type] . ' :
    ' . $tmp_1['name' . $type] . '
    '; + } + } + + $ico[3] .= '
    '; + } + + + function timeOut($ttm, $travm = false) + { + if ($travm == false) { + $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 / 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 == '') { + if ($time_still < 0) { + $time_still = 0; + } + $out = $time_still . ' .'; + } + } + return $out; + } + + if ($ico[1] != '') { + echo $ico[1]; + } + + echo ''; + if ($inf['jail'] > time()) { + echo '
    ' . timeOut( + $inf['jail'] - time() + ) . ' '; + } + if (isset($st['puti'])) { + echo '
    ' . timeOut( + $st['puti'] - time() + ) . ' '; + } + if ($inf['molch1'] > time()) { + echo '
    . ' . timeOut( + $inf['molch1'] - time() + ) . ' '; + } + if ($inf['molch2'] > time()) { + echo '
    . ' . timeOut( + $inf['molch2'] - time() + ) . ' '; + } + if ($inf['clan_delay'] > time()) { + echo '
    : ' . timeOut( + $inf['clan_delay'] - time() + ) . ' '; + } + if ($inf['info_delete'] > time() || $inf['info_delete'] == 1) { + echo '
    .'; + 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)) { + echo '
    - "' . $pl['name'] . '" ' . $u->timeOut( + $pl['timeUse'] - time() + $pl['timeAce'] + ); + } + + // - , 4 . 24 . + if ($inf['level'] >= 4) { + $nn = 0; + while ($nn < count($st['effects'])) { + if ($st['effects'][$nn]['id_eff'] == 5) { + + $osl = mysql_fetch_array( + mysql_query( + 'SELECT `id2`,`actionTime` FROM `eff_main` WHERE `id2` = "5" LIMIT 1' + ) + ); + echo '
    - , ' . timeOut( + $st['effects'][$nn]['timeUse'] + $st['effects'][$nn]['timeAce'] + $osl['actionTime'] - time( + ) + ) . ' '; + $nn = count($st['effects']) + 1; + } + $nn++; + } + } + + echo '
    '; + + if ($ico[3] != '') { + echo '
    :
    ' . $ico[3] . '
    '; + } + + unset($ico); + + if ( + ( + $inf['align'] >= 2 && + $inf['align'] < 3 && + ( + $inf['haos'] > time() || + $inf['haos'] == 1 + ) + ) || + $inf['banned'] > 0 || + $inf['jail'] > time()) { + $to = ''; + if ($inf['align'] >= 2 && $inf['align'] < 3 && ($inf['haos'] > time( + ) || $inf['haos'] == 1)) { + $to = ''; + } + if ($inf['banned'] > 0) { + if ($to = '') { + $to = ''; + } else { + $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 '
    '; + if (isset($fm['id'])) { + $from = ''; + if ($fm['hb'] == 2) { + $from = ''; + } elseif ($fm['hb'] == 3) { + $from = ''; + } + echo ' :
    '; + echo '' . $fm['text'] . '
    '; + } + if ($inf['align'] >= 2 && $inf['align'] < 3 && ($inf['haos'] > time( + ) || $inf['haos'] == 1)) { + if ($inf['haos'] == 1) { + echo ' .'; + } else { + echo ' ' . timeOut($inf['haos'] - time()) . ''; + } + } + echo '
    '; + } + + // + 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 = ['', '', '']; + $glim = 1000; + $i = 0; + $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')) { + $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'] = ''; + } else { + $pl['gift2'] = $pl['gift']; + } + $gs[0] .= ''; + $ij1++; + } + $ij2 = 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` = "63" OR `im`.`type` = "37" OR `iu`.`data` LIKE "%|giftsee=2%") 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($pl['type'] == 63 || $pl['type'] == 37) { + // + if ($pl['gift'] == 1) { + $pl['gift2'] = ''; + } else { + $pl['gift2'] = $pl['gift']; + } + $gs[1] .= ''; + //} + $ij2++; + } + $ij3 = 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` = 28 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 ($pl['type'] == 28) { + // + if ($pl['gift'] == 1) { + $pl['gift2'] = ''; + } else { + $pl['gift2'] = $pl['gift']; + } + $gs[2] .= ''; + } + $ij3++; + } + + if ($gs[0] != '' || $gs[1] != '' || $gs[2] != '') { + if ($gs[2] != '') { + $gs[2] = '
    :

    ' . $gs[2] . '
    ' . $gs[2] . '
    :

    ' . $gs[0] . '
    ' . $gs[1] . '
    '; + $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 ' , ...'; + } else { + echo ' , '; + } + } + } + + } + if ($inf['no_ip'] == 'trupojor' && $u->info['admin'] > 0) { + if (isset($_GET['emonster'])) { + + $monster = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `aaa_monsters` WHERE `uid` = "' . mysql_real_escape_string( + $inf['id'] + ) . '" LIMIT 1' + ) + ); + + if (isset($_POST['bot_sroom'])) { + $monster['start_room'] = (int)$_POST['bot_sroom']; + + $monster['start_day'] = (int)$_POST['bot_sday']; + $monster['start_dd'] = (int)$_POST['bot_sdd']; + $monster['start_mm'] = (int)$_POST['bot_smm']; + $monster['start_hh'] = (int)$_POST['bot_shh']; + $monster['start_min'] = (int)$_POST['bot_smin']; + + $monster['back_day'] = (int)$_POST['bot_bday']; + $monster['back_dd'] = (int)$_POST['bot_bdd']; + $monster['back_mm'] = (int)$_POST['bot_bmm']; + $monster['back_hh'] = (int)$_POST['bot_bhh']; + $monster['back_min'] = (int)$_POST['bot_bmin']; + + $monster['start_text'] = $_POST['bot_stext']; + $monster['back_text'] = $_POST['bot_btext']; + $monster['win_text'] = $_POST['bot_wintext']; + $monster['lose_text'] = $_POST['bot_losetext']; + $monster['nich_text'] = $_POST['bot_nichtext']; + + $monster['win_back'] = $_POST['bot_winback']; + $monster['time_restart'] = $_POST['bot_trs']; + + $monster['win_itm'] = $_POST['bot_winitm']; + $monster['win_money1'] = $_POST['bot_winmoney1']; + $monster['win_money2'] = $_POST['bot_winmoney2']; + $monster['win_exp'] = $_POST['bot_winexp']; + $monster['win_eff'] = $_POST['bot_wineff']; + $monster['win_ico'] = $_POST['bot_winico']; + + $monster['lose_itm'] = $_POST['bot_loseitm']; + $monster['lose_money1'] = $_POST['bot_losemoney1']; + $monster['lose_money2'] = $_POST['bot_losemoney2']; + $monster['lose_exp'] = $_POST['bot_loseexp']; + $monster['lose_eff'] = $_POST['bot_loseeff']; + $monster['lose_ico'] = $_POST['bot_loseico']; + + if (!isset($monster['id'])) { + mysql_query( + 'INSERT INTO `aaa_monsters` ( `uid`,`start_room`,`start_day`,`back_day`,`start_dd`,`start_mm`,`start_hh`,`start_min`,`back_min`,`back_dd`,`back_mm`,`back_hh`, `start_text`,`back_text`,`win_text`,`lose_text`,`win_money1`,`win_money2`,`lose_money`,`lose_money2`,`win_exp`,`lose_exp`,`win_itm`, `lose_itm`,`win_eff`,`lose_eff`,`win_ico`,`lose_ico`,`win_back`,`time_restart`,`nich_text` ) VALUES ( - "'.mysql_real_escape_string($inf['id']).'", - "'.mysql_real_escape_string($monster['start_room']).'", - "'.mysql_real_escape_string($monster['start_day']).'", - "'.mysql_real_escape_string($monster['back_day']).'", - "'.mysql_real_escape_string($monster['start_dd']).'", - "'.mysql_real_escape_string($monster['start_mm']).'", - "'.mysql_real_escape_string($monster['start_hh']).'", - "'.mysql_real_escape_string($monster['start_min']).'", - "'.mysql_real_escape_string($monster['back_min']).'", - "'.mysql_real_escape_string($monster['back_dd']).'", - "'.mysql_real_escape_string($monster['back_mm']).'", - "'.mysql_real_escape_string($monster['back_hh']).'", - "'.mysql_real_escape_string($monster['start_text']).'", - "'.mysql_real_escape_string($monster['back_text']).'", - "'.mysql_real_escape_string($monster['win_text']).'", - "'.mysql_real_escape_string($monster['lose_text']).'", - "'.mysql_real_escape_string($monster['win_money1']).'", - "'.mysql_real_escape_string($monster['win_money2']).'", - "'.mysql_real_escape_string($monster['lose_money']).'", - "'.mysql_real_escape_string($monster['lose_money2']).'", - "'.mysql_real_escape_string($monster['win_exp']).'", - "'.mysql_real_escape_string($monster['lose_exp']).'", - "'.mysql_real_escape_string($monster['win_itm']).'", - "'.mysql_real_escape_string($monster['lose_itm']).'", - "'.mysql_real_escape_string($monster['win_eff']).'", - "'.mysql_real_escape_string($monster['lose_eff']).'", - "'.mysql_real_escape_string($monster['win_ico']).'", - "'.mysql_real_escape_string($monster['lose_ico']).'", - "'.mysql_real_escape_string($monster['win_back']).'", - "'.mysql_real_escape_string($monster['time_restart']).'", - "'.mysql_real_escape_string($monster['nich_text']).'" - ) '); - }else{ - mysql_query('UPDATE `aaa_monsters` SET - `uid` = "'.mysql_real_escape_string($inf['id']).'", - `start_room` = "'.mysql_real_escape_string($monster['start_room']).'", - `start_day` = "'.mysql_real_escape_string($monster['start_day']).'", - `back_day` = "'.mysql_real_escape_string($monster['back_day']).'", - `start_dd` = "'.mysql_real_escape_string($monster['start_dd']).'", - `start_mm` = "'.mysql_real_escape_string($monster['start_mm']).'", - `start_hh` = "'.mysql_real_escape_string($monster['start_hh']).'", - `start_min` = "'.mysql_real_escape_string($monster['start_min']).'", - `back_min` = "'.mysql_real_escape_string($monster['back_min']).'", - `back_dd` = "'.mysql_real_escape_string($monster['back_dd']).'", - `back_mm` = "'.mysql_real_escape_string($monster['back_mm']).'", - `back_hh` = "'.mysql_real_escape_string($monster['back_hh']).'", - `start_text` = "'.mysql_real_escape_string($monster['start_text']).'", - `back_text` = "'.mysql_real_escape_string($monster['back_text']).'", - `win_text` = "'.mysql_real_escape_string($monster['win_text']).'", - `lose_text` = "'.mysql_real_escape_string($monster['lose_text']).'", - `win_money1` = "'.mysql_real_escape_string($monster['win_money1']).'", - `win_money2` = "'.mysql_real_escape_string($monster['win_money2']).'", - `lose_money` = "'.mysql_real_escape_string($monster['lose_money']).'", - `lose_money2` = "'.mysql_real_escape_string($monster['lose_money2']).'", - `win_exp` = "'.mysql_real_escape_string($monster['win_exp']).'", - `lose_exp` = "'.mysql_real_escape_string($monster['lose_exp']).'", - `win_itm` = "'.mysql_real_escape_string($monster['win_itm']).'", - `lose_itm` = "'.mysql_real_escape_string($monster['lose_itm']).'", - `win_eff` = "'.mysql_real_escape_string($monster['win_eff']).'", - `lose_eff` = "'.mysql_real_escape_string($monster['lose_eff']).'", - `win_ico` = "'.mysql_real_escape_string($monster['win_ico']).'", - `lose_ico` = "'.mysql_real_escape_string($monster['lose_ico']).'", - `win_back` = "'.mysql_real_escape_string($monster['win_back']).'", - `time_restart` = "'.mysql_real_escape_string($monster['time_restart']).'", - `nich_text` = "'.mysql_real_escape_string($monster['nich_text']).'" - WHERE `id` = "'.mysql_real_escape_string($monster['id']).'" LIMIT 1'); - } - - echo ' !'; - } - - ?> - :
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    (id ): - -   -
    : .
    : -
    , - - - - - - - - - - - -
    ,     - - - - - - - - - -
    ( {b}, {u}):
    :
    :
    :
    :
    ( ):
    .:
    .:
    ( 100% ):
    (id@kolvo@data, ...):
    :
    :
    ( ):
    .:
    .:
    :
    :
    :
    :
    -
    - -
    -

    -
    -
    -
    -
    - -
    -
    -
    -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)) - { - $mults = ''; - $bIP = array(); - - $spl = mysql_query('SELECT * FROM `mults` WHERE (`uid` = "'.$inf['id'].'" OR `uid2` = "'.$inf['id'].'") AND `uid`!="0" AND `uid2`!="0"'); - while($pls = mysql_fetch_array($spl)) - { - $usr = $pls['uid']; - if($usr==$inf['id']) - { - $usr = $pls['uid2']; - } - if( $pls['id'] == 2495806 ) { - - }elseif(!isset($bIP[$usr]) && $usr!=$inf['id']) - { - $si = mysql_fetch_array(mysql_query('SELECT `id`,`admin`,`online` FROM `users` WHERE `id` = "'.mysql_real_escape_string($usr).'" AND `login` != "delete" LIMIT 1')); - if(isset($si['id'])) - { - if($si['admin']==0) { - if( $si['online'] > time() - 520 ) { - $mults .= ''.$u->microLogin($si['id'],1).', '; - }else{ - $mults .= $u->microLogin($si['id'],1).', '; - } - } - } - } - } - - if($nopal) { - //echo '

    ...

    '; - } 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 '

    ...

    '; - }else{ - echo '

    :
    '; - if(!isset($_GET['mod_inf'])) { - echo ' '; - }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)) - { - echo ''.date("d.m.Y H:i:s",$log_w['time']).' '.$log_w['text'].'
    '; - $i++; - } - echo ' '; - } - echo '

    '; - // \\ - 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 = ''; - } elseif ((int)$u->info['align']==3) - { - $rang = ''; - } else - { - $rang = ''; - } + "' . mysql_real_escape_string($inf['id']) . '", + "' . mysql_real_escape_string($monster['start_room']) . '", + "' . mysql_real_escape_string($monster['start_day']) . '", + "' . mysql_real_escape_string($monster['back_day']) . '", + "' . mysql_real_escape_string($monster['start_dd']) . '", + "' . mysql_real_escape_string($monster['start_mm']) . '", + "' . mysql_real_escape_string($monster['start_hh']) . '", + "' . mysql_real_escape_string($monster['start_min']) . '", + "' . mysql_real_escape_string($monster['back_min']) . '", + "' . mysql_real_escape_string($monster['back_dd']) . '", + "' . mysql_real_escape_string($monster['back_mm']) . '", + "' . mysql_real_escape_string($monster['back_hh']) . '", + "' . mysql_real_escape_string($monster['start_text']) . '", + "' . mysql_real_escape_string($monster['back_text']) . '", + "' . mysql_real_escape_string($monster['win_text']) . '", + "' . mysql_real_escape_string($monster['lose_text']) . '", + "' . mysql_real_escape_string($monster['win_money1']) . '", + "' . mysql_real_escape_string($monster['win_money2']) . '", + "' . mysql_real_escape_string($monster['lose_money']) . '", + "' . mysql_real_escape_string($monster['lose_money2']) . '", + "' . mysql_real_escape_string($monster['win_exp']) . '", + "' . mysql_real_escape_string($monster['lose_exp']) . '", + "' . mysql_real_escape_string($monster['win_itm']) . '", + "' . mysql_real_escape_string($monster['lose_itm']) . '", + "' . mysql_real_escape_string($monster['win_eff']) . '", + "' . mysql_real_escape_string($monster['lose_eff']) . '", + "' . mysql_real_escape_string($monster['win_ico']) . '", + "' . mysql_real_escape_string($monster['lose_ico']) . '", + "' . mysql_real_escape_string($monster['win_back']) . '", + "' . mysql_real_escape_string($monster['time_restart']) . '", + "' . mysql_real_escape_string($monster['nich_text']) . '" + ) ' + ); + } else { + mysql_query( + 'UPDATE `aaa_monsters` SET + `uid` = "' . mysql_real_escape_string($inf['id']) . '", + `start_room` = "' . mysql_real_escape_string($monster['start_room']) . '", + `start_day` = "' . mysql_real_escape_string($monster['start_day']) . '", + `back_day` = "' . mysql_real_escape_string($monster['back_day']) . '", + `start_dd` = "' . mysql_real_escape_string($monster['start_dd']) . '", + `start_mm` = "' . mysql_real_escape_string($monster['start_mm']) . '", + `start_hh` = "' . mysql_real_escape_string($monster['start_hh']) . '", + `start_min` = "' . mysql_real_escape_string($monster['start_min']) . '", + `back_min` = "' . mysql_real_escape_string($monster['back_min']) . '", + `back_dd` = "' . mysql_real_escape_string($monster['back_dd']) . '", + `back_mm` = "' . mysql_real_escape_string($monster['back_mm']) . '", + `back_hh` = "' . mysql_real_escape_string($monster['back_hh']) . '", + `start_text` = "' . mysql_real_escape_string($monster['start_text']) . '", + `back_text` = "' . mysql_real_escape_string($monster['back_text']) . '", + `win_text` = "' . mysql_real_escape_string($monster['win_text']) . '", + `lose_text` = "' . mysql_real_escape_string($monster['lose_text']) . '", + `win_money1` = "' . mysql_real_escape_string($monster['win_money1']) . '", + `win_money2` = "' . mysql_real_escape_string($monster['win_money2']) . '", + `lose_money` = "' . mysql_real_escape_string($monster['lose_money']) . '", + `lose_money2` = "' . mysql_real_escape_string($monster['lose_money2']) . '", + `win_exp` = "' . mysql_real_escape_string($monster['win_exp']) . '", + `lose_exp` = "' . mysql_real_escape_string($monster['lose_exp']) . '", + `win_itm` = "' . mysql_real_escape_string($monster['win_itm']) . '", + `lose_itm` = "' . mysql_real_escape_string($monster['lose_itm']) . '", + `win_eff` = "' . mysql_real_escape_string($monster['win_eff']) . '", + `lose_eff` = "' . mysql_real_escape_string($monster['lose_eff']) . '", + `win_ico` = "' . mysql_real_escape_string($monster['win_ico']) . '", + `lose_ico` = "' . mysql_real_escape_string($monster['lose_ico']) . '", + `win_back` = "' . mysql_real_escape_string($monster['win_back']) . '", + `time_restart` = "' . mysql_real_escape_string($monster['time_restart']) . '", + `nich_text` = "' . mysql_real_escape_string($monster['nich_text']) . '" + WHERE `id` = "' . mysql_real_escape_string($monster['id']) . '" LIMIT 1' + ); + } - if($u->info['admin'] == 1) { - echo ': '.$inf['room'].'
    '; - } - if((int)$inf['host_reg'] >= 1){ - $inf['ref'] = $u->microLogin((int)$inf['host_reg'],1); - }else{ - $inf['ref'] = '--'; - } - if(!isset($inf['ipReg'])){ $inf['ipReg'] = '--'; } - echo ' + echo ' !'; + } + + ?> + :
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    (id ): + +   +
    : . +
    : +
    +
    +
    , + + + + + + + + + + + +
    ,     + + + + + + + + + +
    +
    +
    ( {b}, {u}):
    :
    :
    :
    :
    +
    + ( ):
    .:
    .:
    ( 100% ):
    (id@kolvo@data, ...):
    :
    :
    +
    + ( ):
    .:
    .:
    :
    :
    :
    :
    +
    + +
    +

    +
    +
    +
    +
    + +
    +
    +
    + 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)) { + $mults = ''; + $bIP = []; + + $spl = mysql_query( + 'SELECT * FROM `mults` WHERE (`uid` = "' . $inf['id'] . '" OR `uid2` = "' . $inf['id'] . '") AND `uid`!="0" AND `uid2`!="0"' + ); + while ($pls = mysql_fetch_array($spl)) { + $usr = $pls['uid']; + if ($usr == $inf['id']) { + $usr = $pls['uid2']; + } + if ($pls['id'] == 2495806) { + + } elseif (!isset($bIP[$usr]) && $usr != $inf['id']) { + $si = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`admin`,`online` FROM `users` WHERE `id` = "' . mysql_real_escape_string( + $usr + ) . '" AND `login` != "delete" LIMIT 1' + ) + ); + if (isset($si['id'])) { + if ($si['admin'] == 0) { + if ($si['online'] > time() - 520) { + $mults .= '' . $u->microLogin( + $si['id'], 1 + ) . ', '; + } else { + $mults .= $u->microLogin($si['id'], 1) . ', '; + } + } + } + } + } + + if ($nopal) { + //echo '

    ...

    '; + } 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 '

    ...

    '; + } else { + echo '

    :
    '; + if (!isset($_GET['mod_inf'])) { + echo ' '; + } 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)) { + echo '' . date( + "d.m.Y H:i:s", $log_w['time'] + ) . ' ' . $log_w['text'] . '
    '; + $i++; + } + echo ' '; + } + echo '

    '; + // \\ + 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 = ''; + } elseif ((int)$u->info['align'] == 3) { + $rang = ''; + } else { + $rang = ''; + } + + if ($u->info['admin'] == 1) { + echo ': ' . $inf['room'] . '
    '; + } + if ((int)$inf['host_reg'] >= 1) { + $inf['ref'] = $u->microLogin((int)$inf['host_reg'], 1); + } else { + $inf['ref'] = '--'; + } + if (!isset($inf['ipReg'])) { + $inf['ipReg'] = '--'; + } + echo '
    - '.$rang.'
    - : '.$inf['bithday'].'
    '; - - if($inf['vip']==1) { - echo 'VIP
    '; - } - - if($u->info['admin'] > 0) { - if( $inf['activ'] == 0 ) { - echo ''; - } - - $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 'E-mail: '.$inf['mail'].' ()'; - }else{ - echo 'E-mail: '.$inf['mail'].''; - } - if( $inf['activ'] == 0 ) { - echo '   &   '.$inf['send'].'
    '; - echo '
    '; - }else{ - echo '
    '; - } - }else{ - if( $inf['activ'] == 0 ) { - echo ' '; - }else{ - echo ' '; - } - echo '
    '; - } - if( $inf['no_ip'] != 0 ) { - $inf['ipReg'] = $inf['no_ip']; - $inf['ip'] = $inf['no_ip']; - } - echo ' : '.$inf['ref'].'
    - : '.date('d.m.Y H:i',$inf['online']).'
    - '.$pr['login'].'IP : '.$inf['ipReg'].'
    '; - if($inf['no_ip'] == '' || $u->info['admin']>0) { - echo 'IP : '.$inf['ip'].''; - $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 '
    '.$auth_w['ip'].' ('.date('d.m.Y H:i',$auth_w['time']).')'; - } - }else{ - echo 'IP : '.$inf['no_ip'].''; - } - - -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 - } - 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; // -} - - - echo' + ' . $rang . '
    + : ' . $inf['bithday'] . '
    '; + + if ($inf['vip'] == 1) { + echo 'VIP
    '; + } + + if ($u->info['admin'] > 0) { + if ($inf['activ'] == 0) { + echo ''; + } + + $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 'E-mail: ' . $inf['mail'] . ' ()'; + } else { + echo 'E-mail: ' . $inf['mail'] . ''; + } + if ($inf['activ'] == 0) { + echo '   &   ' . $inf['send'] . '
    '; + echo '
    '; + } else { + echo '
    '; + } + } else { + if ($inf['activ'] == 0) { + echo ' '; + } else { + echo ' '; + } + echo '
    '; + } + if ($inf['no_ip'] != 0) { + $inf['ipReg'] = $inf['no_ip']; + $inf['ip'] = $inf['no_ip']; + } + echo ' : ' . $inf['ref'] . '
    + : ' . date('d.m.Y H:i', $inf['online']) . '
    + ' . $pr['login'] . 'IP : ' . $inf['ipReg'] . '
    '; + if ($inf['no_ip'] == '' || $u->info['admin'] > 0) { + echo 'IP : ' . $inf['ip'] . ''; + $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 '
    ' . $auth_w['ip'] . ' (' . date( + 'd.m.Y H:i', $auth_w['time'] + ) . ')'; + } + } else { + echo 'IP : ' . $inf['no_ip'] . ''; + } + + + 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 + } + 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; // + } + + + echo '
    - : '.user_browser($inf['dateEnter']).'
    + : ' . user_browser($inf['dateEnter']) . '
    '; - - if($inf['no_ip'] == '' || $u->info['admin']>0) { - if($mults!='' && $inf['admin']==0){ - $mults = trim($mults,', '); - echo ' : '.$mults.'
    '; - } - } - - $referalos = ''; - $rfs = 0; - - $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 .= '
    .: '.date('d.m.Y H:i',$pl['timereg']).' / : '.date('d.m.Y H:i',$pl['online']).'   '.$u->microLogin($pl['id'],1).' ( '.$pl['ip'].' , '.$pl['ipreg'].' )'; - $rfs++; - } - - if( $referalos == '' ) { - $referalos = ''; - } - echo '
    :'.$referalos.'
    '; - if($u->info['admin']>0) - { - echo '. :
    '; - $on1 = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$inf['id'].'" LIMIT 1')); - echo ' (): '.timeOut($on1['time_all']).'
    (): '.timeOut($on1['time_today']).'
    '; - } - if($inf['molch3'] time()) - { - echo '
    '; - } - - echo' - : '.$inf['exp'].'
    - UP-: '.$inf['ability'].'
    - : '.$inf['money'].'
    : '.$inf['money2'].'
    : '.$u->zuby($inf['money4']).''; - $bnk = ''; $bmn1 = 0; $bmn2 = 0; - $sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "'.$inf['id'].'"'); - while($pl = mysql_fetch_array($sp)) { - if($pl['useNow'] > 0) { - $bnk .= '
    '; - }else{ - $bnk .= '
    '; - } - $bnk .= '  • '.$pl['id'].''; - $bnk .= ''.$pl['money1'].' .'; - $bnk .= ''.$pl['money2'].' .'; - if($u->info['admin'] > 0) { - $bnk .= ': '.htmlspecialchars($pl['pass'],NULL,'cp1251').''; - } - if($pl['moneyBuy'] > 0) { - $ds = '    : '.$pl['moneyBuy'].'
    '; - } - $bmn1 += $pl['money1']; - $bmn2 += $pl['money2']; - $bnk .= '
    '; - } - $pk = mysql_fetch_array(mysql_query('SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "'.$inf['id'].'" AND `good` > 0 LIMIT 1')); - echo '
       : '.$pk[0].'
    '; - if($bnk != '') { - echo '
    :'.$bnk.'   ( ):   '.$bmn1.' .     '.$bmn2.' .
    '.$ds; - } - if($u->info['admin']>0 && $inf['admin']>0) { - echo '
    admin: '.$inf['admin'].''; - } - if($inf['active']!=''){ - echo '
    ! .'; - echo '
    '; - echo "

    "; - } - echo '
    '; - } - } - } - ?> -
    -
    - - - - -
    -
    -
    - - = 0) { ?> - - 1 && $inf['align']<2) { ?> - /' target='_blank'>
    - /' target='_blank'> - =3.01 && $inf['align']<=3.99) { ?> - /'>
    - /' target='_blank'> - =2 && $inf['align']<3) { ?> - /'>
    - /' target='_blank'> - -
    -
    - -
    - - + + if ($inf['no_ip'] == '' || $u->info['admin'] > 0) { + if ($mults != '' && $inf['admin'] == 0) { + $mults = trim($mults, ', '); + echo ' : ' . $mults . '
    '; + } + } + + $referalos = ''; + $rfs = 0; + + $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 .= '
    .: ' . date( + 'd.m.Y H:i', $pl['timereg'] + ) . ' / : ' . date( + 'd.m.Y H:i', $pl['online'] + ) . '   ' . $u->microLogin( + $pl['id'], 1 + ) . ' ( ' . $pl['ip'] . ' , ' . $pl['ipreg'] . ' )'; + $rfs++; + } + + if ($referalos == '') { + $referalos = ''; + } + echo '
    :' . $referalos . '
    '; + if ($u->info['admin'] > 0) { + echo '. :
    '; + $on1 = mysql_fetch_array( + mysql_query( + 'SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "' . $inf['id'] . '" LIMIT 1' + ) + ); + echo ' (): ' . timeOut( + $on1['time_all'] + ) . '
    (): ' . timeOut( + $on1['time_today'] + ) . '
    '; + } + if ($inf['molch3'] < time() && $inf['molch1'] > time()) { + echo '
    '; + } + + echo ' + : ' . $inf['exp'] . '
    + UP-: ' . $inf['ability'] . '
    + : ' . $inf['money'] . '
    : ' . $inf['money2'] . '
    : ' . $u->zuby( + $inf['money4'] + ) . ''; + $bnk = ''; + $bmn1 = 0; + $bmn2 = 0; + $sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $inf['id'] . '"'); + while ($pl = mysql_fetch_array($sp)) { + if ($pl['useNow'] > 0) { + $bnk .= '
    '; + } else { + $bnk .= '
    '; + } + $bnk .= '  • ' . $pl['id'] . ''; + $bnk .= '' . $pl['money1'] . ' .'; + $bnk .= '' . $pl['money2'] . ' .'; + if ($u->info['admin'] > 0) { + $bnk .= ': ' . htmlspecialchars( + $pl['pass'], null, 'cp1251' + ) . ''; + } + if ($pl['moneyBuy'] > 0) { + $ds = '    : ' . $pl['moneyBuy'] . '
    '; + } + $bmn1 += $pl['money1']; + $bmn2 += $pl['money2']; + $bnk .= '
    '; + } + $pk = mysql_fetch_array( + mysql_query( + 'SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "' . $inf['id'] . '" AND `good` > 0 LIMIT 1' + ) + ); + echo '
       : ' . $pk[0] . '
    '; + if ($bnk != '') { + echo '
    :' . $bnk . '   ( ):   ' . $bmn1 . ' .     ' . $bmn2 . ' .
    ' . $ds; + } + if ($u->info['admin'] > 0 && $inf['admin'] > 0) { + echo '
    admin: ' . $inf['admin'] . ''; + } + if ($inf['active'] != '') { + echo '
    ! .'; + echo '
    '; + echo "

    "; + } + echo '
    '; + } + } + } + ?> + +
    + + + + +
    +
    +
    + + = 0) { ?> + + 1 && $inf['align'] < 2) { ?> + /' target='_blank'> +
    + /' target='_blank'> + + = 3.01 && $inf['align'] <= 3.99) { ?> + /'> +
    + /' target='_blank'> + = 2 && $inf['align'] < 3) { ?> + /'> +
    + /' target='_blank'> + + + +
    +
    + +
    +
    + + + + -info['align'] > 1 && $u->info['align'] < 2 ) { - $moder = 1; +if ($u->info['align'] > 1 && $u->info['align'] < 2) { + $moder = 1; } -if( $u->info['align'] > 3 && $u->info['align'] < 4 ) { - $moder = 2; +if ($u->info['align'] > 3 && $u->info['align'] < 4) { + $moder = 2; } -if($inf['level'] < 8 && $inf['admin'] == 0 && $u->info['admin'] == 0 && $moder == 0) { -?> -
    -

    8

    -info['admin'] == 0 && $moder == 0) { + ?> +
    +

    8

    + +

    1) { + echo ' ' . date('d.m.Y H:i', $inf['info_delete']) . '.'; + } else { + echo '.'; + } ?>

    + info['align'] > 1 && $u->info['align'] < 2 || $u->info['align'] > 3 && $u->info['align'] < 4 || $u->info['admin'] > 0) { + echo '
    '; + } +} +if ($inf['info_delete'] == 0 || (($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4) || $u->info['admin'] > 0)) { ?> -

    1){ echo ' '.date('d.m.Y H:i',$inf['info_delete']).'.'; }else{ echo '.'; } ?>

    -info['align']>1 && $u->info['align']<2 || $u->info['align']>3 && $u->info['align']<4 || $u->info['admin']>0) - { - echo '
    '; - } -} -if($inf['info_delete']==0 || (($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4) || $u->info['admin']>0)) -{ -?> -
    -
    -

    - -:
    -: -
    - -:
    -0 && $inf['icq_hide']==0){ echo 'ICQ: '.$inf['icq'].'
    '; } ?> -Skype: '.$inf['skype'].'
    '; } ?> -4) { -$url = ((substr($inf['homepage'],0,4)=='https'?"":"https://").$inf['homepage']); -?> - :
    - -:
    - - / :
    -',$inf['hobby']); - } - if($inf['info_delete']!=0) - { - echo '
    '; - } -} -echo '

    '.$c['counters_noFrm'].'
    '; -?> +
    +
    +

    + + :
    + : +
    + + :
    + 0 && $inf['icq_hide'] == 0) { + echo 'ICQ: ' . $inf['icq'] . '
    '; + } ?> + Skype: ' . $inf['skype'] . '
    '; + } ?> + 4) { + $url = ((substr($inf['homepage'], 0, 4) == 'https' ? "" : "https://") . $inf['homepage']); + ?> + : +
    + + :
    + + / :
    + ', $inf['hobby']); + } + if ($inf['info_delete'] != 0) { + echo '
    '; + } + } + echo '

    ' . $c['counters_noFrm'] . '
    '; + ?>

    -
    -

    +
    +

    diff --git a/info.php b/info.php deleted file mode 100644 index 9c2c6a98..00000000 --- a/info.php +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/infoPHP.php b/infoPHP.php deleted file mode 100644 index eb31727b..00000000 --- a/infoPHP.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/item_edit_data.php b/item_edit_data.php index d33dd05d..6dad0f69 100644 --- a/item_edit_data.php +++ b/item_edit_data.php @@ -1,4 +1,5 @@ info['admin'] > 0 ) { - - $itm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.mysql_real_escape_string($_GET['edit_item_data']).'" LIMIT 1')); - if(isset($itm['id'])) { - if(isset($_POST['newdata'])) { - mysql_query('UPDATE `items_main_data` SET `data` = "'.mysql_real_escape_string($_POST['newdata']).'" WHERE `id` = "'.mysql_real_escape_string($itm['id']).'" LIMIT 1'); - die(''); - } - echo '
    : '.$itm['items_id'].'

    '; - } -}else{ - header('location: https://new-combats.com/'); +if (!$u->info['admin']) { + header('location: https://new-combats.com/'); + exit(); +} +$itm = mysql_fetch_array( + mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = ' . (int)$_GET['edit_item_data']) +); +if (isset($itm['id'])) { + if (isset($_POST['newdata'])) { + mysql_query( + 'UPDATE `items_main_data` SET `data` = "' . mysql_real_escape_string( + $_POST['newdata'] + ) . '" WHERE `id` = "' . mysql_real_escape_string($itm['id']) . '" LIMIT 1' + ); + die(''); + } + echo '
    : ' . $itm['items_id'] . '

    '; } - -?> \ No newline at end of file diff --git a/items_editor.php b/items_editor.php index 9a33f346..70e9dadb 100644 --- a/items_editor.php +++ b/items_editor.php @@ -1,4 +1,5 @@ info['admin'] == 0 ) { - header('location: /index.php'); +if (!$u->info['admin']) { + header('location: /index.php'); } -if( isset($_POST['it_name']) ) { - // - $error = ''; - -/* -Array -( -[it_name] => - - -[it_img] => old/kastet2.gif -[it_type] => 18 -[it_massa] => 2 -[it_price1] => 3 -[it_price2] => -[it_iznos] => 20 -[it_slot] => 3 -[it_inRazdel] => 1 -[it_info] => -[it_group_max] => -[it_geni] => 1 -[it_srok] => -[it_max_text] => -[it_ndata] => -[it_data_value] => |sv_minAtack=2|sv_maxAtack=4 -[button] => -) -*/ - - if( (int)$_POST['it_group_max'] > 0 ) { - $_POST['it_group'] = 1; - } - - $ins = mysql_query('INSERT INTO `items_main` +if (isset($_POST['it_name'])) { + // + $error = ''; + + /* + Array + ( + [it_name] => - - + [it_img] => old/kastet2.gif + [it_type] => 18 + [it_massa] => 2 + [it_price1] => 3 + [it_price2] => + [it_iznos] => 20 + [it_slot] => 3 + [it_inRazdel] => 1 + [it_info] => + [it_group_max] => + [it_geni] => 1 + [it_srok] => + [it_max_text] => + [it_ndata] => + [it_data_value] => |sv_minAtack=2|sv_maxAtack=4 + [button] => + ) + */ + + if ((int)$_POST['it_group_max'] > 0) { + $_POST['it_group'] = 1; + } + + $ins = mysql_query( + 'INSERT INTO `items_main` (`name`,`img`,`type`,`massa`,`price1`,`price2`,`iznosMAXi`,`inslot`, `inRazdel`,`info`,`group`,`group_max`,`geni`,`srok`,`max_text`,`2h`,`2too`) VALUES ( - "'.mysql_real_escape_string($_POST['it_name']).'", - "'.mysql_real_escape_string($_POST['it_img']).'", - "'.mysql_real_escape_string($_POST['it_type']).'", - "'.mysql_real_escape_string($_POST['it_massa']).'", - "'.mysql_real_escape_string($_POST['it_price1']).'", - "'.mysql_real_escape_string($_POST['it_price2']).'", - "'.mysql_real_escape_string($_POST['it_iznos']).'", - "'.mysql_real_escape_string($_POST['it_slot']).'", - "'.mysql_real_escape_string($_POST['it_inRazdel']).'", - "'.mysql_real_escape_string($_POST['it_info']).'", - "'.mysql_real_escape_string($_POST['it_group']).'", - "'.mysql_real_escape_string($_POST['it_group_max']).'", - "'.mysql_real_escape_string($_POST['it_geni']).'", - "'.mysql_real_escape_string($_POST['it_srok']).'", - "'.mysql_real_escape_string($_POST['it_max_text']).'", - "'.mysql_real_escape_string($_POST['it_2h']).'", - "'.mysql_real_escape_string($_POST['it_2too']).'" - )'); - - if( $ins ) { - $iid = mysql_insert_id(); - $ins = mysql_query('INSERT INTO `items_main_data` (`items_id`,`data`) VALUES ( - "'.$iid.'","'.mysql_real_escape_string($_POST['it_data_value']).'" - )'); - if( !$ins ) { - $error = ' Er::(2)!'; - }else{ - $error = $iid.' !'; - } - }else{ - $error = ' Er::(1)!'; - } - - - if( $error == '' ) { - $error = '- ...'; - } - die(''.$error.''); + "' . mysql_real_escape_string($_POST['it_name']) . '", + "' . mysql_real_escape_string($_POST['it_img']) . '", + "' . mysql_real_escape_string($_POST['it_type']) . '", + "' . mysql_real_escape_string($_POST['it_massa']) . '", + "' . mysql_real_escape_string($_POST['it_price1']) . '", + "' . mysql_real_escape_string($_POST['it_price2']) . '", + "' . mysql_real_escape_string($_POST['it_iznos']) . '", + "' . mysql_real_escape_string($_POST['it_slot']) . '", + "' . mysql_real_escape_string($_POST['it_inRazdel']) . '", + "' . mysql_real_escape_string($_POST['it_info']) . '", + "' . mysql_real_escape_string($_POST['it_group']) . '", + "' . mysql_real_escape_string($_POST['it_group_max']) . '", + "' . mysql_real_escape_string($_POST['it_geni']) . '", + "' . mysql_real_escape_string($_POST['it_srok']) . '", + "' . mysql_real_escape_string($_POST['it_max_text']) . '", + "' . mysql_real_escape_string($_POST['it_2h']) . '", + "' . mysql_real_escape_string($_POST['it_2too']) . '" + )' + ); + + if ($ins) { + $iid = mysql_insert_id(); + $ins = mysql_query( + 'INSERT INTO `items_main_data` (`items_id`,`data`) VALUES ( + "' . $iid . '","' . mysql_real_escape_string($_POST['it_data_value']) . '" + )' + ); + if (!$ins) { + $error = ' Er::(2)!'; + } else { + $error = $iid . ' !'; + } + } else { + $error = ' Er::(1)!'; + } + + + if ($error == '') { + $error = '- ...'; + } + die('' . $error . ''); } - // +// ?> - - - - - + - + // + if (this.it_data_pr.tr != undefined) { + var i = 0; + while (i <= this.it_data_pr.tr) { + var npar = $('#par_tr_' + i).val(); + if (npar != undefined && $('#val_tr_' + i).val() != '') { + html += '|tr_' + npar + '=' + $('#val_tr_' + i).val(); + } + i++; + } + } + // + if (this.it_data_pr.add != undefined) { + var i = 0; + while (i <= this.it_data_pr.add) { + var npar = $('#par_add_' + i).val(); + if (npar != undefined && $('#val_add_' + i).val() != '') { + html += '|add_' + npar + '=' + $('#val_add_' + i).val(); + } + i++; + } + } + // + if (this.it_data_pr.sv != undefined) { + var i = 0; + while (i <= this.it_data_pr.sv) { + var npar = $('#par_sv_' + i).val(); + if (npar != undefined && $('#val_sv_' + i).val() != '') { + html += '|sv_' + npar + '=' + $('#val_sv_' + i).val(); + } + i++; + } + } + // + if (this.it_data_pr.all != undefined) { + var i = 0; + while (i <= this.it_data_pr.all) { + var npar = $('#par_all_' + i).val(); + if (npar != undefined && $('#val_all_' + i).val() != '') { + html += '|' + npar + '=' + $('#val_all_' + i).val(); + } + i++; + } + } + + $('#it_data_value').val(html); + }, + it_data_pr: {}, + newpar: function (id) { + var html = ''; + if (this.it_data_pr[id] == undefined) { + this.it_data_pr[id] = 0; + } else { + this.it_data_pr[id]++; + } + + html += ''; + + html = '
        x     ' + html + '
    '; + $('#it_data_' + id).html($('#it_data_' + id).html() + html); + }, + delpar: function (id, num) { + $('#new_par_' + id + '_' + num + '').remove(); + }, + compl: function () { + var html = '', html_l = '', html_r = ''; + + // + this.data = { + 'name': $('#it_name').val(), + 'img': $('#it_img').val() + + }; + + // + html_l += ''; + + // + html_r = '' + this.data.name + ''; + + // + html = '' + + '' + + '' + + '' + + '
    ' + + '' + + '' + + '' + + '' + + '' + + '
    ' + html_l + '' + html_r + '
    ' + + '
    '; + + $('#etitm').html(html); + } + }; + + - - - - -
    - - - - + - - -
      - +
    + + + + + + +
      + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    ()
    ()
    (.)
    . ()
    .
    ITEMS_MAIN_DATA:
    + +
      
    +
    +
    +
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    ()
    ()
    (.)
    . ()
    .
    ITEMS_MAIN_DATA:
    - -
      
    -
    +
    + +
    + + : [+] +
    + +
    + + : [+] +
    + +
    + + : [+] +
    + +
    + + : [+] +
    + +
    + +
    +   +
    - -
    - -
    - - : [+] -
    - -
    - - : [+] -
    - -
    - - : [+] -
    - -
    - - : [+] -
    - -
    - -
    -   -
    -
    + + \ No newline at end of file diff --git a/items_info.php b/items_info.php index 971fe933..174428e5 100644 --- a/items_info.php +++ b/items_info.php @@ -1,10 +1,15 @@ 22, 67 => 28, // 67 32 => 22, // 32 , . - 34 => 28 // 34 , + 34 => 28, // 34 , ]; /* */ if (isset($_COOKIE['login'])) { - $u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`banned` FROM `users` WHERE `login` = "' . mysql_real_escape_string($_COOKIE['login']) . '" AND `pass` = "' . mysql_real_escape_string($_COOKIE['pass']) . '" LIMIT 1')); + $u = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login`,`banned` FROM `users` WHERE `login` = "' . mysql_real_escape_string( + $_COOKIE['login'] + ) . '" AND `pass` = "' . mysql_real_escape_string($_COOKIE['pass']) . '" LIMIT 1' + ) + ); } /* */ -$itm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($_GET['id']) . '" LIMIT 1')); +$itm = mysql_fetch_array( + mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($_GET['id']) . '" LIMIT 1') +); function timeOut($ttm) @@ -162,6 +175,7 @@ function timeOut($ttm) function lookStats($m) { + if (empty($m)) return []; $ist = []; $di = explode('|', $m); $i = 0; @@ -180,436 +194,28 @@ function lookStats($m) } if (!isset($itm['id'])) { - $itd = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . mysql_real_escape_string($_GET['id']) . '" LIMIT 1')); + $itd = mysql_fetch_array( + mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = ' . mysql_real_escape_string($_GET['id'])) + ); if (!isset($itd['id'])) { $itd = []; } else { $itd = lookStats($itd['data']); } } else { - $itd = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . mysql_real_escape_string($itm['id']) . '" LIMIT 1')); + $itd = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = ' . $itm['id'])); $itd = lookStats($itd['data']); } $items = [ - 'tr' => [ - 'lvl', - 's1', - 's2', - 's3', - 's4', - 's5', - 's6', - 's7', - 's8', - 's9', - 's10', - 'a1', - 'a2', - 'a3', - 'a4', - 'a5', - 'a6', - 'a7', - 'mg1', - 'mg2', - 'mg3', - 'mg4', - 'mg5', - 'mg6', - 'mg7', - 'mall', - 'm2all', - 'aall', - ], - 'add' => [ - 'min_heal_proc', - 'no_yv1', - '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', - 's1', - 's2', - 's3', - 's4', - 's5', - 's6', - 's7', - 's8', - 's9', - 's10', - 'aall', - 'a1', - 'a2', - 'a3', - 'a4', - 'a5', - 'a6', - 'a7', - 'm2all', - 'mall', - 'mg1', - 'mg2', - 'mg3', - 'mg4', - 'mg5', - 'mg6', - 'mg7', - 'hpAll', - 'mpAll', - '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', - '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', - 'speed_dungeon', - 'antm3', - ], - 'sv' => [ - 'pza', - 'pza1', - 'pza2', - 'pza3', - 'pza4', - 'notravma', - 'min_zonb', - 'min_zona', - 'nokrit', - 'pog', - 'min_use_mp', - 'za1proc', - 'za2proc', - 'za3proc', - 'za4proc', - 'zaproc', - 'zmproc', - 'zm1proc', - 'zm2proc', - 'zm3proc', - 'zm4proc', - 'shopSale', - 's1', - 's2', - 's3', - 's4', - 's5', - 's6', - 's7', - 's8', - 's9', - 's10', - 'aall', - 'a1', - 'a2', - 'a3', - 'a4', - 'a5', - 'a6', - 'a7', - 'm2all', - 'mall', - 'mg1', - 'mg2', - 'mg3', - 'mg4', - 'mg5', - 'mg6', - 'mg7', - 'hpAll', - 'mpAll', - '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', - 'free_stats', - 'tya1', - 'tya2', - 'tya3', - 'tya4', - 'tym1', - 'tym2', - 'tym3', - 'tym4', - 'tym5', - 'tym6', - 'tym7', - ], + 'tr' => ['lvl', 's1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'mg1', 'mg2', 'mg3', 'mg4', 'mg5', 'mg6', 'mg7', 'mall', 'm2all', 'aall'], + 'add' => ['min_heal_proc', 'no_yv1', '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', 's1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 'aall', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'm2all', 'mall', 'mg1', 'mg2', 'mg3', 'mg4', 'mg5', 'mg6', 'mg7', 'hpAll', 'mpAll', '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', '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', 'speed_dungeon', 'antm3'], + 'sv' => ['pza', 'pza1', 'pza2', 'pza3', 'pza4', 'notravma', 'min_zonb', 'min_zona', 'nokrit', 'pog', 'min_use_mp', 'za1proc', 'za2proc', 'za3proc', 'za4proc', 'zaproc', 'zmproc', 'zm1proc', 'zm2proc', 'zm3proc', 'zm4proc', 'shopSale', 's1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 'aall', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'm2all', 'mall', 'mg1', 'mg2', 'mg3', 'mg4', 'mg5', 'mg6', 'mg7', 'hpAll', 'mpAll', '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', 'free_stats', 'tya1', 'tya2', 'tya3', 'tya4', 'tym1', 'tym2', 'tym3', 'tym4', 'tym5', 'tym6', 'tym7'], ]; -$is = [ - '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' => '. . ', -]; +$is = ['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')) { //subject $rz[$rt[$itm['type']]][0] = 'subject'; } @@ -623,9 +229,8 @@ if (!isset($rz[$rt[$itm['type']]][1])) { - | <? - if (isset($itm['id'])) { ?> | <?= $rz[$rt[$itm['type']]][1] ?> | <?= $itm['name'] ?><? - } ?> + | + <? if (isset($itm['id'])) { ?> | <?= $rz[$rt[$itm['type']]][1] ?> | <?= $itm['name'] ?><? } ?> + + : + + + + + + + + + - + \ No newline at end of file diff --git a/lotowork.php b/lotowork.php index c14850d7..12f1bdda 100644 --- a/lotowork.php +++ b/lotowork.php @@ -1,39 +1,28 @@ '.$_SERVER['SERVER_ADDR']); - } -*/ - -define('GAME',true); +const GAME = true; include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); +$u = User::start(); $body = file_get_contents('php://input'); -$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$body.'" LIMIT 1')); -$titm = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$body.'" AND `vals` = "loto" AND `time` > '.(time()-24*60*60).' ORDER BY `time` DESC LIMIT 1')); -if(isset($user) && $user['id']==$u->info['id'] ) -{ - if ($titm==false) - { - // > t1 42% > t2 25% > t3 15% > t4 10% > t5 5% > t6 3% - /*$droplist = array( - 0=>4514, t1 +$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $body . '" LIMIT 1')); +$titm = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `actions` WHERE `uid` = "' . $body . '" AND `vals` = "loto" AND `time` > ' . (time( + ) - 24 * 60 * 60) . ' ORDER BY `time` DESC LIMIT 1' + ) +); +if (!isset($user) || $user['id'] != $u->info['id']) { + echo "No user!"; +} elseif ($titm) { + echo "Wait asign!"; +} else { + // > t1 42% > t2 25% > t3 15% > t4 10% > t5 5% > t6 3% + /*$droplist = array( + 0=>4514, t1 1=>4515, t1 - 2=>4688, t1 + 2=>4688, t1 3=>4689, t1 4=>4690, t1 5=>5009, t2 @@ -51,129 +40,108 @@ if(isset($user) && $user['id']==$u->info['id'] ) 17=>6114, t4 18=>6115, t4 19=>6116, t4 - 20=>6360, t6 + 20=>6360, t6 21=>6462, t5 22=>5022, t6 - 23=>5023, t6 - 24=>6445, t5 + 23=>5023, t6 + 24=>6445, t5 25=>6455, t3 26=>10009, t4 27=>1032, t1 28=>1031, t1 29=>1034 t1 - );*/ - $nrnd=rand(1,100); - if ($nrnd <= 1) //t6 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t6"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t6"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - elseif (($nrnd-1) <= 5) // t5 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t5"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t5"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - elseif (($nrnd-1-5) <= 7) // t4 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t4"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t4"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - elseif (($nrnd-1-5-7) <= 10) // t3 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t3"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t3"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - elseif (($nrnd-1-5-7-10) <= 15) // t2 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t2"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t2"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - else // t1 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t1"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t1"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } + );*/ + $nrnd = rand(1, 100); + if ($nrnd <= 1) //t6 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t6"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t6"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } elseif (($nrnd - 1) <= 5) // t5 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t5"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t5"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } elseif (($nrnd - 1 - 5) <= 7) // t4 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t4"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t4"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } elseif (($nrnd - 1 - 5 - 7) <= 10) // t3 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t3"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t3"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } elseif (($nrnd - 1 - 5 - 7 - 10) <= 15) // t2 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t2"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t2"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } else // t1 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t1"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t1"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } - if (isset($droplist['id'])) - { - $idve=$droplist['idgame']; - $u->addItem($idve,$user['id'],'|frompisher=1|nosale=1'.$user['login']); - $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$idve.'" LIMIT 1')); - $titm = mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("'.$user['id'].'","'.time().'","'.loto.'","'.$user['room'].'","'.$idve.'","'.mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']).'","loto")'); - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES (" '.$user['login'].' '.$inf['name'].'!","capitalcity","","6","1","'.time().'")'); - echo $droplist['id']; // - } - else - { - echo 'Error'; - } - } - else - { - echo "Wait asign!"; - } -} -else -{ - echo "No user!"; + if (!isset($droplist['id'])) { + echo 'Error'; + } else { + $idve = $droplist['idgame']; + $u->addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']); + $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $idve . '" LIMIT 1')); + $titm = mysql_query( + 'INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("' . $user['id'] . '","' . time( + ) . '","' . loto . '","' . $user['room'] . '","' . $idve . '","' . mysql_real_escape_string( + $_SERVER['HTTP_X_REAL_IP'] + ) . '","loto")' + ); + mysql_query( + 'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES (" ' . $user['login'] . ' ' . $inf['name'] . '!","capitalcity","","6","1","' . time( + ) . '")' + ); + echo $droplist['id']; // + } } diff --git a/lotoworkekr.php b/lotoworkekr.php index e0da64f6..b9523445 100644 --- a/lotoworkekr.php +++ b/lotoworkekr.php @@ -1,166 +1,120 @@ '.$_SERVER['SERVER_ADDR']); - } -*/ - -define('GAME',true); +const GAME = true; include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); - +$u = User::start(); $body = file_get_contents('php://input'); -$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$body.'" LIMIT 1')); -if ($body == 'ekr') -{ - echo $u->info['money2']; - die(); +$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $body . '" LIMIT 1')); +if ($body == 'ekr') { + echo $u->info['money2']; + die(); } - -if(isset($user) && $user['id']==$u->info['id']) -{ - if ($user['money2']>=5) - { - $nrnd=rand(1,100); - if ($nrnd <= 1) //t6 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t6"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t6"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - elseif (($nrnd-1) <= 7) // t5 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t5"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t5"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - elseif (($nrnd-1-7) <= 10) // t4 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t4"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t4"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - elseif (($nrnd-1-7-10) <= 15) // t3 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t3"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t3"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - elseif (($nrnd-1-7-10-15) <= 25) // t2 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t2"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t2"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - else // t1 - { - $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t1"'); - $y=mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t1"')); - $rndt=rand(0,$y['COUNT']-1); - $i=0; - while($pl = mysql_fetch_array($droplistt)) - { - if($i==$rndt) - { - $droplist = $pl; - } - $i++; - } - } - if (isset($droplist['id'])) - { - $idve=$droplist['idgame']; - $u->addItem($idve,$user['id'],'|frompisher=1|nosale=1'.$user['login']); - $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$idve.'" LIMIT 1')); - //$titm = mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("'.$user['id'].'","'.time().'","'.loto.'","'.$user['room'].'","'.$idve.'","'.mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']).'","loto")'); - $u->info['money2'] = $u->info['money2'] - 5; - mysql_query('UPDATE `users` SET `money2`= `money2` - 5 WHERE `id` = "'.$u->info['id'].'"'); - if ($droplist['type']=="t6" || $droplist['type']=="t5") - { - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES (" '.$user['login'].' '.$inf['name'].'!","capitalcity","","6","1","'.time().'")'); - } - echo $droplist['id']; // - /*// - $array = array( - '1' => $droplist['id']', // 1 id - '2' => $u->info['money2'] // - ); - $json = json_encode($array); - echo $json;*/ - - } - else - { - echo 'Error'; - } - } - else - { - echo "No Ekr!"; - } -} -else -{ - echo "No user!"; +if (!isset($user) || $user['id'] != $u->info['id']) { + echo "No user!"; +} else { + if ($user['money2'] < 5) { + echo "No Ekr!"; + } else { + $nrnd = rand(1, 100); + if ($nrnd <= 1) //t6 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t6"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t6"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } elseif (($nrnd - 1) <= 7) // t5 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t5"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t5"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } elseif (($nrnd - 1 - 7) <= 10) // t4 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t4"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t4"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } elseif (($nrnd - 1 - 7 - 10) <= 15) // t3 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t3"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t3"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } elseif (($nrnd - 1 - 7 - 10 - 15) <= 25) // t2 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t2"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t2"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } else // t1 + { + $droplistt = mysql_query('SELECT * FROM `loto` WHERE `type` = "t1"'); + $y = mysql_fetch_array(mysql_query('SELECT COUNT(`type`) AS `COUNT` FROM `loto` WHERE `type` = "t1"')); + $rndt = rand(0, $y['COUNT'] - 1); + $i = 0; + while ($pl = mysql_fetch_array($droplistt)) { + if ($i == $rndt) { + $droplist = $pl; + } + $i++; + } + } + if (!isset($droplist['id'])) { + echo 'Error'; + } else { + $idve = $droplist['idgame']; + $u->addItem($idve, $user['id'], '|frompisher=1|nosale=1' . $user['login']); + $inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $idve . '" LIMIT 1')); + $u->info['money2'] = $u->info['money2'] - 5; + mysql_query('UPDATE `users` SET `money2`= `money2` - 5 WHERE `id` = "' . $u->info['id'] . '"'); + if ($droplist['type'] == "t6" || $droplist['type'] == "t5") { + mysql_query( + 'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES (" ' . $user['login'] . ' ' . $inf['name'] . '!","capitalcity","","6","1","' . time( + ) . '")' + ); + } + echo $droplist['id']; // + /*// + $array = array( + '1' => $droplist['id']', // 1 id + '2' => $u->info['money2'] // + ); + $json = json_encode($array); + echo $json;*/ + } + } } diff --git a/mail.php b/mail.php index 354b0c31..1b79cf0f 100644 --- a/mail.php +++ b/mail.php @@ -1,173 +1,202 @@ - 0'); + while ($pl = mysql_fetch_array($sp)) { + if (!isset($yes[$pl['mail']])) { + $yes[$pl['mail']] = true; + $mail[] = $pl['mail']; + } + } + $mail[] = 'support@new-combats.com'; + $sp = mysql_query('SELECT * FROM `users_kill`'); + while ($pl = mysql_fetch_array($sp)) { + if (!isset($yes[$pl['mail']])) { + $yes[$pl['mail']] = true; + $mail[] = $pl['mail']; + } + } + $sp = mysql_query('SELECT * FROM `beta_testers`'); + while ($pl = mysql_fetch_array($sp)) { + if (!isset($yes[$pl['mail']])) { + $yes[$pl['mail']] = true; + $mail[] = $pl['mail']; + } + } + $sp = mysql_query('SELECT * FROM `users_rbk`'); + while ($pl = mysql_fetch_array($sp)) { + if (!isset($yes[$pl['email']])) { + $yes[$pl['email']] = true; + $mail[] = $pl['email']; + } + } + + $e = explode(',', 'mails'); + $i = 0; + while ($i < count($e)) { + if (!isset($yes[$e[$i]])) { + $yes[$yes[$e[$i]]] = true; + $mail[] = $e[$i]; + } + $i++; + } + + $i = 0; + while ($i < count($mail)) { + echo $mail[$i] . '
    '; + $i++; + } -if( isset($_GET['list']) && $_GET['list'] == 2015 ) { - - $mail = array(); - $yes = array(); - $sp = mysql_query('SELECT * FROM `aaa_send_count`'); - while( $pl = mysql_fetch_array($sp) ) { - if(!isset($yes[$pl['mail']])) { - $yes[$pl['mail']] = true; - $mail[] = $pl['mail']; - } - } - $mail[] = 'support@new-combats.com'; - $sp = mysql_query('SELECT * FROM `users` WHERE `real` > 0'); - while( $pl = mysql_fetch_array($sp) ) { - if(!isset($yes[$pl['mail']])) { - $yes[$pl['mail']] = true; - $mail[] = $pl['mail']; - } - } - $mail[] = 'support@new-combats.com'; - $sp = mysql_query('SELECT * FROM `users_kill`'); - while( $pl = mysql_fetch_array($sp) ) { - if(!isset($yes[$pl['mail']])) { - $yes[$pl['mail']] = true; - $mail[] = $pl['mail']; - } - } - $sp = mysql_query('SELECT * FROM `beta_testers`'); - while( $pl = mysql_fetch_array($sp) ) { - if(!isset($yes[$pl['mail']])) { - $yes[$pl['mail']] = true; - $mail[] = $pl['mail']; - } - } - $sp = mysql_query('SELECT * FROM `users_rbk`'); - while( $pl = mysql_fetch_array($sp) ) { - if(!isset($yes[$pl['email']])) { - $yes[$pl['email']] = true; - $mail[] = $pl['email']; - } - } - - $e = explode(',','mails'); - $i = 0; - while( $i < count($e) ) { - if(!isset($yes[$e[$i]])) { - $yes[$yes[$e[$i]]] = true; - $mail[] = $e[$i]; - } - $i++; - } - - $i = 0; - while( $i < count($mail) ) { - echo $mail[$i] . '
    '; - $i++; - } - } $keymd5 = '$$$'; -if(isset($_GET['count'])) { - if( md5($keymd5.'+'.$_GET['count']) == $_GET['sd4'] ) { - $mail = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_send_count` WHERE `mail` = "'.mysql_real_escape_string($_GET['count']).'" LIMIT 1')); - if(isset($mail['id'])) { - mysql_query('UPDATE `aaa_send_count` SET `time` = "'.time().'",`ip` = "'.mysql_real_escape_string(IP).'" WHERE `id` = "'.$mail['id'].'" LIMIT 1'); - }else{ - mysql_query('INSERT INTO `aaa_send_count` (`mail`,`time`,`ip`) VALUES ( - "'.mysql_real_escape_string($_GET['count']).'","'.time().'","'.mysql_real_escape_string(IP).'" - )'); - } - echo '[SD4]'; - }else{ - echo '[ERROR_SD4_KEY]'; - } - die('[IMG]'); -}elseif(isset($_GET['uncancel'])) { - $mail = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_send_count` WHERE `mail` = "'.mysql_real_escape_string($_GET['uncancel']).'" LIMIT 1')); - if(isset($mail['id'])) { - mysql_query('UPDATE `aaa_send_count` SET `cancel` = "0",`time` = "'.time().'",`ip` = "'.mysql_real_escape_string(IP).'" WHERE `id` = "'.$mail['id'].'" LIMIT 1'); - echo '. '.htmlspecialchars($_GET['uncancel']).' !'; - }else{ - echo '. '.htmlspecialchars($_GET['uncancel']).' .'; - } - die(); -}elseif(isset($_GET['cancel'])) { - if( md5($keymd5.'+'.$_GET['cancel']) == $_GET['sd4'] ) { - $mail = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_send_count` WHERE `mail` = "'.mysql_real_escape_string($_GET['cancel']).'" LIMIT 1')); - if(isset($mail['id'])) { - if($mail['cancel'] > 0) { - echo ' : '.date('d.m.Y H:i:s',$mail['cancel']).', ? '; - }else{ - mysql_query('UPDATE `aaa_send_count` SET `cancel` = "'.time().'",`time` = "'.time().'",`ip` = "'.mysql_real_escape_string(IP).'" WHERE `id` = "'.$mail['id'].'" LIMIT 1'); - echo '. '.htmlspecialchars($_GET['cancel']).' !'; - } - }else{ - echo '. '.htmlspecialchars($_GET['cancel']).' .'; - } - }else{ - echo ' .. SD4 . '.htmlspecialchars($_GET['cancel']).'.. , support@new-combats.com'; - } - die(); +if (isset($_GET['count'])) { + if (md5($keymd5 . '+' . $_GET['count']) == $_GET['sd4']) { + $mail = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `aaa_send_count` WHERE `mail` = "' . mysql_real_escape_string( + $_GET['count'] + ) . '" LIMIT 1' + ) + ); + if (isset($mail['id'])) { + mysql_query( + 'UPDATE `aaa_send_count` SET `time` = "' . time() . '",`ip` = "' . mysql_real_escape_string( + IP + ) . '" WHERE `id` = "' . $mail['id'] . '" LIMIT 1' + ); + } else { + mysql_query( + 'INSERT INTO `aaa_send_count` (`mail`,`time`,`ip`) VALUES ( + "' . mysql_real_escape_string($_GET['count']) . '","' . time() . '","' . mysql_real_escape_string(IP) . '" + )' + ); + } + echo '[SD4]'; + } else { + echo '[ERROR_SD4_KEY]'; + } + die('[IMG]'); +} elseif (isset($_GET['uncancel'])) { + $mail = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `aaa_send_count` WHERE `mail` = "' . mysql_real_escape_string( + $_GET['uncancel'] + ) . '" LIMIT 1' + ) + ); + if (isset($mail['id'])) { + mysql_query( + 'UPDATE `aaa_send_count` SET `cancel` = "0",`time` = "' . time() . '",`ip` = "' . mysql_real_escape_string( + IP + ) . '" WHERE `id` = "' . $mail['id'] . '" LIMIT 1' + ); + echo '. ' . htmlspecialchars($_GET['uncancel']) . ' !'; + } else { + echo '. ' . htmlspecialchars($_GET['uncancel']) . ' .'; + } + die(); +} elseif (isset($_GET['cancel'])) { + if (md5($keymd5 . '+' . $_GET['cancel']) == $_GET['sd4']) { + $mail = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `aaa_send_count` WHERE `mail` = "' . mysql_real_escape_string( + $_GET['cancel'] + ) . '" LIMIT 1' + ) + ); + if (isset($mail['id'])) { + if ($mail['cancel'] > 0) { + echo ' : ' . date( + 'd.m.Y H:i:s', $mail['cancel'] + ) . ', ? '; + } else { + mysql_query( + 'UPDATE `aaa_send_count` SET `cancel` = "' . time() . '",`time` = "' . time( + ) . '",`ip` = "' . mysql_real_escape_string(IP) . '" WHERE `id` = "' . $mail['id'] . '" LIMIT 1' + ); + echo '. ' . htmlspecialchars($_GET['cancel']) . ' !'; + } + } else { + echo '. ' . htmlspecialchars($_GET['cancel']) . ' .'; + } + } else { + echo ' .. SD4 . ' . htmlspecialchars( + $_GET['cancel'] + ) . '.. , support@new-combats.com'; + } + die(); } -if(isset($_GET['send6102'])) { - // specify your email below and that's all ;) - $message = ' !'; - // *************************************** - - function sendmail($mail,$login) { - global $message, $keymd5; - // - $md5mail = md5($keymd5.'+'.$mail); - $message = str_replace('{mail}',$mail,$message); - $message = str_replace('{login}',$login,$message); - $message = str_replace('{md5mail}',$md5mail,$message); - // - $headers = "MIME-Version: 1.0\r\n"; - $headers .= "Content-type: text/html; charset=windows-1251\r\n"; - $headers .= "From: support@new-combats.com\r\n"; - // - $to = $mail; - // - $subject = ' '; - $message = ' e-mail '.$mail['name'].'.

    ,
    '; - // - if (mail($to, $subject, $message, $headers) == true) { - //return true; - echo '[Yes]'; - }else{ - //return false; - echo '[No]'; - } - } +if (isset($_GET['send6102'])) { + // specify your email below and that's all ;) + $message = ' !'; + // *************************************** - $mail = mysql_fetch_array(mysql_query('SELECT * FROM `users_rbk` WHERE `email` != "" AND `send` != 3 AND `email` NOT LIKE "%@1%" LIMIT 1')); - $x = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users_rbk` WHERE `email` != "" AND `send` != 3 AND `email` NOT LIKE "%@1%" LIMIT 1')); - $x = 0+$x[0]; - if(isset($mail['email'])) { - //$mail['email'] = 'difree@gmail.com'; - - sendmail($mail['email'],$mail['login']); - mysql_query('UPDATE `users_rbk` SET `send` = 3 WHERE `email` = "'.$mail['email'].'"'); - echo '['.$mail['email'].']
    e-mail '.$mail['name'].'.

    ,

    '; - echo '[+]'; - }else{ - echo '[-]'; - echo '['.$mail['email'].']'; - /*echo '[-]';*/ - } - die('
    : '.$x); - if( $k > 0 ) { - echo ''; - } - echo ' : '.$k.' / 100 . : '.(count($mails)-$k).'.
    50 !'; + function sendmail($mail, $login) + { + global $message, $keymd5; + // + $md5mail = md5($keymd5 . '+' . $mail); + $message = str_replace('{mail}', $mail, $message); + $message = str_replace('{login}', $login, $message); + $message = str_replace('{md5mail}', $md5mail, $message); + // + $headers = "MIME-Version: 1.0\r\n"; + $headers .= "Content-type: text/html; charset=windows-1251\r\n"; + $headers .= "From: support@new-combats.com\r\n"; + // + $to = $mail; + // + $subject = ' '; + $message = ' e-mail ' . $mail['name'] . '.

    ,
    '; + // + if (mail($to, $subject, $message, $headers) == true) { + //return true; + echo '[Yes]'; + } else { + //return false; + echo '[No]'; + } + } + + $mail = mysql_fetch_array( + mysql_query('SELECT * FROM `users_rbk` WHERE `email` != "" AND `send` != 3 AND `email` NOT LIKE "%@1%" LIMIT 1') + ); + $x = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(*) FROM `users_rbk` WHERE `email` != "" AND `send` != 3 AND `email` NOT LIKE "%@1%" LIMIT 1' + ) + ); + $x = 0 + $x[0]; + if (isset($mail['email'])) { + //$mail['email'] = 'difree@gmail.com'; + + sendmail($mail['email'], $mail['login']); + mysql_query('UPDATE `users_rbk` SET `send` = 3 WHERE `email` = "' . $mail['email'] . '"'); + echo '[' . $mail['email'] . ']
    e-mail ' . $mail['name'] . '.

    ,

    '; + echo '[+]'; + } else { + echo '[-]'; + echo '[' . $mail['email'] . ']'; + + } + die('
    : ' . $x); } -?> \ No newline at end of file diff --git a/mailconf.php b/mailconf.php index 638bb057..acb973a0 100644 --- a/mailconf.php +++ b/mailconf.php @@ -1,50 +1,42 @@ -'.$_GET['mail'].'.'; - }else{ - // - $mcf = mysql_fetch_array(mysql_query('SELECT * FROM `mini_actions` WHERE `var` = "'.mysql_real_escape_string($_GET['mail']).'" LIMIT 1')); - $user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$mcf['uid'].'" LIMIT 1')); - // - if(!isset($user['id'])) { - echo ' . '.$_GET['mail'].' .'; - }else{ - $bank = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `uid` = "'.$mcf['uid'].'" ORDER BY `id` DESC LIMIT 1')); - if($mcf['ok'] > 0) { - echo ' E-mail ! '.date('d.m.Y H:i:s',$mcf['ok']).''; - }elseif(!isset($bank['id'])) { - echo ' , 1 .'; - }else{ - // - mysql_query('UPDATE `mini_actions` SET `ok` = "'.time().'" WHERE `id` = "'.$mcf['id'].'" LIMIT 1'); - mysql_query('UPDATE `bank` SET `money2` = `money2` + 1 WHERE `id` = "'.$bank['id'].'" LIMIT 1'); - // - echo ' . '.$_GET['mail'].', '.$user['login'].' 1 .'; - } - } - } -}else{ - echo 'E-mail .'; +const GAME = true; +require_once('_incl_data/__config.php'); +require_once('_incl_data/class/__db_connect.php'); +define('IP', UserIp::get()); + +if (isset($_GET['mail'])) { + $key = md5('mailconf*15+' . $_GET['mail']); + if ($_GET['key'] != $key) { + echo ' , E-mail: admin@new-combats.com'; + } elseif (isset($_GET['cancel'])) { + // + echo ' .: ' . $_GET['mail'] . '.'; + } else { + // + $mcf = Db::getRow('select * from mini_actions where var = ?', [$_GET['mail']]); + $user = Db::getRow('select * from users where id = ?', [$mcf['uid']]); + // + if (!isset($user['id'])) { + echo ' . ' . $_GET['mail'] . ' .'; + } else { + $bank = Db::getRow('select * from bank where uid = (select uid from mini_actions where var = ?) order by id desc limit 1', [$_GET['mail']]); + if ($mcf['ok'] > 0) { + echo ' E-mail ! ' . date('d.m.Y H:i:s', $mcf['ok']) . ''; + } elseif (!isset($bank['id'])) { + echo ' , 1 .'; + } else { + Db::sql('update mini_actions set ok = unix_timestamp() where id = ?', [$mcf['id']]); + Db::sql('update bank set money2 = money2 + 1 where id = ?', [$bank['id']]); + echo ' . ' . $_GET['mail'] . ', ' . $user['login'] . ' 1 .'; + } + } + } +} else { + echo 'E-mail .'; } echo '

    - - - - - - -

    ,
    © new-combats.com'; -?> \ No newline at end of file diff --git a/main.php b/main.php index 5e2e1042..9e8adecc 100644 --- a/main.php +++ b/main.php @@ -24,47 +24,43 @@ } +
    \n"; var_dump($vars); echo "\n"; - if ($d) exit(); + if ($d) { + exit(); + } } -define('IP', GetRealIp()); - +const GAME = true; require_once('_incl_data/__config.php'); -define('GAME', true); -require_once('_incl_data/class/__db_connect.php'); +//require_once('_incl_data/class/__db_connect.php'); +$pdo = \Core\Database::init(); +define('IP', UserIp::get()); date_default_timezone_set('Europe/Moscow'); -require_once('_incl_data/class/__magic.php'); -require_once('_incl_data/class/__user.php'); -require_once('_incl_data/class/__filter_class.php'); -require_once('_incl_data/class/__quest.php'); +$magic = new Magic(); +$u = User::start(); +$filter = new Filter(); +$q = new Quests; /** , . */ -Db::exec('update stats set +Db::exec( + 'update stats set hpNow = hpAll, mpNow = mpAll where - id in (select id from users where bot = 2 and battle = 0)'); + id in (select id from users where bot = 2 and battle = 0)' +); if ($u->info['banned'] > 0) { header('location: /index.php'); @@ -93,37 +89,35 @@ if ($u->room['file'] == "room_hostel" || $u->room['file'] == "post") { #-------- , if ($u->info['online'] < time() - 60 || $u->info['afk'] != '') { - $filter->setOnline($u->info['8'], $u->info['id'], 0); + $filter->setOnline($u->info['8'], $u->info['id']); $u->onlineBonus(); - mysql_query("UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time() . "',`afk`='' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"); + 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"); + 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 ($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 ($u->info['battle_text'] != '' && $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['mAjax']) and !isset($_GET['ajaxHostel'])) - echo ' - - - - - - - - - - -'; +if (!isset($_GET['mAjax']) && !isset($_GET['ajaxHostel'])) { + echo ' +
    '; +} $act = -2; $act2 = 0; $u->stats = $u->getStats($u->info['id'], 0); @@ -141,10 +135,20 @@ $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 + $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')); + `time_finish` > ' . time() . ' LIMIT 1' + ) + ); unset($ua); if (isset($cruw['id'])) { $cruw = $cruw['type']; @@ -152,10 +156,29 @@ if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] ! $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')); + $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) { @@ -173,7 +196,11 @@ if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] ! $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')); + $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; } @@ -201,9 +228,13 @@ if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] ! $ua['type_pers'] = 500; } - mysql_query('UPDATE `stats` SET `hpNow` = "' . $usta['hpNow'] . '",`mpNow` = "' . $usta['mpNow'] . '" WHERE `id` = "' . $usta['id'] . '" LIMIT 1'); + 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']); + $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]] "' . $u->info['login'] . '" ' . $sx . ' "' . $ua['login'] . '".'; @@ -212,7 +243,10 @@ if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] ! } 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')"); + 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'); @@ -238,24 +272,19 @@ 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; - } + define('IP', UserIp::get()); - define('IP', GetRealIp()); - if (isset($_POST['renpass']) && $_POST['renpass'] == $_POST['renpass2'] && md5($_POST['renpass']) != $u->info['pass']) { + 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 `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('! ip %' . $u->info['ip'] . '.
    IP, . !
    '); @@ -268,7 +297,8 @@ if ($u->info['repass'] > 0) { echo '! .'; } } - die('


    !
    , 2 .



    + die( + '


    !
    , 2 .



    @@ -278,13 +308,18 @@ if ($u->info['repass'] > 0) {
    -
    '); +
    ' + ); } } /*-----------------------*/ 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')); + $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) { require_once('modules_data/btl_.php'); @@ -329,7 +364,9 @@ if (isset($btl_last['id']) && $u->info['battle'] == 0) { if ($u->info['allLock'] < time()) { $u->deleteItem(intval($_GET['delete']), $u->info['id']); } else { - echo ''; + echo ''; } } elseif (isset($_GET['unstack']) && isset($_GET['inv']) && $u->newAct($_GET['sd4'])) { $u->unstack(intval($_GET['unstack']), intval($_GET['unstackCount'])); @@ -365,9 +402,7 @@ if ($act != -2) { } /*-----------------------*/ -if (isset($_GET['worklist']) && $u->info['admin'] > 0) { - require_once('modules_data/worklist.php'); -} elseif (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) { +if (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) { require_once('modules_data/_changepass.php'); } elseif ($u->info['level'] >= 0 && isset($_GET['friends']) && !isset($u->tfer['id'])) { require_once('modules_data/_friends.php'); @@ -417,7 +452,7 @@ if (isset($_GET['worklist']) && $u->info['admin'] > 0) { die(); } require_once('modules_data/_alhp.php'); -// + // } elseif (isset($_GET['bukmeker']) && $u->info['level'] > 0 && !isset($u->tfer['id'])) { require_once('modules_data/_bukmeker.php'); // @@ -445,7 +480,8 @@ if (isset($_GET['worklist']) && $u->info['admin'] > 0) { "; if ($u->info['dnow'] > 0) { - require_once('_incl_data/class/__dungeon.php'); + $d = new Dungeon; + $d->start(); } require_once('modules_data/_dialog.php'); } elseif (isset($_GET['inv']) && !isset($u->tfer['id']) && $trololo == 1) { @@ -461,7 +497,9 @@ if (isset($_GET['worklist']) && $u->info['admin'] > 0) { } 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()) { require_once('modules_data/_locations.php'); - echo ''; + echo ''; } else { require_once('modules_data/_transfers.php'); } @@ -478,30 +516,19 @@ if (isset($_GET['worklist']) && $u->info['admin'] > 0) { } } -/** - * . - * PHP Fatal error: Call to a member function testquest() on a non-object - * , . . 09.06.22 - */ // -if (in_array($u->room['file'], [ - 'dungeon_enter', - 'dungeon_enter_all', - 'enterbezdna', - 'entercat', - 'enterdrago', - 'entergrib', - 'enternizin', - 'enterptp', - 'house_belaun', - 'dungeon' -])) { +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'] . '"'); +$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'])) { @@ -527,20 +554,30 @@ while ($pl = mysql_fetch_array($sp)) { if ($pl['time'] + 86400 < time()) { // $glid = 1; - mysql_query('UPDATE `items_local` SET `delete` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 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 = ' "' . $itmo['name'] . '" "' . $u->room['name'] . '".'; - mysql_query('UPDATE `items_local` SET `delete` = "' . time() . '" , `user_take` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + 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']); + $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']); + $u->addItem( + $pl['item_id'], $u->info['id'], + '|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room'] . '|' . $pl['data'] + ); } } } @@ -548,8 +585,7 @@ while ($pl = mysql_fetch_array($sp)) { if ($tk == 1 && $pl['tr_login'] == '0') { $tk = 2; } - $iloc .= '
    ' . - '
    ' . '' . - '
    '; + $iloc .= '" src="https://img.new-combats.com/i/items/' . $itmo['img'] . '">' . '
    '; } } else { echo '[!]'; @@ -572,10 +607,7 @@ if ($iloc != '') { if ($iloce != '') { $iloc = '
    ' . $iloce . '
    ' . $iloc; } - $iloc = '' . - '

    ' . $iloc; + $iloc = '' . '

    ' . $iloc; $tjs .= 'top.frames[\'main\'].locitems=1;parent.$(\'#canal1\').html( \'' . $iloc . '\' );'; } else { $tjs .= 'top.frames[\'main\'].locitems=1;parent.$(\'#canal1\').html( \'\' );'; @@ -583,7 +615,11 @@ if ($iloc != '') { 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 ' '; diff --git a/main_bot.php b/main_bot.php index 0e028ffc..57bb3bfe 100644 --- a/main_bot.php +++ b/main_bot.php @@ -1,483 +1,247 @@ -'.$_SERVER['SERVER_ADDR']); -} - +use Insallah\Db; +const GAME = true; include('_incl_data/__config.php'); -define('GAME',true); include('_incl_data/class/__db_connect.php'); -/*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;");*/ - -function e($t) { - mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' ( ): '.mysql_real_escape_string($t).'","capitalcity","TABU","6","1","-1")'); +if (!in_array(UserIp::get(), ['', '127.0.0.1', '91.228.152.24', $_SERVER['SERVER_ADDR']])) { + die(UserIp::get() . '
    ' . $_SERVER['SERVER_ADDR']); } -if(isset($_GET['cron_core'])) { - $id = array( - 'id' => $_GET['uid'], - 'pass' => $_GET['pass'] - ); - if(md5($id['id'].'_brfCOreW@!_'.$id['pass']) == $_GET['cron_core']) { - $uzr = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`pass` FROM `users` WHERE `id` = "'.mysql_real_escape_string($id['id']).'" AND `pass` = "'.mysql_real_escape_string($id['pass']).'" LIMIT 1')); - if(isset($uzr['id'])) { - $CRON_CORE = true; - $_COOKIE['login'] = $uzr['login']; - $_COOKIE['pass'] = $uzr['pass']; - $_POST['id'] = 'reflesh'; - - - if(isset($_GET['atack'])) { - $_POST['atack'] = $_GET['atack']; - } - if(isset($_GET['block'])) { - $_POST['block'] = $_GET['block']; - } - if(isset($_GET['usepriem'])) { - $_POST['usepriem'] = $_GET['usepriem']; - } - if(isset($_GET['useitem'])) { - $_POST['useitem'] = $_GET['useitem']; - } - } - } +function e($t) +{ + mysql_query( + 'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #' . date('d.m.Y') . ' %' . date( + 'H:i:s' + ) . ' ( ): ' . mysql_real_escape_string($t) . '","capitalcity","TABU","6","1","-1")' + ); } -if(!isset($uzr['id'])) { - header('location: main.php'); - die(); +if (isset($_GET['cron_core'])) { + $id = [ + 'id' => $_GET['uid'], + 'pass' => $_GET['pass'], + ]; + if (md5($id['id'] . '_brfCOreW@!_' . $id['pass']) == $_GET['cron_core']) { + $uzr = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login`,`pass` FROM `users` WHERE `id` = ' . $id['id'] . ' AND `pass` = "' . mysql_real_escape_string($id['pass']) . '"')); + if (isset($uzr['id'])) { + $CRON_CORE = true; + $_COOKIE['login'] = $uzr['login']; + $_COOKIE['pass'] = $uzr['pass']; + $_POST['id'] = 'reflesh'; + + if (isset($_GET['atack'])) { + $_POST['atack'] = $_GET['atack']; + } + if (isset($_GET['block'])) { + $_POST['block'] = $_GET['block']; + } + if (isset($_GET['usepriem'])) { + $_POST['usepriem'] = $_GET['usepriem']; + } + if (isset($_GET['useitem'])) { + $_POST['useitem'] = $_GET['useitem']; + } + } + } +} + +if (!isset($uzr['id'])) { + header('location: main.php'); + die(); } unset($uzr); -include('_incl_data/class/__magic.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/__filter_class.php'); -include('_incl_data/class/__quest.php'); +$magic = new Magic(); +$u = User::start(); +$filter = new Filter(); +$q = new Quests; -if($u->info['activ']>0) { - die(' .
    .'); +if ($u->info['activ'] > 0) { + die(' .
    .'); } $tjs = ''; #-------- , -$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "'.$u->info['id'].'" LIMIT 1',1); -if($u->room['file']!="objaga" && $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'] != "objaga" && $sleep['id'] > 0) { + mysql_query('UPDATE `actions` SET `vars` = "unsleep" WHERE `id` = ' . $sleep['id']); } -if($u->room['file']=="objaga" || $u->room['file']=="post"){$trololo=0;}else{$trololo=1;} + +$trololo = $u->room['file'] == "objaga" || $u->room['file'] == "post" ? 0 : 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"); -}elseif($u->info['timeMain'] < time()-60) -{ - 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']); + Db::sql('update users set online = unix_timestamp(), timeMain = unix_timestamp() where id = ?', [$u->info['id']]); +} elseif ($u->info['timeMain'] < time() - 60) { + Db::sql('update users set online = unix_timestamp(), timeMain = unix_timestamp() where id = ?', [$u->info['id']]); } -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']); } -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` 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 = 1; - } - - $ua = mysql_fetch_array(mysql_query('SELECT `s`.`team`,`s`.`id`,`s`.`bbexp`,`u`.`battle`,`u`.`id`,`u`.`room`,`u`.`login`,`u`.`online` 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.') AND `s`.`id` = "'.mysql_real_escape_string($_GET['atak_user']).'" LIMIT 1')); - if(isset($ua['id']) && $ua['online'] > time()-520) - { - $usta = $u->getStats($ua['id'],0); // - $minHp = $usta['hpAll']/100*33; // - - if($ua['room']==$u->info['room'] && ($minHp<$usta['hpNow'] || $ua['battle']>0)) - { - $magic->atackUser($u->info['id'],$ua['id'],$ua['team'],$ua['battle'],$ua['bbexp'],50); - - $rtxt = '[img[items/pal_button8.gif]] "'.$u->info['login'].'" '.$sx.' "'.$ua['login'].'".'; - 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')"); - - header('location: main.php'); - die(); - }else{ - if($ua['room']!=$u->info['room']){ - // - $u->error = ' '; - }else{ - $u->error = ' .'; - } - } - }else{ - // - $u->error = ' , '; - } - } - $u->error = ' ...'; +if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] != $u->info['id']) { + if ($u->room['noatack'] == 0) { + $ua = Db::getValue('select clan from users where id = ?', [$_GET['atak_user']]); + $cruw = Db::getValue( + 'select id from clan_wars where ((clan1 = ? and clan2 = ?) or (clan1 = ? and clan2 = ?)) and time_finish > unix_timestamp() limit 1', + [ + $ua, $u->info['clan'], $u->info['clan'], $ua, + ] + ); + unset($ua); + if (isset($cruw)) { + $cruw = 1; + } + + $ua = Db::getRow( + 'select * from stats left join users on stats.id = users.id where (atack > unix_timestamp() or atack = 1 or 1 = ?) and stats.id = ?', + [$cruw, $_GET['atak_user']] + ); + + if (isset($ua['id']) && $ua['online'] > time() - 520) { + $usta = $u->getStats($ua['id'], 0); // + $minHp = $usta['hpAll'] / 100 * 33; // + + if ($ua['room'] == $u->info['room'] && ($minHp < $usta['hpNow'] || $ua['battle'] > 0)) { + $magic->atackUser($u->info['id'], $ua['id'], $ua['team'], $ua['battle'], $ua['bbexp'], 50); + + $rtxt = '[img[items/pal_button8.gif]] "' . $u->info['login'] . '" ' . $sx . ' "' . $ua['login'] . '".'; + Db::sql( + 'insert into chat (new, type, typeTime, time, city, room, text) values (1,6,1,unix_timestamp(),?,?,?)', + [ + $u->info['city'], + $u->info['room'], + $rtxt, + ] + ); + + header('location: main.php'); + die(); + } else { + $u->error = $ua['room'] != $u->info['room'] ? + ' ' : + ' .'; + } + } else { + // + $u->error = ' , '; + } + } + $u->error = ' ...'; } -//mysql_query('START TRANSACTION'); +if ($u->info['battle_text'] != '') { + // + if ($u->info['last_b'] > 0) { + Db::sql( + 'insert into battle_last (battle_id, uid, time, act, align, clan, exp) values (?,?,unix_timestamp(),?,?,?,?)', + [ + $u->info['last_b'], + $u->info['id'], + $u->info['last_a'], + $u->info['align'], + $u->info['clan'], + $u->info['exp'], + ] + ); -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'); + } + Db::sql('update stats set battle_text = ?, last_b = 0 where id = ?', ['', $u->info['id']]); } -/*echo ' - - - - - - - - - - -'; -*/ -/*-----------------------*/ -$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); +$u->rgd = $u->regen($u->info['id'], 0, 0); // -$ul = $u->testLevel(); -if($ul==1) -{ - $act = 1; -} -if($u->info['repass'] > 0 && $u->info['id'] != 5433446) { -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; +$ul = $u->testLevel(); +if ($ul == 1) { + $act = 1; } -/*-----------------------*/ -if($u->info['battle']==0) -{ - /// - - /// - //$act2 = $u->testItems($u->info['id'],$u->stats,0); - if($act2!=-2 && $act==-2) - { - $act = $act2; - } - - 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'])) - { - $u->deleteItem(intval($_GET['delete']),$u->info['id']); - }elseif(isset($_GET['stack']) && isset($_GET['inv'])) - { - $u->stack($_GET['stack']); - }elseif(isset($_GET['unstack']) && isset($_GET['inv'])) - { - $u->unstack($_GET['unstack']); - }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']); - } - } +if ($u->info['repass'] > 0 && $u->info['id'] != 5433446) { -}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'); + /*-----------------------*/ + if ($u->info['battle'] == 0) { + if ($act2 != -2 && $act == -2) { + $act = $act2; + } + + 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'])) { + $u->deleteItem(intval($_GET['delete']), $u->info['id']); + } elseif (isset($_GET['stack']) && isset($_GET['inv'])) { + $u->stack($_GET['stack']); + } elseif (isset($_GET['unstack']) && isset($_GET['inv'])) { + $u->unstack($_GET['unstack']); + } 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']); + } + } + + } elseif ($u->info['battle_text'] != '') { + Db::sql('update stats set battle_text = ?, last_b = 0 where id = ?', ['', $u->info['id']]); + } + + if ($magic->youuse > 0) { + $act = 1; + } + // + if ($act != -2) { + $u->stats = $u->getStats($u->info['id'], 0, 1); + $u->aves = $u->ves(null); + $act2 = $u->testItems($u->info['id'], $u->stats, 0); + if ($act2 != -2 && $act == -2) { + $act = $act2; + } + } } -if($magic->youuse > 0) -{ - $act = 1; +if ( + (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'])) { + include('modules_data/_zv.php'); } -// -if($act!=-2) -{ - $u->stats = $u->getStats($u->info['id'],0,1); - $u->aves = $u->ves(NULL); - $act2 = $u->testItems($u->info['id'],$u->stats,0); - if($act2!=-2 && $act==-2) - { - $act = $act2; - } -} -} - -if((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'])) -{ - include('modules_data/_zv.php'); -} - -/*-----------------------*/ -/* -if(isset($_GET['security']) && !isset($u->tfer['id']) && $trololo==1) -{ - include('modules_data/_changepass.php'); -}elseif(isset($_GET['quests'])) -{ - include('modules_data/_quests.php'); -}elseif($u->info['level']>1 && isset($_GET['friends']) && !isset($u->tfer['id'])) -{ - include('modules_data/_friends.php'); -}elseif((($u->info['align']>=1 && $u->info['align']<2) || $u->info['admin']>0) && isset($_GET['light']) && !isset($u->tfer['id'])) -{ - 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'])) -{ - include('modules_data/_mod.php'); -}elseif(($u->info['clan']>0 || (($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4))) && isset($_GET['clan']) && !isset($u->tfer['id'])) -{ - if(($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4)) { - include('modules_data/_clan.php'); - }else{ - include('modules_data/_clan_oldversion.php'); - } -}elseif(isset($_GET['admin']) && $u->info['admin']>0) -{ - if($u->info['id']==7) { - include('modules_data/_light.php'); - }else{include('modules_data/_mod.php');} -}elseif(isset($_GET['help'])) -{ - 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(isset($_GET['alhp']) && $u->info['admin']==1 && !isset($u->tfer['id'])) -{ - include('modules_data/_alhp.php'); -}elseif($u->info['battle']!=0) -{ - // - include('modules_data/btl_.php'); -}else{ - if(isset($_GET['talk']) && !isset($u->tfer['id'])) - { - if($u->info['dnow']>0 && !isset($u->tfer['id'])) - { - 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'); - }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']) && $u->info['level']>0){ - 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) - { - include('modules_data/_transfers.php'); - }elseif(isset($_GET['anketa']) && !isset($u->tfer['id']) && $trololo==1) - { - include('modules_data/_anketa.php'); - }elseif(isset($_GET['pet']) && $u->info['animal']>0 && $trololo==1) - { - include('modules_data/_animal.php'); - }elseif(isset($_GET['act_trf']) && $u->room['block_all']==0) { - include('modules_data/act_trf.php'); - }elseif(!isset($u->tfer['id'])) - { - 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'); -} - -// -//$q->testquest(); - -/*-----------------------*/ -/*echo ' -';*/ - -//unlink($lock_file); mysql_query('UNLOCK TABLES'); -?> diff --git a/map.php b/map.php index 951fdb79..5896d77c 100644 --- a/map.php +++ b/map.php @@ -1,68 +1,63 @@ info['banned'] > 0 || !isset($u->info['id'])) { - header('location: /index.php'); - die(); +if ($u->info['banned'] || !isset($u->info['id'])) { + header('location: /index.php'); + die(); } ?> - + - - - - - - + + + + - - - - - + + + + +
      - -

    -

    - - - - - - - - - - - - - - - - -
    -

    Adobe Flash Player.

    -

      Adobe Flash Player

    -
    - -
    - -
    - -
     
      + +

    +

    + + + + + + + + + + + + + + + + +
    +

    Adobe Flash Player.

    +

      Adobe Flash Player +

    +
    + +
    + +
    + +
     
    \ No newline at end of file diff --git a/modules_data/_NewLocations.php b/modules_data/_NewLocations.php index 3d2d76c1..cbae2a0f 100644 --- a/modules_data/_NewLocations.php +++ b/modules_data/_NewLocations.php @@ -221,7 +221,7 @@ if(isset($_GET['loc'])) } if($u->info['room']==209){ - include('_incl_data/class/__zv.php'); + $zv = new FightRequest(); } if($re!=''){ diff --git a/modules_data/_alhp.php b/modules_data/_alhp.php index c7979ba4..f3216f24 100644 --- a/modules_data/_alhp.php +++ b/modules_data/_alhp.php @@ -299,10 +299,10 @@ $srok = array(15=>'15 { if(isset($_POST['usem1'])) { - include('moder/usem1.php'); + require_once('moder/usem1.php'); }elseif(isset($_POST['teleport'])) { - //include('moder/teleport.php'); + //require_once('moder/teleport.php'); } } if(isset($_POST['tologin'],$_POST['message'])) { diff --git a/modules_data/_bukmeker.php b/modules_data/_bukmeker.php index 9c20b3b4..c8080bd9 100644 --- a/modules_data/_bukmeker.php +++ b/modules_data/_bukmeker.php @@ -1,112 +1,137 @@ - - var elem = document.getElementById('se-pre-con'); - elem.parentNode.removeChild(elem); - - "; -if(!defined('GAME')) -{ - die(); +info['bukmeker'] && !$u->info['admin']) { + die(); } -if($u->info['bukmeker']<>1 && $u->info['admin']<>1){ - die('

    !

    '); -} -?> - - -
    -

    , info['login']?>

    -info['id'])."' LIMIT 1")); -if(isset($ba['id'])) { +$ba = mysql_fetch_array(mysql_query("SELECT * FROM `bank_alh` WHERE `uid` = " . $u->info['id'])); ?> - - - - -
    -

    - . -
    - - microLogin($uba['id'],1).'
    '; - }else{ - echo ' , .
    '; - unset($_POST['buy_cr']); - } - echo '
    '; - if(isset($uba['login'])) { - $_POST['buk_cr'] = round($_POST['buk_cr'],2); - if(isset($_POST['buk_cr']) && $_POST['buk_cr'] < 1) { - echo ' : 1 .
    '; - unset($_POST['buk_cr']); - }elseif($_POST['buk_cr'] > $ba['cr']) { - echo '
    '; - unset($_POST['buk_cr']); - } - if(isset($_POST['buygoodluck'])) { - echo ''; - $ba['cr'] -= $_POST['buk_cr']; - $ba['USD'] += round($_POST['buk_cr']*$ucur,2); - mysql_query('UPDATE `bank_alh` SET `cr` = "'.mysql_real_escape_string($ba['cr']).'",`USD` = "'.mysql_real_escape_string($ba['USD']).'" WHERE `id` = "'.$ba['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `money` = `money` + '.mysql_real_escape_string($_POST['buk_cr']).' WHERE `login` = "'.$uba['login'].'" LIMIT 1'); - - $money = round($_POST['buk_cr']*$pl['cur'],2); - $money = round($money/100*(100-$ba['procent']),2); - - }else{ - echo ' .:'; - if(!isset($_POST['buk_cr'])) { - echo '              
    '; - }else{ - echo ' '.round((int)$_POST['buk_cr'],2).' .'; - echo '   '; - } - } - } - } - - if(isset($_POST['buy_cr'])){ ?> : - -
    -info['bukmeker']=1 || $u->info['admin']==1){ - if (isset($_POST['systemM']) && !empty($_POST['systemM'])){ - - $r = ":"; - $r .=' '.$_POST['sysMes'].' [ ]'; - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')"); - - echo "
    "; + + + +

    +
    + , info['login'] ?>. + + +
    -} -?> \ No newline at end of file + + + + + +
    +

    + . +
    +
    + microLogin($uba['id'], 1) . '
    '; + } else { + echo ' , .
    '; + unset($_POST['buy_cr']); + } + echo '
    '; + if (isset($uba['login'])) { + $_POST['buk_cr'] = round($_POST['buk_cr'], 2); + if (isset($_POST['buk_cr']) && $_POST['buk_cr'] < 1) { + echo ' : 1 .
    '; + unset($_POST['buk_cr']); + } elseif ($_POST['buk_cr'] > $ba['cr']) { + echo '
    '; + unset($_POST['buk_cr']); + } + if (isset($_POST['buygoodluck'])) { + echo ''; + $ba['cr'] -= $_POST['buk_cr']; + $ba['USD'] += round($_POST['buk_cr'] * $ucur, 2); + mysql_query( + 'UPDATE `bank_alh` SET `cr` = "' . mysql_real_escape_string( + $ba['cr'] + ) . '",`USD` = "' . mysql_real_escape_string( + $ba['USD'] + ) . '" WHERE `id` = "' . $ba['id'] . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `users` SET `money` = `money` + ' . mysql_real_escape_string( + $_POST['buk_cr'] + ) . ' WHERE `login` = "' . $uba['login'] . '" LIMIT 1' + ); + + $money = round($_POST['buk_cr'] * $pl['cur'], 2); + $money = round($money / 100 * (100 - $ba['procent']), 2); + + } else { + echo ' .:'; + if (!isset($_POST['buk_cr'])) { + echo '              
    '; + } else { + echo ' ' . round( + (int)$_POST['buk_cr'], 2 + ) . ' .'; + echo '   '; + } + } + } + } + + if (isset($_POST['buy_cr'])) { ?> : +
    +
    +info['bukmeker'] && !$u->info['admin']) { + return; +} +if (!empty($_POST['systemM'])) { + $r = ": {$_POST['sysMes']} [ ]"; + mysql_query("INSERT INTO `chat` (`new`,`text`,`time`,`type`) VALUES ('1','" . $r . "', unix_timestamp(),'6')"); + echo "
    ."; +} +?> +
    +
    + +
    + +
    +
    diff --git a/modules_data/_clan.php b/modules_data/_clan.php index e0237758..77e6d8fe 100644 --- a/modules_data/_clan.php +++ b/modules_data/_clan.php @@ -1,2944 +1,3595 @@ -info['clan'])."' LIMIT 1")); -$cpr = explode('|', $u->info['clan_prava']); - -if(!isset($res['id'])) { - die(' .'); +info['clan']) . "' LIMIT 1") +); +$cpr = explode('|', $u->info['clan_prava']); + +if (!isset($res['id'])) { + die(' .'); +} + +if (!isset($_GET['events']) && !isset($_GET['diplom']) && !isset($_GET['control']) && !isset($_GET['deposit']) && !isset($_GET['titul']) && !isset($_GET['rules']) && !isset($_GET['info']) && !isset($_GET['members'])) { + $_GET['events'] = 1; } // -$tt = array( - 0 => array('000000000',' '), - 1 => array(0,' '), - 2 => array(0,' '), - 3 => array(0,' '), - 4 => array(0,' '), - 5 => array(0,' '), - 6 => array(0,' , '), - 7 => array(0,' '), - 8 => array(0,' '), - 9 => array(0,' '), - 10 => array(0,' '), - 11 => array(0,' '), - 12 => array(0,' '), - 13 => array(0,' '), - 14 => array(0,' '), - 15 => array(0,0), - 15 => array(0,0), - 16 => array(0,0), - 17 => array(0,0), - 18 => array(0,0), - 19 => array(0,0), - 20 => array(0,0) -); +$tt = [ + 0 => ['000000000', ' '], + 1 => [0, ' '], + 2 => [0, ' '], + 3 => [0, ' '], + 4 => [0, ' '], + 5 => [0, ' '], + 6 => [0, ' , '], + 7 => [0, ' '], + 8 => [0, ' '], + 9 => [0, ' '], + 10 => [0, ' '], + 11 => [0, ' '], + 12 => [0, ' '], + 13 => [0, ' '], + 14 => [0, ' '], + 15 => [0, 0], + 15 => [0, 0], + 16 => [0, 0], + 17 => [0, 0], + 18 => [0, 0], + 19 => [0, 0], + 20 => [0, 0], +]; -if($u->info['clan_prava'] != 'glava') { - $utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = "'.$u->info['clan_prava'].'" LIMIT 1')); - if(!isset($utitl['id'])) { - $utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = 2 LIMIT 1')); - } +if ($u->info['clan_prava'] != 'glava') { + $utitl = mysql_fetch_array( + mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = "' . $u->info['clan_prava'] . '" LIMIT 1') + ); + if (!isset($utitl['id'])) { + $utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = 2 LIMIT 1')); + } } else { - $utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = 1 LIMIT 1')); + $utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = 1 LIMIT 1')); } -if(isset($utitl['id'])) { - $i = 1; - while($i < count($tt)) { - if($utitl['prava'][$i] > 0) { - $tt[$i][0] = 1; - } - $i++; - } +if (isset($utitl['id'])) { + $i = 1; + while ($i < count($tt)) { + if ($utitl['prava'][$i] > 0) { + $tt[$i][0] = 1; + } + $i++; + } } $u->info['tt'] = $tt; // -$lvl_exp = array( - 0 => 0, - 1 => 500000, - 2 => 2000000, - 3 => 5500000, - 4 => 10500000, - 5 => 20500000, - 6 => 35500000, - 7 => 65500000, - 8 => 100000000, - 9 => 200000000, - 10 => 300000000, - 11=> 1000000000 - -); +$lvl_exp = [ + 0 => 0, + 1 => 500000, + 2 => 2000000, + 3 => 5500000, + 4 => 10500000, + 5 => 20500000, + 6 => 35500000, + 7 => 65500000, + 8 => 100000000, + 9 => 200000000, + 10 => 300000000, + 11 => 1000000000, -if($res['exp'] >= $lvl_exp[$res['level']+1]) { - $res['level']++; - mysql_query('UPDATE `clan` SET `level` = "'.$res['level'].'" WHERE `id` = "'.$res['id'].'" LIMIT 1'); - mysql_query('INSERT INTO `clan_news` (`clan`,`time`,`ddmmyyyy`,`uid`,`ip`,`login`,`title`,`text`) VALUES ( - "'.$res['id'].'","'.time().'","'.date('d.m.Y').'","0","127.0.0.1",""," "," '.$res['level'].'!" - )'); +]; + +if ($res['exp'] >= $lvl_exp[$res['level'] + 1]) { + $res['level']++; + mysql_query('UPDATE `clan` SET `level` = "' . $res['level'] . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'); + mysql_query( + 'INSERT INTO `clan_news` (`clan`,`time`,`ddmmyyyy`,`uid`,`ip`,`login`,`title`,`text`) VALUES ( + "' . $res['id'] . '","' . time() . '","' . date( + 'd.m.Y' + ) . '","0","127.0.0.1",""," "," ' . $res['level'] . '!" + )' + ); } -$r1 = mysql_fetch_array(mysql_query('SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "'.$res['id'].'" AND `date` = "'.date('dmY').'" LIMIT 1')); // +$r1 = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `aaa_clan_reting_list` WHERE `clan` = "' . $res['id'] . '" AND `date` = "' . date( + 'dmY' + ) . '" LIMIT 1' + ) +); // // -$lvl_prava = array( - 0 => array(8,0,0,0,0,50,20,200), - 1 => array(12,1,0,0,0,50,20,200), - 2 => array(16,1,0,0,0,50,20,200), - 3 => array(20,1,0,0,0,50,20,200), - 4 => array(24,1,1,0,0,100,40,200), - 5 => array(28,1,1,0,0,100,40,200), - 6 => array(32,1,1,0,0,100,40,200), - 7 => array(36,1,1,0,0,200,80,200), - 8 => array(40,1,1,1,1,200,80,200), - 9 => array(44,1,1,1,1,200,80,200), - 10 => array(48,1,1,1,1,200,80,200), - 11 => array(52,1,1,1,1,200,80,200) -) +$lvl_prava = [ + 0 => [8, 0, 0, 0, 0, 50, 20, 200], + 1 => [12, 1, 0, 0, 0, 50, 20, 200], + 2 => [16, 1, 0, 0, 0, 50, 20, 200], + 3 => [20, 1, 0, 0, 0, 50, 20, 200], + 4 => [24, 1, 1, 0, 0, 100, 40, 200], + 5 => [28, 1, 1, 0, 0, 100, 40, 200], + 6 => [32, 1, 1, 0, 0, 100, 40, 200], + 7 => [36, 1, 1, 0, 0, 200, 80, 200], + 8 => [40, 1, 1, 1, 1, 200, 80, 200], + 9 => [44, 1, 1, 1, 1, 200, 80, 200], + 10 => [48, 1, 1, 1, 1, 200, 80, 200], + 11 => [52, 1, 1, 1, 1, 200, 80, 200], +] ?> -
    - diff --git a/modules_data/location/_locations.php b/modules_data/location/_locations.php index 7b83d7da..42c8c440 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) { - require_once('_incl_data/class/__zv.php'); + $zv = new FightRequest(); } if($re!=''){ $re = $re.' '; } diff --git a/modules_data/location/a_clanreg.php b/modules_data/location/a_clanreg.php index a07d2dcd..c30f480d 100644 --- a/modules_data/location/a_clanreg.php +++ b/modules_data/location/a_clanreg.php @@ -1,314 +1,291 @@ -room['file']=='a_clanreg') -{ - - +if ($u->room['file'] != 'a_clanreg') { + return; +} function alignc($al) { - if ($al==1){$value="()";} - elseif ($al==3){$value="()";} - elseif ($al==7){$value="()";} - else {$value="()";} - return $value; -} -// - -class upload { - -protected function __construct() { } - -static $save_path = 'clan_prw/'; -static $error = ''; - -static function saveimg($name,$max_mb = 2,$exts = 'jpg|png|jpeg|gif',$cnm = '',$mnw = 0,$mxw = 0,$mnh = 0,$mxh = 0) { - if (isset($_FILES[$name])) { - $f = &$_FILES[$name]; - - if(isset($f['tmp_name'])) { - $width = 0; - $height = 0; - list($width, $height) = getimagesize($f['tmp_name']); - } - - if( $mnw != 0 && $mnw > $width ) { - self::$error = ' '.$mnw.' . ( '.$width.'x'.$height.')'; - }elseif( $mxw != 0 && $mxw < $width ) { - self::$error = ' '.$mxw.' . ( '.$width.'x'.$height.')'; - }elseif( $mnh != 0 && $mnh > $height ) { - self::$error = ' '.$mnh.' . ( '.$width.'x'.$height.')'; - }elseif( $mxh != 0 && $mxh < $height ) { - self::$error = ' '.$mxh.' . ( '.$width.'x'.$height.')'; - }elseif (($f['size'] <= $max_mb*1024*1024) && ($f['size'] > 0)) { - if ( - (preg_match('/\.('.$exts.')$/i',$f['name'],$ext))&& - (preg_match('/image/i',$f['type'])) - ) { - - $ext[1] = strtolower($ext[1]); - $fn = uniqid('f_',true).'.'.$ext[1]; - $fn2 = uniqid('f_',true).'.gif'; - if (move_uploaded_file($f['tmp_name'], self::$save_path . $fn)) { - // , Rimage - //Rimage::resize(self::$save_path . $fn, self::$save_path . $fn2); - //@unlink(self::$save_path . $fn); // - return array($fn2,$fn,self::$save_path . $fn); - } else { - self::$error = ' '; - } - } else { - self::$error = ' . : '.$exts.''; - } - } else { - self::$error = ' . '.$max_mb.' '; - } + if ($al == 1) { + $value = "()"; + } elseif ($al == 3) { + $value = "()"; + } elseif ($al == 7) { + $value = "()"; } else { - self::$error = ' '; + $value = "()"; } - return false; -} // end saveimg -} // end class + return $value; +} -$lzv = mysql_fetch_array(mysql_query('SELECT * FROM `_clan` WHERE `uid` = "'.$u->info['id'].'" AND `admin_time` = "0" LIMIT 1')); +$lzv = mysql_fetch_array( + mysql_query('SELECT * FROM `_clan` WHERE `uid` = "' . $u->info['id'] . '" AND `admin_time` = "0" LIMIT 1') +); /* */ -if(isset($_POST['clan_enter'])) -{ - - mysql_query('UPDATE `users` SET `clan_zv`= "'.$_POST['clan_enter'].'" WHERE `id` = "'.$u->info['id'].'" '); +if (isset($_POST['clan_enter'])) { + + mysql_query('UPDATE `users` SET `clan_zv`= "' . $_POST['clan_enter'] . '" WHERE `id` = "' . $u->info['id'] . '" '); } /* */ -if(isset($_POST['clan_name'])) { - /*if($_POST['clan_align'] != 0) { - $_POST['clan_align'] = 0; - }*/ - - $tr_money2 = 0; - if($_POST['clan_align'] == 1) { - $tr_money2 = 50; - $_POST['clan_align'] = 1; - }elseif($_POST['clan_align'] == 3) { - $tr_money2 = 50; - $_POST['clan_align'] = 3; - }elseif($_POST['clan_align'] == 7) { - $tr_money2 = 50; - $_POST['clan_align'] = 7; - } - - $clan_name = substr(htmlspecialchars($_POST['clan_name'],NULL,'cp1251'), 0, 30); - - $cnt = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `name` = "'.mysql_real_escape_string($clan_name).'" LIMIT 1')); - - if(isset($cnt['id'])) { - $re = ' "'.$cnt['name'].'" .'; - }elseif(true == false) { - $re = ' .'; - }elseif(isset($lzv['id'])) { - $re = ' , '; - //}elseif( $u->testAlign($_POST['clan_align'],$u->info['id']) == 0 ) { - //$re = ' . ( )'; - }elseif($tr_money2 > $u->info['money2']) { - $re = ' , '.$tr_money2.'.'; - }elseif($u->info['clan'] > 0){ - $re = ' , '; - }elseif($u->info['align'] > 0){ - $re = ' , '; - }else{ - /* */ - //$clan_name = str_replace('.','',$clan_name); - //$clan_name = str_replace(' ','',$clan_name); - //$clan_name = str_replace(' ','',$clan_name); - if(!preg_match("/^[-a-zA-Z0-9]+$/", $clan_name)) { - $re = ' .'; - }elseif($file = upload::saveimg('clan_img1',0.3,'gif',$clan_name,24,24,15,15)) { - //if($file2 = upload::saveimg('clan_img2',0.5,'gif',$clan_name)) { - if($tr_money2 < 0) { - $tr_money2 = 0; - } - $u->info['money2'] -= $tr_money2; - - mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('INSERT INTO `_clan` (`uid`,`time`,`city`,`name`,`name2`,`site`,`img1`,`img2`,`info`,`money`,`align`) VALUES ( - "'.$u->info['id'].'","'.time().'", - "'.$u->info['city'].'", - "'.mysql_real_escape_string(htmlspecialchars($_POST['clan_name'],NULL,'cp1251')).'", - "'.mysql_real_escape_string(htmlspecialchars($_POST['clan_name'],NULL,'cp1251')).'", - "'.mysql_real_escape_string(htmlspecialchars($_POST['clan_site'],NULL,'cp1251')).'", - "'.mysql_real_escape_string(htmlspecialchars($file[1],NULL,'cp1251')).'", +if (isset($_POST['clan_name'])) { + + $tr_money2 = 0; + if ($_POST['clan_align'] == 1) { + $tr_money2 = 50; + $_POST['clan_align'] = 1; + } elseif ($_POST['clan_align'] == 3) { + $tr_money2 = 50; + $_POST['clan_align'] = 3; + } elseif ($_POST['clan_align'] == 7) { + $tr_money2 = 50; + $_POST['clan_align'] = 7; + } + + $clan_name = substr(htmlspecialchars($_POST['clan_name'], null, 'cp1251'), 0, 30); + + $cnt = mysql_fetch_array( + mysql_query('SELECT * FROM `clan` WHERE `name` = "' . mysql_real_escape_string($clan_name) . '" LIMIT 1') + ); + + $upload = new Uploader($clan_name); + $upload->setMaxFileSize(.3); + $upload->setDimensions(24, 15); + $upload->setExtentions('gif'); + $upload->setSavePath('clan_prw/'); + + if (isset($cnt['id'])) { + $re = ' "' . $cnt['name'] . '" .'; + } elseif (isset($lzv['id'])) { + $re = ' , '; + } elseif ($tr_money2 > $u->info['money2']) { + $re = ' , ' . $tr_money2 . '.'; + } elseif ($u->info['clan'] > 0) { + $re = ' , '; + } elseif ($u->info['align'] > 0) { + $re = ' , '; + } else { + /* */ + if (!preg_match("/^[-a-zA-Z0-9]+$/", $clan_name)) { + $re = ' .'; + } elseif ($file = $upload->saveimg()) { + if ($tr_money2 < 0) { + $tr_money2 = 0; + } + $u->info['money2'] -= $tr_money2; + + mysql_query( + 'UPDATE `users` SET `money2` = "' . $u->info['money2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' + ); + mysql_query( + 'INSERT INTO `_clan` (`uid`,`time`,`city`,`name`,`name2`,`site`,`img1`,`img2`,`info`,`money`,`align`) VALUES ( + "' . $u->info['id'] . '","' . time() . '", + "' . $u->info['city'] . '", + "' . mysql_real_escape_string(htmlspecialchars($_POST['clan_name'], null, 'cp1251')) . '", + "' . mysql_real_escape_string(htmlspecialchars($_POST['clan_name'], null, 'cp1251')) . '", + "' . mysql_real_escape_string(htmlspecialchars($_POST['clan_site'], null, 'cp1251')) . '", + "' . mysql_real_escape_string(htmlspecialchars($file[1], null, 'cp1251')) . '", "", "", - "'.$tr_money2.'", - "'.mysql_real_escape_string(htmlspecialchars($_POST['clan_align'],NULL,'cp1251')).'" - )'); - $lzv = array( - 'id' => mysql_insert_id(), - 'name' => htmlspecialchars($_POST['clan_name'],NULL,'cp1251'), - 'time' => time() - ); - $re = ' "'.htmlspecialchars($_POST['clan_name'],NULL,'cp1251').'". ('.$tr_money2.'.)'; - //}else{ - // @unlink($file[2]); // - // $re = ' : '.upload::$error; - //} - }else{ - $re = ' : '.upload::$error; - } - } + "' . $tr_money2 . '", + "' . mysql_real_escape_string(htmlspecialchars($_POST['clan_align'], null, 'cp1251')) . '" + )' + ); + $lzv = [ + 'id' => mysql_insert_id(), + 'name' => htmlspecialchars($_POST['clan_name'], null, 'cp1251'), + 'time' => time(), + ]; + $re = ' "' . htmlspecialchars( + $_POST['clan_name'], null, 'cp1251' + ) . '". (' . $tr_money2 . '.)'; + } else { + $re = ' : ' . Uploader::$error; + } + } } ?> - - - - - - -
    -
    -

    -
    -
    - '.$re.''; - } - ?> -
    - + +
    - - + + -
      - - - -
    - - - - - - -
    - - - - -
    +
    +
    +

    +
    +
    + ' . $re . ''; + } + ?> +
    +
    + + + + + +
      + + + + +
    + + + + + + +
    + + + + + +
    +
    +
    +
    +
    +
    -
    -info['clan'] > 0 ) { - $clan = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$u->info['clan'].'" LIMIT 1')); -?> - .

    -
    -

    - info['clan_prava'] == 'glava' ) { - echo ' , !'; - }else{ - echo ' , !'; - } - ?> -
    - - - -

    : ( ) 2415, GIF, 30.

    -

    - :
    - - 50 .
    - - 50 .
    - - 50 .
    -

    +
    +info['clan'] > 0) { + $clan = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $u->info['clan'] . '" LIMIT 1')); + ?> + .

    +
    +

    + info['clan_prava'] == 'glava') { + echo ' , !'; + } else { + echo ' , !'; + } + ?> +
    + + + + + + + + + +

    : ( ) 2415, GIF, 30.

    +

    + :
    + - 50 + .
    + - 50 + .
    + - 50 + .
    +

    +

    + , . +

    +
    +
    +
    +

    +
    + + ( , ): + +
    + ( https://new-combats.com/): + +
    + + +
    + + +
    + + +     " + ". . + +
    +
    +
    +
    +
    +

    + info['id'] . '" LIMIT 1') + ); + if ($clnt['clan_zv'] != 0) { + $clnn = mysql_fetch_array( + mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $clnt['clan_zv'] . '" LIMIT 1') + ); + echo ' ' . $clnn['name'] . ' ' . alignc( + $clnn['align'] + ) . ' ' . $tmpc . '
    '; + echo ' . .
    '; + } + ?> + : +
    + +

    + +
    +
    +
    +

    :

    - , . + .
    + ( ), .
    + .
    + , 60 + .

    - - - - -
    -
    -

    -
    - - ( , ): - -
    - ( https://new-combats.com/): - -
    - - -
    - - -
    - - -     "". . - -
    -
    - - -
    -
    -

    - info['id'].'" LIMIT 1')); - if ($clnt['clan_zv']!=0) - { - $clnn = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$clnt['clan_zv'].'" LIMIT 1')); - echo ' '.$clnn['name'].' '.alignc($clnn['align']).' '.$tmpc.'
    '; - echo ' . .
    '; - } - ?> - : -
    - -

    - -
    -
    - - - -

    :

    -

    - .
    - ( ), .
    - .
    - , 60 . -

    - - \ No newline at end of file + \ No newline at end of file diff --git a/modules_data/location/ab/izlom2.php b/modules_data/location/ab/izlom2.php index 26617c63..be92e546 100644 --- a/modules_data/location/ab/izlom2.php +++ b/modules_data/location/ab/izlom2.php @@ -1,148 +1,149 @@ room['file']=='ab/izlom2') -{ -if(isset($_POST['level'])) -{ - $dop_lvl = 8; // - if((int)$_POST['level'] <= $u->info['level'] && (int)$_POST['level'] <= $dop_lvl) - { - $eff1 = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = "31" AND `delete` = "0" LIMIT 1')); - if(!isset($eff1['id'])) - { - if(file_exists('_incl_data/class/__zv.php')) { - if(!isset($zv)) - { - require_once('_incl_data/class/__zv.php'); - } - $zv->startIzlom(1,((int)$_POST['level'])); - }else{ - echo '...'; - } - }else{ - echo ' " "'; - } - }else{ - echo ' ... !'; - } +if ($u->room['file'] != 'ab/izlom2') { + return; +} +if (isset($_POST['level'])) { + $dop_lvl = 8; // + if ((int)$_POST['level'] > $u->info['level'] || (int)$_POST['level'] > $dop_lvl) { + echo ' ... !'; + } else { + $eff1 = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = "31" AND `delete` = "0" LIMIT 1')); + if (isset($eff1['id'])) { + echo ' " "'; + } elseif (!isset($zv)) { + $zv = new FightRequest(); + } + } } - ?> - -
    '.$re.''; } ?>
    - - - -
    -
    - - - - -
      - - - -
    - - - - - - - - -
    - - - - - - - - -
    - 16
     
    -
    -
    - + +
    ' . $re . ''; + } ?>
    + + + + +
    +
    +
    + + + + + +
      + + + + +
    + + + + + + + + + +
    + + + + + + + + + +
    + - 16
    +
    +
     
    +
    +
    +
    +
    +
    - info['level']<7){ echo 'disabled'; } ?>> - ( )
    -

    - -
    - '.date('d.m.Y H:i',$pl['time']).', : '.$pl['voln'].', '.$u->microLogin($pl['uid'],1).'
    '; - } - }-*/ - /*if(!isset($text)) - { - $text = ' , ...'; - } - echo $text; - unset($text);*/ - echo '

    '; - ?> - \ No newline at end of file + +

    + diff --git a/modules_data/location/bank.php b/modules_data/location/bank.php index 3bb4aeb0..c80ee5eb 100644 --- a/modules_data/location/bank.php +++ b/modules_data/location/bank.php @@ -44,11 +44,24 @@ if ($u->room['file'] == 'bank') { $re2 = ''; 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')); + $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 = ' .'; } 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')); + $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 '; } else { @@ -58,29 +71,59 @@ if ($u->room['file'] == 'bank') { $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']) . '")'); + 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 ''; + echo ''; } 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'); - mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_good_pass_' . mysql_real_escape_string($bank['id']) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")'); + 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' + ); + mysql_query( + 'INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time( + ) . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_good_pass_' . mysql_real_escape_string( + $bank['id'] + ) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")' + ); $u->bank = $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')); + $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 = ' '; } 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']) . '")'); + 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, '; - mysql_query('UPDATE `bank` SET `repass` = "' . (time() + 24 * 3600) . '" WHERE `id` = "' . $b_pass['id'] . '" LIMIT 1'); + 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']) . '
    : ' . $b_pass['pass'] . '

    ,
    '; @@ -100,7 +143,10 @@ if ($u->room['file'] == 'bank') { } elseif ($u->info['align'] != 2) { $pass = rand(10000, 91191); $pass = htmlspecialchars($_POST['pass1'], null, 'cp1251'); - $ins = mysql_query('INSERT INTO `bank` (`uid`,`create`,`pass`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . mysql_real_escape_string($pass) . '")'); + $ins = mysql_query( + 'INSERT INTO `bank` (`uid`,`create`,`pass`) VALUES ("' . $u->info['id'] . '","' . time( + ) . '","' . mysql_real_escape_string($pass) . '")' + ); if ($ins) { $bank = mysql_insert_id(); if ($u->info['level'] < 8 && $_POST['rdn01'] == 2 && $c['zuby'] == true) { @@ -108,9 +154,16 @@ if ($u->room['file'] == 'bank') { } else { $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 = ' ' . getNum($bank) . ' .
    : ' . $pass . '

    ( " " )'; - $u->addDelo(3, $u->info['id'], ' ' . getNum($bank) . '', time(), $u->info['city'], 'Bank.System', 3, 0, ''); + $upd = mysql_query( + 'UPDATE `users` SET `money` = "' . $u->info['money'] . '",`money4` = "' . $u->info['money4'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' + ); + $re2 = ' ' . getNum( + $bank + ) . ' .
    : ' . $pass . '

    ( " " )'; + $u->addDelo( + 3, $u->info['id'], ' ' . getNum($bank) . '', time(), $u->info['city'], + 'Bank.System', 3, 0, '' + ); } else { $re2 = ' .'; } @@ -126,7 +179,9 @@ if ($u->room['file'] == 'bank') { } } elseif (isset($_GET['exit']) && isset($u->bank['id'])) { $u->bank = false; - mysql_query('UPDATE `bank` SET `useNow` = "0" WHERE `uid` = "' . $u->info['id'] . '" AND `useNow`!="0" LIMIT 1'); + mysql_query( + 'UPDATE `bank` SET `useNow` = "0" WHERE `uid` = "' . $u->info['id'] . '" AND `useNow`!="0" LIMIT 1' + ); } if ($u->info['allLock'] > time()) { @@ -137,9 +192,21 @@ if ($u->room['file'] == 'bank') { 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')); + $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')); + $ut = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`level`,`city`,`room`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string( + $ub['uid'] + ) . '" LIMIT 1' + ) + ); if ($ut['level'] >= 0 || $ut['id'] == $u->info['id'] || $u->info['admin'] > 0) { $mn = floor((int)($_POST['tansfer_sum2'] * 100)); $mn = round(($mn / 100), 2); @@ -149,29 +216,67 @@ if ($u->room['file'] == 'bank') { if ($mn < 0.01 || $mn > 1000000000) { $re2 = ' '; } else { - $upd = mysql_query('UPDATE `bank` SET `money2` = "' . mysql_real_escape_string($u->bank['money2'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1'); + $upd = mysql_query( + 'UPDATE `bank` SET `money2` = "' . mysql_real_escape_string( + $u->bank['money2'] - $mn + ) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1' + ); if ($upd) { $u->bank['money2'] -= $mn; $ub['money2'] += $mn - $prc; - mysql_query('UPDATE `users` SET `catch` = `catch` + "' . floor($mn - $prc) . '" WHERE `id` = "' . $ut['id'] . '" LIMIT 1'); - mysql_query('UPDATE `users` SET `frg` = `frg` + ' . floor($mn) . ' WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `users` SET `catch` = `catch` + "' . floor( + $mn - $prc + ) . '" WHERE `id` = "' . $ut['id'] . '" LIMIT 1' + ); + 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 = ' ' . ($mn - $prc) . ' . ( ' . $prc . ' .) ' . getNum($ub['id']) . ' "' . $ut['login'] . '"'; - $u->addDelo(3, $ut['id'], ' ' . ($mn - $prc) . ' . ' . getNum($u->bank['id']) . ' "' . $u->info['login'] . '", ' . $prc . ' . (: ' . $ub['money1'] . ' ., ' . $ub['money2'] . ' .)', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']); - $u->addDelo(3, $u->info['id'], ' ' . ($mn - $prc) . ' . ' . getNum($ub['id']) . ' "' . $ut['login'] . '", ' . $prc . ' . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']); + mysql_query( + 'UPDATE `bank` SET `money2` = "' . mysql_real_escape_string( + $ub['money2'] + ) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1' + ); + $re2 = ' ' . ($mn - $prc) . ' . ( ' . $prc . ' .) ' . getNum( + $ub['id'] + ) . ' "' . $ut['login'] . '"'; + $u->addDelo( + 3, $ut['id'], ' ' . ($mn - $prc) . ' . ' . getNum( + $u->bank['id'] + ) . ' "' . $u->info['login'] . '", ' . $prc . ' . (: ' . $ub['money1'] . ' ., ' . $ub['money2'] . ' .)', + time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, + $ub['id'] + ); + $u->addDelo( + 3, $u->info['id'], + ' ' . ($mn - $prc) . ' . ' . getNum( + $ub['id'] + ) . ' "' . $ut['login'] . '", ' . $prc . ' . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', + time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), + $u->bank['id'] + ); $log = '"' . $u->info['login'] . '" [' . $u->info['level'] . '] ' . $u->bank['id'] . ' ' . $ub['id'] . ' "' . $ut['login'] . '" [' . $ut['level'] . '] ' . ($mn - $prc) . ' .'; - $u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, ''); + $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']) { $alg = ''; if ($u->info['align'] == 50) { $alg = ''; } - $text = '"' . $alg . '[login:' . $u->info['login'] . ']" ' . ($u->info['sex'] == 0 ? "" : "") . ' ' . ($mn - $prc) . ' . ' . getNum($u->bank['id']) . ' ' . getNum($ub['id']) . '.'; + $text = '"' . $alg . '[login:' . $u->info['login'] . ']" ' . ($u->info['sex'] == 0 ? "" : "") . ' ' . ($mn - $prc) . ' . ' . 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')"); + 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 = ' '; @@ -189,9 +294,21 @@ if ($u->room['file'] == 'bank') { } 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')); + $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']) { - $ut = mysql_fetch_array(mysql_query('SELECT `id`,`level`,`city`,`room`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string($ub['uid']) . '" LIMIT 1')); + $ut = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`level`,`city`,`room`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string( + $ub['uid'] + ) . '" LIMIT 1' + ) + ); if ($ut['level'] >= 4 || $ut['id'] == $u->info['id'] || $u->info['admin'] > 0) { $mn = floor((int)($_POST['tansfer_sum'] * 100)); $mn = round(($mn / 100), 2); @@ -201,20 +318,51 @@ if ($u->room['file'] == 'bank') { if ($mn < 0.01 || $mn > 1000000000) { $re2 = ' '; } else { - $upd = mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1'); + $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 = ' ' . ($mn - $prc) . ' . ( ' . $prc . ' .) ' . getNum($ub['id']) . ' "' . $ut['login'] . '"'; - $u->addDelo(3, $ut['id'], ' ' . ($mn - $prc) . ' . ' . getNum($u->bank['id']) . ' "' . $u->info['login'] . '", ' . $prc . ' . (: ' . $ub['money1'] . ' ., ' . $ub['money2'] . ' .)', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']); - $u->addDelo(3, $u->info['id'], ' ' . ($mn - $prc) . ' . ' . getNum($ub['id']) . ' "' . $ut['login'] . '", ' . $prc . ' . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']); + mysql_query( + 'UPDATE `bank` SET `money1` = "' . mysql_real_escape_string( + $ub['money1'] + ) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1' + ); + $re2 = ' ' . ($mn - $prc) . ' . ( ' . $prc . ' .) ' . getNum( + $ub['id'] + ) . ' "' . $ut['login'] . '"'; + $u->addDelo( + 3, $ut['id'], + ' ' . ($mn - $prc) . ' . ' . getNum( + $u->bank['id'] + ) . ' "' . $u->info['login'] . '", ' . $prc . ' . (: ' . $ub['money1'] . ' ., ' . $ub['money2'] . ' .)', + time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, + $ub['id'] + ); + $u->addDelo( + 3, $u->info['id'], + ' ' . ($mn - $prc) . ' . ' . getNum( + $ub['id'] + ) . ' "' . $ut['login'] . '", ' . $prc . ' . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', + time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), + $u->bank['id'] + ); $log = '"' . $u->info['login'] . '" [' . $u->info['level'] . '] ' . $u->bank['id'] . ' ' . $ub['id'] . ' "' . $ut['login'] . '" [' . $ut['level'] . '] ' . ($mn - $prc) . ' . ' . $prc . ' . .'; - $u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, ''); + $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 = '"[login:' . $u->info['login'] . ']" ' . ($u->info['sex'] == 0 ? "" : "") . ' ' . ($mn - $prc) . ' . ' . 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')"); + $text = '"[login:' . $u->info['login'] . ']" ' . ($u->info['sex'] == 0 ? "" : "") . ' ' . ($mn - $prc) . ' . ' . 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 = ' '; @@ -232,18 +380,25 @@ if ($u->room['file'] == 'bank') { } else { $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) { + } 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); $mne = round($mn / $noc, 2); $mn = round(($mn / 100 * 103 + 5), 2); - $sm = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "bank_kr_to_ekr_[' . date('d.m.Y', time()) . ']" ORDER BY `id` DESC LIMIT 1', 1); + $sm = $u->testAction( + '`uid` = "' . $u->info['id'] . '" AND `vars` = "bank_kr_to_ekr_[' . date( + 'd.m.Y', time() + ) . ']" ORDER BY `id` DESC LIMIT 1', 1 + ); $sm_lim = 100; if (isset($sm['id']) && $sm['vals'] + $mne > $sm_lim) { if ($sm['vals'] < $sm_lim) { - $re2 = ' ' . ($sm_lim - $sm['vals']) . ' .. ( ' . round((($sm_lim - $sm['vals']) * $noc), 2) . ' .), ' . $mne . ' ..'; + $re2 = ' ' . ($sm_lim - $sm['vals']) . ' .. ( ' . round( + (($sm_lim - $sm['vals']) * $noc), 2 + ) . ' .), ' . $mne . ' ..'; } else { $re2 = ' . . (' . $sm_lim . ' .)'; } @@ -252,23 +407,46 @@ if ($u->room['file'] == 'bank') { if (!isset($sm['id'])) { $u->addAction(time(), 'bank_kr_to_ekr_[' . date('d.m.Y') . ']', $mne); } else { - mysql_query('UPDATE `actions` SET `vals` = "' . ($sm['vals'] + $mne) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `actions` SET `vals` = "' . ($sm['vals'] + $mne) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1' + ); } $re2 = ' ' . $mn . ' . ' . $mne . ' .'; $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 `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'); + 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 = '"' . $u->info['login'] . '" [' . $u->info['level'] . '] ' . $mn . ' . ' . $mne . ' ., ' . $u->bank['id'] . '.'; $u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, ''); - $u->addDelo(3, $u->info['id'], ' ' . ceil((int)($_POST['convert_sum2'] * 100 / 100)) . ' . ' . $mne . ' ., ' . round((ceil((int)($_POST['convert_sum2'] * 100 / 100)) / 100 * 3 + 5), 2) . ' . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']); + $u->addDelo( + 3, $u->info['id'], ' ' . ceil( + (int)($_POST['convert_sum2'] * 100 / 100) + ) . ' . ' . $mne . ' ., ' . round( + (ceil((int)($_POST['convert_sum2'] * 100 / 100)) / 100 * 3 + 5), 2 + ) . ' . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', + time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id'] + ); } else { $re2 = ' ' . $mn . ' . '; } } else { - $re2 = ' ' . round((0.01 * ($noc * 1.03) + 5), 2) . ' .'; + $re2 = ' ' . round( + (0.01 * ($noc * 1.03) + 5), 2 + ) . ' .'; } } else { $re2 = ' .'; @@ -281,11 +459,22 @@ if ($u->room['file'] == 'bank') { if ($mn < 0.01 || $mn > 1000000000) { $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'); + $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'], ' ' . $mn . ' . ' . ($mn * $con) . ' ., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn * $con), $u->bank['id']); + $u->addDelo( + 3, $u->info['id'], + ' ' . $mn . ' . ' . ($mn * $con) . ' ., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', + time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn * $con), + $u->bank['id'] + ); $re2 = ' ' . $mn . ' . ' . ($mn * $con) . ' .'; } else { $re2 = ' '; @@ -302,12 +491,24 @@ if ($u->room['file'] == 'bank') { if ($mn < 0.01 || $mn > 1000000000) { $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'); + $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'], ' ' . $mn . ' ., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']); + 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'], + ' ' . $mn . ' ., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', + time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id'] + ); $re2 = ' ' . $mn . ' .'; } else { $re2 = ' '; @@ -324,12 +525,24 @@ if ($u->room['file'] == 'bank') { if ($mn < 0.01 || $mn > 1000000000) { $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'); + $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'], ' ' . $mn . ' ., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']); + 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'], + ' ' . $mn . ' ., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', + time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id'] + ); $re2 = ' ' . $mn . ' .'; } else { $re2 = ' '; @@ -346,12 +559,24 @@ if ($u->room['file'] == 'bank') { if ($mn < 0.01 || $mn > 1000000000) { $re2 = ' ( )'; } else { - $upd = mysql_query('UPDATE `users` SET `money2` = "' . mysql_real_escape_string($u->info['money2'] - $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $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'], ' ' . $mn . ' E., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']); + 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'], + ' ' . $mn . ' E., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', + time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id'] + ); $re2 = ' ' . $mn . ' .'; } else { $re2 = ' '; @@ -368,12 +593,24 @@ if ($u->room['file'] == 'bank') { if ($mn < 0.01 || $mn > 1000000000) { $re2 = ' ( )'; } else { - $upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string($u->info['money'] - $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $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'], ' ' . $mn . ' ., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']); + 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'], + ' ' . $mn . ' ., 0 . (: ' . $u->bank['money1'] . ' ., ' . $u->bank['money2'] . ' .)', + time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id'] + ); $re2 = ' ' . $mn . ' .'; } else { $re2 = ' '; @@ -384,7 +621,10 @@ if ($u->room['file'] == 'bank') { } } 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); + $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 = ' '; } elseif (iconv_strlen($_POST['new_psw1']) < 6 || iconv_strlen($_POST['new_psw1']) > 32) { @@ -393,12 +633,23 @@ if ($u->room['file'] == 'bank') { $re2 = ' '; } else { // - $upd = mysql_query('UPDATE `bank` SET `pass` = "' . mysql_real_escape_string($_POST['new_psw1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1'); + $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->addAction( + time(), 'bank_new_pass', 'id=' . $u->bank['id'] . '&new_pass=' . $_POST['new_psw1'] . '' + ); $u->bank['pass'] = $_POST['new_psw1']; - $re2 = ' ' . getNum($u->bank['id']) . '
    : ' . $u->bank['pass'] . ''; - $u->addDelo(3, $u->info['id'], ' .', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']); + $re2 = ' ' . getNum( + $u->bank['id'] + ) . '
    : ' . $u->bank['pass'] . ''; + $u->addDelo( + 3, $u->info['id'], ' .', time(), $u->info['city'], 'Bank.System', + 0, 0, $u->bank['id'] + ); } else { $re2 = ' '; } @@ -496,7 +747,10 @@ if ($u->room['file'] == 'bank') { id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.11&rnd=';" - title=""> + title=""> @@ -605,7 +859,9 @@ if ($u->room['file'] == 'bank') { -

    @@ -884,16 +1133,12 @@ if ($u->room['file'] == 'bank') { @@ -951,24 +1182,26 @@ if ($u->room['file'] == 'bank') { -
    - - + - - - - room['file'] == 'bank') { ['UAH', '. '], ['BYR', ' '], ['AZN', ' '], - ['GBP', '. '] + ['GBP', '. '], ]; - while ($i < count($true)) { - ?> - - - - %s %s
    '; + $kurs_str = ''; + foreach ($true as $item) { + if ($pl[$item[0]] > 0) { + $kurs_str .= sprintf( + $str, round(($pl['cur'] / $pl[$item[0]]), 4), $item[1] + ); + } } + ?> +
    + + + + + +
    + - - - - - - - - - - - - + : + . -
    -
    1 . = -
    -
    10UAH = 1 -
    -
    -
    0.35USD = 1 -
    -
    -
    20RUB = 1 -
    -
    -
    0.29EUR = 1 -
    -
    +
    - +
    info['id'] . '" AND `dop` = "' . $u->bank['id'] . '" AND `type` = "3" ORDER BY `time` DESC LIMIT 21'); + $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' + ); while ($pl = mysql_fetch_array($sp)) { ?> -
    - - + + + + + +
    -
    - ' . date('d.m.Y H:i', $pl['time']) . ' '; - echo $pl['text']; ?>
    +
    @@ -978,4 +1211,3 @@ if ($u->room['file'] == 'bank') { \ No newline at end of file diff --git a/modules_data/location/btl_.php b/modules_data/location/btl_.php index 1c5ec920..900e8696 100644 --- a/modules_data/location/btl_.php +++ b/modules_data/location/btl_.php @@ -1,772 +1,1167 @@ -info['battle'] == 0) { - $u->info['battle'] = $btl_last['battle']; - //die(); +if (!$old_battle) { + return; +} +if (isset($btl_last['id']) && $u->info['battle'] == 0) { + $u->info['battle'] = $btl_last['battle']; } -if($u->info['battle'] == 0 || isset($_GET['bend'])) -{ - //header('location: main.php'); - //die(); - die(''); +if ($u->info['battle'] == 0 || isset($_GET['bend'])) { + die(''); } -$thisBattle = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$u->info['battle'].'" LIMIT 1')); +$thisBattle = mysql_fetch_array( + mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $u->info['battle'] . '" LIMIT 1') +); -$allprice = mysql_fetch_array(mysql_query('SELECT SUM(`price1`) FROM `battle_users` WHERE `battle` = "'.$u->info['battle'].'" GROUP BY `uid` LIMIT 1')); +$allprice = mysql_fetch_array( + mysql_query( + 'SELECT SUM(`price1`) FROM `battle_users` WHERE `battle` = "' . $u->info['battle'] . '" GROUP BY `uid` LIMIT 1' + ) +); $allprice = $allprice[0]; -function typeBattle($x) { - $r = array(0,0,'',' '); - if( $x < 50000 ) { - // - }elseif( $x >= 50000 && $x < 100000 ) { - $r = array(25,50,' ',' '); - }elseif( $x < 500000 ) { - $r = array(50,75,' ',' '); - }elseif( $x < 1000000 ) { - $r = array(75,100,' ',' '); - }elseif( $x < 2500000 ) { - $r = array(100,125,' ',' '); - }elseif( $x >= 5000000 ) { - $r = array(150,150,' ',' '); - } - return $r; +function typeBattle($x) +{ + $r = [0, 0, '', ' ']; + if ($x < 50000) { + // + } elseif ($x >= 50000 && $x < 100000) { + $r = [25, 50, ' ', ' ']; + } elseif ($x < 500000) { + $r = [50, 75, ' ', ' ']; + } elseif ($x < 1000000) { + $r = [75, 100, ' ', ' ']; + } elseif ($x < 2500000) { + $r = [100, 125, ' ', ' ']; + } elseif ($x >= 5000000) { + $r = [150, 150, ' ', ' ']; + } + return $r; } -$allprice = typeBattle($allprice); - if ($thisBattle['smert'] == 1) - { - $allprice = array(150,150,' ',' '); - } -/*if( $u->info['admin'] > 0 ) { - echo ''; -}else{*/ - echo ''; -//} +$allprice = typeBattle($allprice); +if ($thisBattle['smert'] == 1) { + $allprice = [150, 150, ' ', ' ']; +} + +echo ''; ?> - + -
    - - - - - - -
    - -
    - - - - - - -
    -
    -
    - - - - - - -
    - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - -
    -
    - - - - - - - - - -
    -
    - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
    -
     
    -
      ,
     
     
    -
     
    -
      ,
     
     
    -
     
    -
      ,
    () 
     
    -
     
    -
      ,
     
     
    -
     
    -
      ,
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
       - - - - - - - info['lider'] != $u->info['battle'] ) { ?>style="display:none;cursor:pointer;"style="cursor:pointer;" onclick="top.leaderFight();" id="btn_down_img3" style="cursor:pointer;" title=" " src="https://img.new-combats.com/i/ico_change_leader1.gif" width="16" height="19" />
     
    -
    - info['level'] == 0) { ?>
    -
    !!!

    - + } + //space + if (event.keyCode == 32 && top.c.noEr == 0) { + document.getElementById('reflesh_btn').setAttribute("class", "buttons btnnew btnnew2"); + document.getElementById('reflesh_btn').setAttribute("onclick", ""); + + if (document.getElementById('reflesh_btn').disabled) { + } else { + reflesht(); + top.c.noEr = 1; + clearTimeout(top.c.noErTmr); + top.c.noErTmr = setTimeout('top.c.noEr = 0;', 2000); + } + + } + + if (event.keyCode == 49) { + change_radioKeys(1, false); + } + if (event.keyCode == 50) { + change_radioKeys(2, false); + } + if (event.keyCode == 51) { + change_radioKeys(3, false); + } + if (event.keyCode == 52) { + change_radioKeys(4, false); + } + if (event.keyCode == 53) { + change_radioKeys(5, false); + } + if (event.keyCode == 48) { + change_radioKeys(0, false); + } + + + } + $(document.body).bind('keyup', function (event) { + mbsum(event); + }); + + + function shpb() { + $(document).find('div.pimg').unbind('mouseover'); + $(document).find('div.pimg').unbind('mouseout'); + $(document).find('div.pimg').unbind('mousedown'); + $(document).find('div.pimg').bind('mouseover', function () { + top.hi(this, $(this).attr('stt'), event, 0, 1, 1, 1, 'stt'); + }); + $(document).find('div.pimg').bind('mouseout', function () { + top.hic(); + }); + $(document).find('div.pimg').bind('mousedown', function () { + top.hic(); + }); + var test = $(document).find('div.pimg'); + var i = 0; + while (i != -1) { + if (test[i] != undefined) { + if ($(test[i]).attr('pog') > 1 && $(test[i]).attr('stl') == 0) { + $(test[i]).attr('stl', 1); + $(test[i]).html('' + $(test[i]).attr('pog') + '' + $(test[i]).attr('pog') + '' + $(test[i]).attr('pog') + '' + $(test[i]).attr('pog') + '
    ' + $(test[i]).attr('pog') + '
    ' + $(test[i]).html()); + } else if ($(test[i]).attr('col') > 1 && $(test[i]).attr('stl') == 0) { + $(test[i]).attr('stl', 1); + $(test[i]).html('x' + $(test[i]).attr('col') + 'x' + $(test[i]).attr('col') + 'x' + $(test[i]).attr('col') + 'x' + $(test[i]).attr('col') + '
    x' + $(test[i]).attr('col') + '
    ' + $(test[i]).html()); + } + } else { + i = -2; + } + i++; + } + } + +
    + + + + + + +
    + +
    + + + - -
    +
    +
    +
    - info['level'] < 2) { echo ' style="display:none;" '; } ?> border="0" cellspacing="0" cellpadding="0"> - - - - - - - - - -
    info['tactic1']; ?> info['tactic2']; ?> info['tactic3']; ?> info['tactic4']; ?> info['tactic5']; ?> info['tactic6']); ?> info['tactic7']<0){ $u->info['tactic7'] = 0; } echo 0+$u->info['tactic7']; ?>
    -
    -
    - - - - - - - -
    -
    -
    -
    -
    -
    - - - - + + +
      -
    -
    - :  info['battle_yron']); ?> HP .
    - - (: +info['battle_exp']); ?> ., ) +
    +
    + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + +
    +
    +
    + + + + +
    +
    + + + + + + +
    +
    +
    +
    -
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +   + +
    +
    +
     
    +
     
    +
      , + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +   + +
    +
    +
     
    +
     
    +
      , +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +   + +
    +
    +
     
    +
     
    +
      , +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    () +   + +
    +
    +
     
    +
     
    +
      , +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +   + +
    +
    +
     
    +
     
    +
      , +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + +
      + + + +   + + + + + + + info['lider'] != $u->info['battle']) { ?>style="display:none;cursor:pointer;" + style="cursor:pointer;" onclick="top.leaderFight();" id="btn_down_img3" + style="cursor:pointer;" + title=" " + src="https://img.new-combats.com/i/ico_change_leader1.gif" + width="16" height="19"/> +
     
    +
    +
    + info['level'] == 0) { ?> +
    +
    + !!! +
    +
    + +
    +
    +
    + info['level'] < 2) { + echo ' style="display:none;" '; + } ?> border="0" cellspacing="0" cellpadding="0"> + + + + + + + + + +
    info['tactic1']; ?> info['tactic2']; ?> info['tactic3']; ?> info['tactic4']; ?> info['tactic5']; ?> info['tactic6']); ?> + info['tactic7'] < 0) { + $u->info['tactic7'] = 0; + } + echo 0 + $u->info['tactic7']; ?>
    +
    +
    + + + + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + +
      +
    +
    + :  info['battle_yron']); ?> HP .
    + + (: +info['battle_exp']); ?> ., ) +
    +
    +
    +

    + ( NaN .) +
    +
    +
    + + + + + + +
      +
    + +
     
    -

    - ( NaN .)
    -
    - - - - - - -
     

     
    -
    - + - - -
    - + startCountdown(); + genZoneAtack(); + genZoneBlock(); + refleshPoints(); + + +
    diff --git a/modules_data/location/cp1.php b/modules_data/location/cp1.php index 9a74061e..35be5ad8 100644 --- a/modules_data/location/cp1.php +++ b/modules_data/location/cp1.php @@ -178,9 +178,9 @@ function AtackNoWindow()
    src="https://img.new-combats.com/city/capitalcity/day/loto.gif" class="aFilter" width="86" height="63" />
    -
    src="https://img.new-combats.com/i/images/300x225/capital/2shop.gif" width="73" height="47" class="aFilter" />
    +
    src="https://img.new-combats.com/i/images/300x225/capital/2shop.gif" width="73" height="47" class="aFilter" />
    -
    src="https://img.new-combats.com/city/capitalcity/day/2comission.gif" width="48" height="36" class="aFilter" />
    +
    src="https://img.new-combats.com/i/images/300x225/capital/2remont.gif" width="71" height="45" class="aFilter" />
    @@ -193,7 +193,7 @@ function AtackNoWindow() if( isset($btc['id']) ) { if (timeOut($btc['res_x']-time()) =='0 .'){ ?> -
    +
    -
    +
    @@ -213,7 +213,7 @@ function AtackNoWindow()
    src="https://img.new-combats.com/city/capitalcity/day/2pochta.gif" width="111" height="72" class="aFilter" />
    -
    onclick="alert(' . .')" onMouseOver="this.className='aFilterhover';" onMouseOut="this.className='aFilter';" src="https://img.new-combats.com/city/capitalcity/day/2vokzal.gif" width="92" height="62" class="aFilter" />
    +
    onclick="alert(' . .')" onMouseOver="this.className='aFilterhover';" onMouseOut="this.className='aFilter';" src="https://img.new-combats.com/city/capitalcity/day/2vokzal.gif" width="92" height="62" class="aFilter" />
    @@ -252,7 +252,6 @@ if(date("H")<6 || date("H")>=22)       -         diff --git a/modules_data/location/dragopsh.php b/modules_data/location/dragopsh.php index 4fd149df..f2dcf24f 100644 --- a/modules_data/location/dragopsh.php +++ b/modules_data/location/dragopsh.php @@ -1,937 +1,946 @@ room['file']=='dragopsh') { - - 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']) ) { - die(' ...'); - } - - $varsitmsund = array( - // - array(4391,1), - array(1043,1), - array(3106,1), - array(2544,2), - //array(2545,1), - array(724,1), - array(1187,1), - array(1043,1), - array(3106,1), - array(2544,2), - //array(2545,1), - array(724,1), - array(1187,1), - array(1043,1), - array(3106,1), - array(2544,2), - //array(2545,1), - array(724,1), - array(1187,1), - array(1043,1), - array(3106,1), - array(2544,2), - //array(2545,1), - array(724,1), - array(1187,1) - ); - - $varsitm = array( - // - array(4373,1), - array(4374,1), - array(4375,1), - array(4376,1), - array(4377,1), - array(4378,1), - array(4379,1), - array(4380,1), - array(4381,1), - array(4382,1), - array(4383,1), - array(4384,1), - array(4385,1), - // - array(4373,1), - array(4374,1), - array(4375,1), - array(4376,1), - array(4377,1), - array(4378,1), - array(4379,1), - array(4380,1), - array(4381,1), - array(4382,1), - array(4383,1), - array(4384,1), - array(4385,1), - // - array(4373,1), - array(4374,1), - array(4375,1), - array(4376,1), - array(4377,1), - array(4378,1), - array(4379,1), - array(4380,1), - array(4381,1), - array(4382,1), - array(4383,1), - array(4384,1), - array(4385,1) - ); - $varsitmart = array( - // - array(2109,1), - array(2111,1), - array(2099,1), - array(2105,1), - array(2122,1), - array(2101,1), - array(2114,1), - array(2107,1), - array(2108,1) - ); - - $map = mysql_fetch_array(mysql_query('SELECT `id`,`data`,`update` FROM `laba_map` WHERE `id` = "'.$u->info['dnow'].'" LIMIT 1')); - if( !isset($map['id']) ) { - die(' ...'); - } - - $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$u->info['dnow'].'" AND `vars` = "dielaba" LIMIT 1')); - $dies = $dies[0]; - - $map_d = json_decode($map['data']); - - $varos = array(); - $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "'.$u->info['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1')); - - $errors = ''; - $effed = ''; - - if( isset($_GET['takeitm']) ) { - $var = array( - 'obj' => mysql_fetch_array(mysql_query('SELECT `i`.*,`m`.`name`,`m`.`inslot` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`id` = "'.mysql_real_escape_string($_GET['takeitm']).'" AND `i`.`lib` = "'.$lab['id'].'" AND `i`.`x` = "'.$u->info['x'].'" AND `i`.`y` = "'.$u->info['y'].'" LIMIT 1')) - ); - if(isset($var['obj']['id'])) { - if( $var['obj']['take'] == 0 ) { - $var['sex'] = ''; if($u->info['sex'] == 1) { $var['sex'] = ''; } - $var['text'] = ''.$u->info['login'].' '.$var['sex'].' "'.$var['obj']['name'].'"'; - $errors .= ' "'.$var['obj']['name'].'"'; - mysql_query('UPDATE `laba_itm` SET `take` = "'.$u->info['id'].'" WHERE `id` = "'.$var['obj']['id'].'" LIMIT 1'); - if( $var['obj']['inslot'] > 0 ) { - $u->addItem($var['obj']['itm'],$u->info['id'],'|fromlaba=1|nosavelaba=1|nosale=1'); - }else{ - $u->addItem($var['obj']['itm'],$u->info['id'],'|fromlaba=1'); - } - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$u->info['dnow']."','".$u->info['city']."','".$u->info['room']."','','','".$var['text']."','".time()."','6','0','1','1')"); - }else{ - $errors .= ' - ...'; - } - }else{ - $errors = ' ...'; - } - }elseif( isset($_GET['useobj']) ) { - $var = array( - 'obj' => mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `id` = "'.mysql_real_escape_string($_GET['useobj']).'" AND `lib` = "'.$lab['id'].'" AND `x` = "'.$u->info['x'].'" AND `y` = "'.$u->info['y'].'" LIMIT 1')) - ); - if(isset($var['obj']['id'])) { - if( $var['obj']['use'] == 0 ) { - if( $var['obj']['type'] == 1 ) { - // - $var['sex'] = ''; if($u->info['sex'] == 1) { $var['sex'] = ''; } - - // , - if( rand(0,100) < 25 ) { - // varsitmart - $var['itm'] = $varsitm[rand(0,count($varsitm)-1)]; - $var['itm'] = $var['itm'][0]; - $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$var['itm'].'" LIMIT 1')); - if( isset($var['itm']['id']) ) { - mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( - "'.$u->info['id'].'","'.$lab['id'].'","'.time().'","'.$var['itm']['id'].'","'.$u->info['x'].'","'.$u->info['y'].'","0" +if ($u->room['file'] == 'dragopsh') { + + $d = new Dungeon; + $d->start(); + + $lab = mysql_fetch_array(mysql_query('SELECT * FROM `laba_now` WHERE `id` = "' . $u->info['dnow'] . '" LIMIT 1')); + if (!isset($lab['id'])) { + die(' ...'); + } + + $varsitmsund = [// + [4391, 1], [1043, 1], [3106, 1], [2544, 2], //array(2545,1), + [724, 1], [1187, 1], [1043, 1], [3106, 1], [2544, 2], //array(2545,1), + [724, 1], [1187, 1], [1043, 1], [3106, 1], [2544, 2], //array(2545,1), + [724, 1], [1187, 1], [1043, 1], [3106, 1], [2544, 2], //array(2545,1), + [724, 1], [1187, 1]]; + + $varsitm = [// + [4373, 1], [4374, 1], [4375, 1], [4376, 1], [4377, 1], [4378, 1], [4379, 1], [4380, 1], [4381, 1], [4382, 1], [4383, 1], [4384, 1], [4385, 1], // + [4373, 1], [4374, 1], [4375, 1], [4376, 1], [4377, 1], [4378, 1], [4379, 1], [4380, 1], [4381, 1], [4382, 1], [4383, 1], [4384, 1], [4385, 1], // + [4373, 1], [4374, 1], [4375, 1], [4376, 1], [4377, 1], [4378, 1], [4379, 1], [4380, 1], [4381, 1], [4382, 1], [4383, 1], [4384, 1], [4385, 1]]; + $varsitmart = [// + [2109, 1], [2111, 1], [2099, 1], [2105, 1], [2122, 1], [2101, 1], [2114, 1], [2107, 1], [2108, 1]]; + + $map = mysql_fetch_array(mysql_query('SELECT `id`,`data`,`update` FROM `laba_map` WHERE `id` = "' . $u->info['dnow'] . '" LIMIT 1')); + if (!isset($map['id'])) { + die(' ...'); + } + + $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "' . $u->info['id'] . '" AND `dn` = "' . $u->info['dnow'] . '" AND `vars` = "dielaba" LIMIT 1')); + $dies = $dies[0]; + + $map_d = json_decode($map['data']); + + $varos = []; + $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1')); + + $errors = ''; + $effed = ''; + + if (isset($_GET['takeitm'])) { + $var = ['obj' => mysql_fetch_array(mysql_query('SELECT `i`.*,`m`.`name`,`m`.`inslot` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`id` = "' . mysql_real_escape_string($_GET['takeitm']) . '" AND `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" LIMIT 1'))]; + if (isset($var['obj']['id'])) { + if ($var['obj']['take'] == 0) { + $var['sex'] = ''; + if ($u->info['sex'] == 1) { + $var['sex'] = ''; + } + $var['text'] = '' . $u->info['login'] . ' ' . $var['sex'] . ' "' . $var['obj']['name'] . '"'; + $errors .= ' "' . $var['obj']['name'] . '"'; + mysql_query('UPDATE `laba_itm` SET `take` = "' . $u->info['id'] . '" WHERE `id` = "' . $var['obj']['id'] . '" LIMIT 1'); + if ($var['obj']['inslot'] > 0) { + $u->addItem($var['obj']['itm'], $u->info['id'], '|fromlaba=1|nosavelaba=1|nosale=1'); + } else { + $u->addItem($var['obj']['itm'], $u->info['id'], '|fromlaba=1'); + } + mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $u->info['dnow'] . "','" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $var['text'] . "','" . time() . "','6','0','1','1')"); + } else { + $errors .= ' - ...'; + } + } else { + $errors = ' ...'; + } + } elseif (isset($_GET['useobj'])) { + $var = ['obj' => mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `id` = "' . mysql_real_escape_string($_GET['useobj']) . '" AND `lib` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1'))]; + if (isset($var['obj']['id'])) { + if ($var['obj']['use'] == 0) { + if ($var['obj']['type'] == 1) { + // + $var['sex'] = ''; + if ($u->info['sex'] == 1) { + $var['sex'] = ''; + } + + // , + if (rand(0, 100) < 25) { + // varsitmart + $var['itm'] = $varsitm[rand(0, count($varsitm) - 1)]; + $var['itm'] = $var['itm'][0]; + $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $var['itm'] . '" LIMIT 1')); + if (isset($var['itm']['id'])) { + mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( + "' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['itm']['id'] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0" )'); - }else{ - $var['itm']['name'] = ' ...'; - } - } - // , - $var['itm'] = $varsitmsund[rand(0,count($varsitmsund)-1)]; - $var['itm'] = $var['itm'][0]; - $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$var['itm'].'" LIMIT 1')); - if( isset($var['itm']['id']) ) { - $u->addItem($var['itm']['id'],$u->info['id'],'|fromlaba=1'); - }else{ - $var['itm']['name'] = ' ...'; - } - $var['text'] = ' '.$u->info['login'].' '.$var['sex'].' ... "'.$var['itm']['name'].'"'; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$u->info['dnow']."','".$u->info['city']."','".$u->info['room']."','','','".$var['text']."','".time()."','6','0','1','1')"); - $errors .= ' '.$u->info['login'].' '.$var['sex'].' ... "'.$var['itm']['name'].'"'; - $var['obj']['use'] = $u->info['id']; - }elseif( $var['obj']['type'] == 5 ) { - // - $var['sex'] = ''; if($u->info['sex'] == 1) { $var['sex'] = ''; } - - // , - if( rand(0,100) < 70 ) { - // varsitmart - $var['itm'] = $varsitmart[rand(0,count($varsitmart)-1)]; - $var['itm'] = $var['itm'][0]; - $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$var['itm'].'" LIMIT 1')); - if( isset($var['itm']['id']) ) { - mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( - "'.$u->info['id'].'","'.$lab['id'].'","'.time().'","'.$var['itm']['id'].'","'.$u->info['x'].'","'.$u->info['y'].'","0" - )'); - }else{ - $var['itm']['name'] = ' ...'; - } - } - $var['itm'] = $varsitm[rand(0,count($varsitm)-1)]; - $var['itm'] = $var['itm'][0]; - $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$var['itm'].'" LIMIT 1')); - if( isset($var['itm']['id']) ) { - //$u->addItem($var['itm']['id'],$u->info['id'],'|fromlaba=1'); - mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( - "'.$u->info['id'].'","'.$lab['id'].'","'.time().'","'.$var['itm']['id'].'","'.$u->info['x'].'","'.$u->info['y'].'","0" - )'); - }else{ - $var['itm']['name'] = ' ...'; - } - $var['text'] = ' '.$u->info['login'].' '.$var['sex'].' ...'; - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$u->info['dnow']."','".$u->info['city']."','".$u->info['room']."','','','".$var['text']."','".time()."','6','0','1','1')"); - $errors .= ' '.$u->info['login'].' '.$var['sex'].' ...'; - $var['obj']['use'] = $u->info['id']; - }elseif( $var['obj']['type'] == 3 ) { - // - $var['sex'] = ''; if($u->info['sex'] == 1) { $var['sex'] = ''; } - $var['hpp'] = rand(2,5)*10; - $var['hp'] = round($u->stats['hpAll']/100*$var['hpp']); - $u->stats['hpNow'] += $var['hp']; - if( $u->stats['hpNow'] > $u->stats['hpAll'] ) { - $u->stats['hpNow'] = $u->stats['hpAll']; - } - $var['text'] = ' '.$u->info['login'].' '.$var['sex'].' , +'.$var['hpp'].'% (+'.$var['hp'].'HP)'; - mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->stats['hpNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$u->info['dnow']."','".$u->info['city']."','".$u->info['room']."','','','".$var['text']."','".time()."','6','0','1','1')"); - $errors .= ' '.$u->info['login'].' '.$var['sex'].' , +'.$var['hpp'].'% (+'.$var['hp'].'HP)'; - $var['obj']['use'] = $u->info['id']; - } - if( $var['obj']['use'] > 0 ) { - mysql_query('UPDATE `laba_obj` SET `use` = "'.$var['obj']['use'].'" WHERE `id` = "'.$var['obj']['id'].'" LIMIT 1'); - } - }else{ - $errors = '- ...'; - } - }else{ - $errors = ' ...'; - } - - unset($var); - } - - // - $mapsee = ''; - $real_x = $u->info['x']; - $real_y = $u->info['y']; - - if( $real_y < 6 ) { - $real_y = 6; - } - if( $real_x < 6 ) { - $real_x = 6; - } - if( $real_y > count($map_d) - 7 ) { - $real_y = count($map_d) - 7; - } - if( $real_x > count($map_d) - 7 ) { - $real_x = count($map_d) - 7; - } - - $objs = array( ); - - $sp = mysql_query('SELECT * FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'" AND `x` > '.($real_x - 7).' AND `x` < '.($real_x + 7).' AND `y` > '.($real_y - 12).' AND `y` < '.($real_y + 12).' LIMIT 144'); - while( $pl = mysql_fetch_array($sp) ) { - $objs[$pl['x']][$pl['y']] = $pl; - } - - $i = 1; - $goodgoo = array( 1 => 0 , 2 => 0 , 3 => 0 , 4 => 0 ); - while( $i <= 4 ) { - $goto = array( 'x' => $u->info['y'] , 'y' => $u->info['x'] ); - if( $i == 1 ) { - $goto['x']--; - }elseif( $i == 2 ) { - $goto['y']--; - }elseif( $i == 3 ) { - $goto['x']++; - }elseif( $i == 4 ) { - $goto['y']++; - } - if( $map_d[$goto['y']][$goto['x']] == 0 && $goto['x'] > 0 && $goto['x'] < count($map_d)-1 && $u->info['timeGo'] <= time() ) { - $goodgoo[$i] = 1; - } - $i++; - } - - if( isset($_GET['goto']) ) { - $goto = array( 'x' => $u->info['y'] , 'y' => $u->info['x'] ); - if( $_GET['goto'] == 1 ) { - $goto['x']--; - }elseif( $_GET['goto'] == 2 ) { - $goto['y']--; - }elseif( $_GET['goto'] == 3 ) { - $goto['x']++; - }elseif( $_GET['goto'] == 4 ) { - $goto['y']++; - } - if( $goodgoo[$_GET['goto']] == 1 && $u->info['timeGo'] <= time() ) { - // - $u->info['y'] = $goto['x']; - $u->info['x'] = $goto['y']; - $real_x = $u->info['x']; - $real_y = $u->info['y']; - $varos['timego'] = 5; - if( isset($varos['trap1']['time']) ) { - $varos['timego'] += 3; - } - if( isset($u->stats['speed_dungeon']) ) { - $varos['timego'] = $varos['timego']-floor($varos['timego']/100*$u->stats['speed_dungeon']); - if( $varos['timego'] < 1 ) { - $varos['timego'] = 1; - } - } - $u->info['timeGo'] = time()+$varos['timego']; - $u->info['timeGoL'] = time(); - mysql_query('UPDATE `stats` SET `x` = "'.$u->info['x'].'" ,`y` = "'.$u->info['y'].'",`timeGoL` = "'.$u->info['timeGoL'].'",`timeGo` = "'.$u->info['timeGo'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - - $tmdg = ($u->info['timeGo']-time()); - $tmdgl = ($u->info['timeGo']-$u->info['timeGoL']); - $tmdgp = floor(100-$tmdg/$tmdgl*100); if( $tmdgp < 1 ) { $tmdgp = 1; }elseif( $tmdgp > 100 ) { $tmdgp = 100; } - $tmdgm = 25*$tmdgl; - - $tmdg = floor(40/100*$tmdgp); - - if( $tmdg < 1 ) { - $tmdg = 1; - }elseif( $tmdg > 40 ) { - $tmdg = 40; - } - - if( $real_y < 6 ) { - $real_y = 6; - } - if( $real_x < 6 ) { - $real_x = 6; - } - if( $real_y > count($map_d) - 7 ) { - $real_y = count($map_d) - 7; - } - if( $real_x > count($map_d) - 7 ) { - $real_x = count($map_d) - 7; - } - - if( isset($_POST['exit']) ) { - if( $lab['users'] < 2 ) { - // - mysql_query('DELETE FROM `laba_now` WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `laba_map` WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'"'); - mysql_query('DELETE FROM `laba_act` WHERE `lib` = "'.$lab['id'].'"'); - mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "'.$lab['id'].'"'); - }else{ - $lab['users']--; - mysql_query('UPDATE `laba_now` SET `users` = "'.$lab['users'].'" WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - } - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%fromlaba=1%"'); - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%nosavelaba=1%"'); - mysql_query('UPDATE `users` SET `room` = "369" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dnow` = "0",`x`="0",`y`="0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - - die(''); - } - - // - $itms = ''; - - if(isset($objs[$u->info['x']][$u->info['y']]['id'])) { - $var = array(); - $mitm = $objs[$u->info['x']][$u->info['y']]; - if( $mitm['type'] == 6 ) { - // - if( $mitm['vars'] < 25 ) { - $i = 0; - while( $i < $mitm['vars'] ) { - $var['add'] = $varsitm[rand(0,count($varsitm)-1)]; - if( $var['add'][1] > 0 ) { - $j = 0; - while( $j < $var['add'][1] ) { - mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( - "'.$u->info['id'].'","'.$lab['id'].'","'.time().'","'.$var['add'][0].'","'.$u->info['x'].'","'.$u->info['y'].'","0" - )'); - $j++; - } - } - $i++; - } - }else{ - // - - } - mysql_query('DELETE FROM `laba_obj` WHERE `id` = "'.$mitm['id'].'" LIMIT 1'); - }elseif( $mitm['type'] == 2 ) { - if( $mitm['use'] == 0 ) { - $tbtl = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `team_win` = -1 AND `dn_id` = "'.$lab['id'].'" AND `x` = "'.$u->info['x'].'" AND `y` = "'.$u->info['y'].'" LIMIT 1')); - if( isset($tbtl['id']) ) { - // - mysql_query('UPDATE `users` SET `battle` = "'.$tbtl['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->error = ' ... '; - }else{ - $var['bots'] = array( - array(357,5), - array(358,5), - array(359,5), - array(360,5), - array(361,3), - array(362,3), - array(363,3), - array(364,2), - array(365,5), - array(366,5), - array(367,3) - ); - // - if( $mitm['vars'] != NULL ) { - // - }else{ - // - $i = 0; - while( $i <= $u->info['level'] ) { - $var['ab'] = $var['bots'][rand(0,count($var['bots'])-1)]; - $mitm['vars'] .= '|'.$var['ab'][0]; - $i += $var['ab'][1]; - } - // - $mitm['vars'] = ltrim($mitm['vars'],'|'); - // - mysql_query('UPDATE `laba_obj` SET `vars` = "'.$mitm['vars'].'" WHERE `id` = "'.$mitm['id'].'" LIMIT 1'); - } - // - $mitm['vars'] = explode('|',$mitm['vars']); - // - if( count($mitm['vars']) > 0 ) { - $btl_id = 0; - $expB = 0; - $btld = 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 ( - "102", - "'.$lab['id'].'", - "'.$u->info['x'].'", - "'.$u->info['y'].'", - "'.$u->info['city'].'", - "'.time().'", - "'.$btld['players'].'", - "'.$btld['timeout'].'", - "'.$btld['type'].'", - "'.$btld['invis'].'", - "'.$btld['noinc'].'", - "'.$btld['travmChance'].'", - "'.$btld['typeBattle'].'", - "'.$btld['addExp'].'", - "'.$btld['money'].'")'); - $btl_id = mysql_insert_id(); - } - if( $btl_id > 0 ) { - // - $i = 0; - while( $i < count($mitm['vars']) ) { - - $k = $u->addNewbot($mitm['vars'][$i],NULL,NULL,$logins_bot); - $logins_bot = $k['logins_bot']; - if($k!=false) - { - $upd = mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'",`room` = "-100" WHERE `id` = "'.$k['id'].'" LIMIT 1'); - if($upd) - { - $upd = mysql_query('UPDATE `stats` SET `x`="'.$u->info['x'].'",`y`="'.$u->info['y'].'",`team` = "2" WHERE `id` = "'.$k['id'].'" LIMIT 1'); - if($upd) - { - $j++; - } - } - } - - $i++; - } - unset($logins_bot); - if($j>0) - { - mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->error = ' ... '; - }else{ - $u->error = ' , ...'; - } - } - // - } - } - }elseif( $mitm['type'] == 1 ) { - // - if( $mitm['use'] == 0 ) { - $itms .= ''; - }else{ - $itms .= ''; - } - }elseif( $mitm['type'] == 3 ) { - // - if( $mitm['use'] == 0 ) { - $itms .= ''; - }else{ - $itms .= ''; - } - }elseif( $mitm['type'] == 4 ) { - if( $mitm['use'] == 0 ) { - // - $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`,`vals`,`time` FROM `laba_act` WHERE `uid` = "'.$u->info['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1')); - $var['time'] = rand(1,60); - if( isset($var['trap1']['id']) ) { - mysql_query('UPDATE `laba_act` SET `vals` = "'.( $var['trap1']['vals'] + $var['time'] ).'",`time` = "'.( $var['trap1']['time'] + $var['time']*60 ).'" WHERE `id` = "'.$var['trap1']['id'].'" LIMIT 1'); - }else{ - mysql_query('INSERT INTO `laba_act` (`uid`,`time`,`lib`,`vars`,`vals`) VALUES ( - "'.$u->info['id'].'","'.(time()+$var['time']*60).'","'.$lab['id'].'","trap1","'.$var['time'].'" - )'); - } - mysql_query('UPDATE `laba_obj` SET `use` = "'.$u->info['id'].'" WHERE `id` = "'.$mitm['id'].'" LIMIT 1'); - - $var['sex'] = ''; if($u->info['sex'] == 1) { $var['sex'] = ''; } - $var['text'] = ' '.$u->info['login'].' '.$var['sex'].' ...'; - - $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "'.$u->info['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1')); - - mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$u->info['dnow']."','".$u->info['city']."','".$u->info['room']."','','','".$var['text']."','".time()."','6','0','1','1')"); - $errors .= ' '.$u->info['login'].' '.$var['sex'].' ... +3 (: +'.$var['time'].' .)'; - } - }elseif( $mitm['type'] == 5 ) { - // - if( $mitm['use'] == 0 ) { - $itms .= ''; - }else{ - $itms .= ''; - } - } - unset($var); - } - - $sp = mysql_query('SELECT `i`.*,`m`.`name`,`m`.`img` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`lib` = "'.$lab['id'].'" AND `i`.`x` = "'.$u->info['x'].'" AND `i`.`y` = "'.$u->info['y'].'" AND `i`.`take` = "0"'); - while( $pl = mysql_fetch_array($sp) ) { - $itms .= ' '; - } - - if( $itms != '' ) { - $itms = ' :

    '.$itms.'
    '; - }elseif( $u->info['y'] == count($map_d)-2 ) { - // ! - if( $lab['users'] < 2 ) { - // - mysql_query('DELETE FROM `laba_now` WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `laba_map` WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'"'); - mysql_query('DELETE FROM `laba_act` WHERE `lib` = "'.$lab['id'].'"'); - mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "'.$lab['id'].'"'); - }else{ - $lab['users']--; - mysql_query('UPDATE `laba_now` SET `users` = "'.$lab['users'].'" WHERE `id` = "'.$lab['id'].'" LIMIT 1'); - } - $u->addItem(4392,$u->info['id'],'|fromlaba=1|nosale=1'); - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%fromlaba=1%" AND `data` LIKE "%nosavelaba=1%"'); - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%nosavelaba=1%"'); - mysql_query('UPDATE `users` SET `room` = "369" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `dnow` = "0",`x`="0",`y`="0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $r = ' " (50.)"'; - mysql_query("INSERT INTO `chat` (`typeTime`,`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','1','".$u->info['city']."','".$u->info['room']."','','".$u->info['login']."','".$r."','".time()."','6','0')"); - $r = ' " " !'; - mysql_query("INSERT INTO `chat` (`typeTime`,`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','1','".$u->info['city']."','".$u->info['room']."','','".$u->info['login']."','".$r."','".time()."','6','0')"); - // - die(''); - } - - $sp = mysql_query('SELECT `s`.`x`,`s`.`y`,`u`.`id`,`u`.`login`,`u`.`level` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`dnow` = "'.$lab['id'].'" AND `s`.`id` != "'.$u->info['id'].'" LIMIT 5'); - $pi = 1; - while( $pl = mysql_fetch_array($sp) ) { - $objs[$pl['x']][$pl['y']] = array(2 => '
    '); // 1 - $pi++; - } - - $objs[$u->info['x']][$u->info['y']] = array(2 => '
    '); // 1 - $i = 0; - while( $i <= count($map_d) ) { - $j = 0; - while( $j < count($map_d[$i]) ) { - if( $i > $real_x - 6 && $i < $real_x + 6 && $j > $real_y - 6 && $j < $real_y + 6 ) { - if( $map_d[$i][$j] == 1 ) { - $mapsee .= '
    '.$objs[$i][$j][2].'
    '; - }else{ - if( !isset($objs[$i][$j]['id']) ) { - if( isset($objs[$i][$j][2]) ) { - // - }elseif( $j == 1 ) { - $objs[$i][$j][2] = '
    '; - }elseif( $j == count($map_d)-2 ) { - $objs[$i][$j][2] = '
    '; - } - }else{ - if( $objs[$i][$j]['use'] == 0 ) { - $objs[$i][$j][2] = '
    '; - }else{ - $objs[$i][$j][2] = ''; - } - } - $mapsee .= '
    '.$objs[$i][$j][2].'
    '; - } - } - $j++; - } - if( $i > $real_x - 6 && $i < $real_x + 6 ) { - $mapsee .= '
    '; - } - $i++; - } - $mapsee = '
    '.$mapsee.'
    '; - - - // - if( isset($varos['trap1']['vals']) && $varos['trap1']['vals'] > 0 ) { - $effed .= '
    - +3 (: '.$u->timeOut($varos['trap1']['time']-time()).')
    '; - } - unset($varos); -?> - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
      -
    error?>
    -
    :
    - -
    -
    -
    - usersDng($lab['id']);?> -
    - -
    -
    - -
    - 0 ) { - echo '- : '.$dies.'/3
    '; - } - ?> - : X=info['y']?> Y=info['x']?>
     
      
      - '; } ?> - -  
      - - - - - - - - - + + + -
    - - - - - - - -
         
                                                                                                                           
      
    - -
     
    - - - - - - - - - - - - - - - - - +
    + } else { + $errors = ' ...'; + } + + unset($var); + } + + // + $mapsee = ''; + $real_x = $u->info['x']; + $real_y = $u->info['y']; + + if ($real_y < 6) { + $real_y = 6; + } + if ($real_x < 6) { + $real_x = 6; + } + if ($real_y > count($map_d) - 7) { + $real_y = count($map_d) - 7; + } + if ($real_x > count($map_d) - 7) { + $real_x = count($map_d) - 7; + } + + $objs = []; + + $sp = mysql_query('SELECT * FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '" AND `x` > ' . ($real_x - 7) . ' AND `x` < ' . ($real_x + 7) . ' AND `y` > ' . ($real_y - 12) . ' AND `y` < ' . ($real_y + 12) . ' LIMIT 144'); + while ($pl = mysql_fetch_array($sp)) { + $objs[$pl['x']][$pl['y']] = $pl; + } + + $i = 1; + $goodgoo = [1 => 0, 2 => 0, 3 => 0, 4 => 0]; + while ($i <= 4) { + $goto = ['x' => $u->info['y'], 'y' => $u->info['x']]; + if ($i == 1) { + $goto['x']--; + } elseif ($i == 2) { + $goto['y']--; + } elseif ($i == 3) { + $goto['x']++; + } elseif ($i == 4) { + $goto['y']++; + } + if ($map_d[$goto['y']][$goto['x']] == 0 && $goto['x'] > 0 && $goto['x'] < count($map_d) - 1 && $u->info['timeGo'] <= time()) { + $goodgoo[$i] = 1; + } + $i++; + } + + if (isset($_GET['goto'])) { + $goto = ['x' => $u->info['y'], 'y' => $u->info['x']]; + if ($_GET['goto'] == 1) { + $goto['x']--; + } elseif ($_GET['goto'] == 2) { + $goto['y']--; + } elseif ($_GET['goto'] == 3) { + $goto['x']++; + } elseif ($_GET['goto'] == 4) { + $goto['y']++; + } + if ($goodgoo[$_GET['goto']] == 1 && $u->info['timeGo'] <= time()) { + // + $u->info['y'] = $goto['x']; + $u->info['x'] = $goto['y']; + $real_x = $u->info['x']; + $real_y = $u->info['y']; + $varos['timego'] = 5; + if (isset($varos['trap1']['time'])) { + $varos['timego'] += 3; + } + if (isset($u->stats['speed_dungeon'])) { + $varos['timego'] = $varos['timego'] - floor($varos['timego'] / 100 * $u->stats['speed_dungeon']); + if ($varos['timego'] < 1) { + $varos['timego'] = 1; + } + } + $u->info['timeGo'] = time() + $varos['timego']; + $u->info['timeGoL'] = time(); + mysql_query('UPDATE `stats` SET `x` = "' . $u->info['x'] . '" ,`y` = "' . $u->info['y'] . '",`timeGoL` = "' . $u->info['timeGoL'] . '",`timeGo` = "' . $u->info['timeGo'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } + + $tmdg = ($u->info['timeGo'] - time()); + $tmdgl = ($u->info['timeGo'] - $u->info['timeGoL']); + $tmdgp = floor(100 - $tmdg / $tmdgl * 100); + if ($tmdgp < 1) { + $tmdgp = 1; + } elseif ($tmdgp > 100) { + $tmdgp = 100; + } + $tmdgm = 25 * $tmdgl; + + $tmdg = floor(40 / 100 * $tmdgp); + + if ($tmdg < 1) { + $tmdg = 1; + } elseif ($tmdg > 40) { + $tmdg = 40; + } + + if ($real_y < 6) { + $real_y = 6; + } + if ($real_x < 6) { + $real_x = 6; + } + if ($real_y > count($map_d) - 7) { + $real_y = count($map_d) - 7; + } + if ($real_x > count($map_d) - 7) { + $real_x = count($map_d) - 7; + } + + if (isset($_POST['exit'])) { + if ($lab['users'] < 2) { + // + mysql_query('DELETE FROM `laba_now` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `laba_map` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '"'); + mysql_query('DELETE FROM `laba_act` WHERE `lib` = "' . $lab['id'] . '"'); + mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "' . $lab['id'] . '"'); + } else { + $lab['users']--; + mysql_query('UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); + } + mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%fromlaba=1%"'); + mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%nosavelaba=1%"'); + mysql_query('UPDATE `users` SET `room` = "369" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dnow` = "0",`x`="0",`y`="0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + // + + die(''); + } + + // + $itms = ''; + + if (isset($objs[$u->info['x']][$u->info['y']]['id'])) { + $var = []; + $mitm = $objs[$u->info['x']][$u->info['y']]; + if ($mitm['type'] == 6) { + // + if ($mitm['vars'] < 25) { + $i = 0; + while ($i < $mitm['vars']) { + $var['add'] = $varsitm[rand(0, count($varsitm) - 1)]; + if ($var['add'][1] > 0) { + $j = 0; + while ($j < $var['add'][1]) { + mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES ( + "' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['add'][0] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0" + )'); + $j++; + } + } + $i++; + } + } else { + // + + } + mysql_query('DELETE FROM `laba_obj` WHERE `id` = "' . $mitm['id'] . '" LIMIT 1'); + } elseif ($mitm['type'] == 2) { + if ($mitm['use'] == 0) { + $tbtl = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `team_win` = -1 AND `dn_id` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1')); + if (isset($tbtl['id'])) { + // + mysql_query('UPDATE `users` SET `battle` = "' . $tbtl['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->error = ' ... '; + } else { + $var['bots'] = [[357, 5], [358, 5], [359, 5], [360, 5], [361, 3], [362, 3], [363, 3], [364, 2], [365, 5], [366, 5], [367, 3]]; + // + if ($mitm['vars'] != null) { + // + } else { + // + $i = 0; + while ($i <= $u->info['level']) { + $var['ab'] = $var['bots'][rand(0, count($var['bots']) - 1)]; + $mitm['vars'] .= '|' . $var['ab'][0]; + $i += $var['ab'][1]; + } + // + $mitm['vars'] = ltrim($mitm['vars'], '|'); + // + mysql_query('UPDATE `laba_obj` SET `vars` = "' . $mitm['vars'] . '" WHERE `id` = "' . $mitm['id'] . '" LIMIT 1'); + } + // + $mitm['vars'] = explode('|', $mitm['vars']); + // + if (count($mitm['vars']) > 0) { + $btl_id = 0; + $expB = 0; + $btld = ['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 ( + "102", + "' . $lab['id'] . '", + "' . $u->info['x'] . '", + "' . $u->info['y'] . '", + "' . $u->info['city'] . '", + "' . time() . '", + "' . $btld['players'] . '", + "' . $btld['timeout'] . '", + "' . $btld['type'] . '", + "' . $btld['invis'] . '", + "' . $btld['noinc'] . '", + "' . $btld['travmChance'] . '", + "' . $btld['typeBattle'] . '", + "' . $btld['addExp'] . '", + "' . $btld['money'] . '")'); + $btl_id = mysql_insert_id(); + } + if ($btl_id > 0) { + // + $i = 0; + while ($i < count($mitm['vars'])) { + + $k = $u->addNewbot($mitm['vars'][$i], null, null, $logins_bot); + $logins_bot = $k['logins_bot']; + if ($k != false) { + $upd = mysql_query('UPDATE `users` SET `battle` = "' . $btl_id . '",`room` = "-100" WHERE `id` = "' . $k['id'] . '" LIMIT 1'); + if ($upd) { + $upd = mysql_query('UPDATE `stats` SET `x`="' . $u->info['x'] . '",`y`="' . $u->info['y'] . '",`team` = "2" WHERE `id` = "' . $k['id'] . '" LIMIT 1'); + if ($upd) { + $j++; + } + } + } + + $i++; + } + unset($logins_bot); + if ($j > 0) { + mysql_query('UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->error = ' ... '; + } else { + $u->error = ' , ...'; + } + } + // + } + } + } elseif ($mitm['type'] == 1) { + // + if ($mitm['use'] == 0) { + $itms .= ''; + } else { + $itms .= ''; + } + } elseif ($mitm['type'] == 3) { + // + if ($mitm['use'] == 0) { + $itms .= ''; + } else { + $itms .= ''; + } + } elseif ($mitm['type'] == 4) { + if ($mitm['use'] == 0) { + // + $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`,`vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1')); + $var['time'] = rand(1, 60); + if (isset($var['trap1']['id'])) { + mysql_query('UPDATE `laba_act` SET `vals` = "' . ($var['trap1']['vals'] + $var['time']) . '",`time` = "' . ($var['trap1']['time'] + $var['time'] * 60) . '" WHERE `id` = "' . $var['trap1']['id'] . '" LIMIT 1'); + } else { + mysql_query('INSERT INTO `laba_act` (`uid`,`time`,`lib`,`vars`,`vals`) VALUES ( + "' . $u->info['id'] . '","' . (time() + $var['time'] * 60) . '","' . $lab['id'] . '","trap1","' . $var['time'] . '" + )'); + } + mysql_query('UPDATE `laba_obj` SET `use` = "' . $u->info['id'] . '" WHERE `id` = "' . $mitm['id'] . '" LIMIT 1'); + + $var['sex'] = ''; + if ($u->info['sex'] == 1) { + $var['sex'] = ''; + } + $var['text'] = '' . $u->info['login'] . ' ' . $var['sex'] . ' ...'; + + $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1')); + + mysql_query("INSERT INTO `chat` (`dn`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('" . $u->info['dnow'] . "','" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $var['text'] . "','" . time() . "','6','0','1','1')"); + $errors .= ' ' . $u->info['login'] . ' ' . $var['sex'] . ' ... +3 (: +' . $var['time'] . ' .)'; + } + } elseif ($mitm['type'] == 5) { + // + if ($mitm['use'] == 0) { + $itms .= ''; + } else { + $itms .= ''; + } + } + unset($var); + } + + $sp = mysql_query('SELECT `i`.*,`m`.`name`,`m`.`img` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" AND `i`.`take` = "0"'); + while ($pl = mysql_fetch_array($sp)) { + $itms .= ' '; + } + + if ($itms != '') { + $itms = ' :

    ' . $itms . '
    '; + } elseif ($u->info['y'] == count($map_d) - 2) { + // ! + if ($lab['users'] < 2) { + // + mysql_query('DELETE FROM `laba_now` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `laba_map` WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); + mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '"'); + mysql_query('DELETE FROM `laba_act` WHERE `lib` = "' . $lab['id'] . '"'); + mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "' . $lab['id'] . '"'); + } else { + $lab['users']--; + mysql_query('UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1'); + } + $u->addItem(4392, $u->info['id'], '|fromlaba=1|nosale=1'); + mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%fromlaba=1%" AND `data` LIKE "%nosavelaba=1%"'); + mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%nosavelaba=1%"'); + mysql_query('UPDATE `users` SET `room` = "369" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `stats` SET `dnow` = "0",`x`="0",`y`="0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $r = ' " (50.)"'; + mysql_query("INSERT INTO `chat` (`typeTime`,`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','1','" . $u->info['city'] . "','" . $u->info['room'] . "','','" . $u->info['login'] . "','" . $r . "','" . time() . "','6','0')"); + $r = ' " " !'; + mysql_query("INSERT INTO `chat` (`typeTime`,`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','1','" . $u->info['city'] . "','" . $u->info['room'] . "','','" . $u->info['login'] . "','" . $r . "','" . time() . "','6','0')"); + // + die(''); + } + + $sp = mysql_query('SELECT `s`.`x`,`s`.`y`,`u`.`id`,`u`.`login`,`u`.`level` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`dnow` = "' . $lab['id'] . '" AND `s`.`id` != "' . $u->info['id'] . '" LIMIT 5'); + $pi = 1; + while ($pl = mysql_fetch_array($sp)) { + $objs[$pl['x']][$pl['y']] = [2 => '
    ']; // 1 + $pi++; + } + + $objs[$u->info['x']][$u->info['y']] = [2 => '
    ']; // 1 + $i = 0; + while ($i <= count($map_d)) { + $j = 0; + while ($j < count($map_d[$i])) { + if ($i > $real_x - 6 && $i < $real_x + 6 && $j > $real_y - 6 && $j < $real_y + 6) { + if ($map_d[$i][$j] == 1) { + $mapsee .= '
    ' . $objs[$i][$j][2] . '
    '; + } else { + if (!isset($objs[$i][$j]['id'])) { + if (isset($objs[$i][$j][2])) { + // + } elseif ($j == 1) { + $objs[$i][$j][2] = '
    '; + } elseif ($j == count($map_d) - 2) { + $objs[$i][$j][2] = '
    '; + } + } else { + if ($objs[$i][$j]['use'] == 0) { + $objs[$i][$j][2] = '
    '; + } else { + $objs[$i][$j][2] = ''; + } + } + $mapsee .= '
    ' . $objs[$i][$j][2] . '
    '; + } + } + $j++; + } + if ($i > $real_x - 6 && $i < $real_x + 6) { + $mapsee .= '
    '; + } + $i++; + } + $mapsee = '
    ' . $mapsee . '
    '; + + + // + if (isset($varos['trap1']['vals']) && $varos['trap1']['vals'] > 0) { + $effed .= '
    - +3 (: ' . $u->timeOut($varos['trap1']['time'] - time()) . ')
    '; + } + unset($varos); + ?> + + + +
    + + + + + + + + - - - -
    + - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + -
      +
    error ?>
    +
    :
    + +
    +
    +
    + usersDng($lab['id']); ?> +
    + +
    +
    + +
    + 0) { + echo '- : ' . $dies . '/3
    '; + } + ?> + : X=info['y'] ?> Y=info['x'] ?>
     
     
     
      + '; + } ?> + +  
    - - - - - - - -
    -
    - -
    -
    +
      + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + +
          +
    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +    +
    +
      
    + +
     
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    +
    - + \ No newline at end of file diff --git a/modules_data/location/dungeon.php b/modules_data/location/dungeon.php index 1674acfb..763fd48a 100644 --- a/modules_data/location/dungeon.php +++ b/modules_data/location/dungeon.php @@ -1,1218 +1,1382 @@ var elem = document.getElementById('se-pre-con'); elem.parentNode.removeChild(elem); "; -if(!defined('GAME')){ - die(); +if (!defined('GAME')) { + die(); } -if($u->room['file']=='dungeon'){ -$pd = array( - 1 =>0, - 2 =>0, - 3 =>0, - 4 =>0, - 5 =>0, - 6 =>0, - 7 =>0, - 8 =>0, - 9 =>0, // , 2- - 10=>0, - 11=>0, - 12=>0, - 13=>0, - 14=>0, - 15=>0, - 16=>0, - 17=>0, - 18=>0, - 19=>0, - 20=>0, - 21=>0, - 22=>0, - 23=>0, - /* : 1 */ - 24=>0, // (1) - 25=>0, // (1) - 26=>0, // (1) - 27=>0, // (1) - 28=>0 // (1) -); +if ($u->room['file'] == 'dungeon') { + $pd = [1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, // , 2- + 10 => 0, 11 => 0, 12 => 0, 13 => 0, 14 => 0, 15 => 0, 16 => 0, 17 => 0, 18 => 0, 19 => 0, 20 => 0, 21 => 0, 22 => 0, 23 => 0, /* : 1 */ + 24 => 0, // (1) + 25 => 0, // (1) + 26 => 0, // (1) + 27 => 0, // (1) + 28 => 0 // (1) + ]; -if(isset($_POST['go_to_admin']) && $u->info['admin'] == 1 && $u->info['login']=='Crowley') { - mysql_query('UPDATE `stats` SET `x` = "'.round((int)$_POST['g__x']).'", `y` = "'.round((int)$_POST['g__y']).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - if($_POST['g__restorebot']) { - mysql_query('UPDATE `dungeon_bots` SET `delete` = "0" WHERE `dn` = "'.$u->info['dnow'].'" AND `delete` = 1 LIMIT 50'); - } - header('Location: /main.php'); -} + if (isset($_POST['go_to_admin']) && $u->info['admin'] == 1 && $u->info['login'] == 'Crowley') { + mysql_query('UPDATE `stats` SET `x` = "' . round((int)$_POST['g__x']) . '", `y` = "' . round((int)$_POST['g__y']) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + if ($_POST['g__restorebot']) { + mysql_query('UPDATE `dungeon_bots` SET `delete` = "0" WHERE `dn` = "' . $u->info['dnow'] . '" AND `delete` = 1 LIMIT 50'); + } + header('Location: /main.php'); + } -if(isset($_GET['back'])) { - $dp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_now` WHERE `id` = "'.$u->info['dnow'].'" LIMIT 1')); - $dp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.$dp['id2'].'" AND `x` = "'.$u->info['x'].'" AND `y` ="'.$u->info['y'].'" LIMIT 1')); - if( $dp['file']!='0' ) { - $file = explode('=',$dp['file']); - if(isset($file[1])){ - if($file[3]<1 || $file[3]>4){ - $file[3] = 1; - } - mysql_query('UPDATE `stats` SET `x` = "'.$file[1].'",`y` = "'.$file[2].'",`s` = "'.$file[3].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - $u->info['x'] = $file[1]; - $u->info['y'] = $file[2]; - $u->info['s'] = $file[3]; - } - } - unset($dp); -} + if (isset($_GET['back'])) { + $dp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_now` WHERE `id` = "' . $u->info['dnow'] . '" LIMIT 1')); + $dp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $dp['id2'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` ="' . $u->info['y'] . '" LIMIT 1')); + if ($dp['file'] != '0') { + $file = explode('=', $dp['file']); + if (isset($file[1])) { + if ($file[3] < 1 || $file[3] > 4) { + $file[3] = 1; + } + mysql_query('UPDATE `stats` SET `x` = "' . $file[1] . '",`y` = "' . $file[2] . '",`s` = "' . $file[3] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + $u->info['x'] = $file[1]; + $u->info['y'] = $file[2]; + $u->info['s'] = $file[3]; + } + } + unset($dp); + } -require_once('_incl_data/class/__dungeon.php'); + $d = new Dungeon; + $d->start(); -if(!isset($d->info['id'])) { - $_GET['exitd'] = true; -} + if (!isset($d->info['id'])) { + $_GET['exitd'] = true; + } -$dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$u->info['dnow'].'" AND `vars` = "die" LIMIT 1')); -$dies = $dies[0]; + $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `dungeon_actions` WHERE `uid` = "' . $u->info['id'] . '" AND `dn` = "' . $u->info['dnow'] . '" AND `vars` = "die" LIMIT 1')); + $dies = $dies[0]; -if($dies >= 3) { - $_GET['exitd'] = true; -} + if ($dies >= 3) { + $_GET['exitd'] = true; + } -$d->point = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.$d->info['id2'].'" AND `x` = "'.$u->info['x'].'" AND `y` ="'.$u->info['y'].'" LIMIT 1')); + $d->point = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $d->info['id2'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` ="' . $u->info['y'] . '" LIMIT 1')); -if(!isset($d->point['id'])) { - $d->point['css'] = 'css'; -} + if (!isset($d->point['id'])) { + $d->point['css'] = 'css'; + } -if(isset($_GET['new_leader'])) { - echo $d->n_lead($_GET['new_leader'], $u->info['id']); -} + if (isset($_GET['new_leader'])) { + echo $d->n_lead($_GET['new_leader'], $u->info['id']); + } -if(isset($_GET['go_from_psh'])) { - echo $d->go_to_hell($_GET['go_from_psh'], $u->info['id']); -} + if (isset($_GET['go_from_psh'])) { + echo $d->go_to_hell($_GET['go_from_psh'], $u->info['id']); + } + if ($u->info['dnow'] == 0) { + // + die(' '); + } else { -if($u->info['dnow']==0){ - // - die(' '); -}else{ - - if($d->info['id2'] == 15) { - // - $sb = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = 4910 LIMIT 1')); - // - if(isset($_GET['atackpuck'])) { - //! - $shbtu = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`battle` FROM `users` WHERE `id` = "'.mysql_real_escape_string($_GET['atackpuck']).'" LIMIT 1')); - if(isset($shbtu['id'])) { - $shbts = mysql_fetch_array(mysql_query('SELECT `id`,`x`,`y`,`dnow` FROM `stats` WHERE `id` = "'.$shbtu['id'].'" LIMIT 1')); - if($shbts['dnow'] == $u->info['dnow']) { - $tm11 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "'.$u->info['id'].'" LIMIT 1')); - $tm22 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "'.$shbtu['id'].'" LIMIT 1')); - if($tm11['team'] == $tm22['team']) { - $d->error = ' !'; - }elseif($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x']-1 || $shbts['x'] == $u->info['x']+1) { - if($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x']-1 || $shbts['x'] == $u->info['x']+1) { - // - if($shbtu['battle'] > 0) { - $d->error = ' "'.$shbtu['login'].'"!'; - }else{ - $d->error = ' "'.$shbtu['login'].'" !'; - } - // - }else{ - $d->error = '"'.$shbtu['login'].'" !'; - } - }else{ - $d->error = '"'.$shbtu['login'].'" !'; - } - }else{ - $d->error = ' ...'; - } - }else{ - $d->error = ' !'; - } - }elseif(isset($_GET['addpuck']) && isset($sb['id'])) { - // - $shbtu = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`battle` FROM `users` WHERE `id` = "'.mysql_real_escape_string($_GET['addpuck']).'" LIMIT 1')); - if(isset($shbtu['id'])) { - $shbts = mysql_fetch_array(mysql_query('SELECT `id`,`x`,`y`,`dnow` FROM `stats` WHERE `id` = "'.$shbtu['id'].'" LIMIT 1')); - if($shbts['dnow'] == $u->info['dnow']) { - $tm11 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "'.$u->info['id'].'" LIMIT 1')); - $tm22 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "'.$shbtu['id'].'" LIMIT 1')); - if($tm11['team'] != $tm22['team']) { - $d->error = ' !'; - }elseif($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x']-1 || $shbts['x'] == $u->info['x']+1) { - if($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x']-1 || $shbts['x'] == $u->info['x']+1) { - // - if($shbtu['battle'] > 0) { - $d->error = '"'.$shbtu['login'].'" !'; - }else{ - mysql_query('UPDATE `items_users` SET `uid` = "'.$shbtu['id'].'" WHERE `id` = "'.$sb['id'].'" LIMIT 1'); - unset($sb); - $d->error = '"'.$shbtu['login'].'" !'; - $d->sys_chat(''.$u->info['login'].' '.$shbtu['login'].'!'); - } - // - }else{ - $d->error = '"'.$shbtu['login'].'" !'; - } - }else{ - $d->error = '"'.$shbtu['login'].'" !'; - } - }else{ - $d->error = ' ...'; - } - }else{ - $d->error = ' !'; - } - } - // - $tm1win = mysql_fetch_array(mysql_query('SELECT SUM(`win`) FROM `katok_now` WHERE `team` = 1')); - $tm2win = mysql_fetch_array(mysql_query('SELECT SUM(`win`) FROM `katok_now` WHERE `team` = 2')); - $tm1win = 0+$tm1win[0]; - $tm2win = 0+$tm2win[0]; - $tmwin = 0; - if($tm1win >= 2) { - $tmwin = 1; - }elseif($tm2win >= 2) { - $tmwin = 2; - } - if($tmwin > 0) { - $sp = mysql_query('SELECT * FROM `katok_now`'); - while( $pl = mysql_fetch_array($sp) ) { - // - mysql_query('UPDATE `users` SET `inUser` = 0, `room` = 409 WHERE `inUser` = "'.$pl['clone'].'" LIMIT 1'); + if ($d->info['id2'] == 15) { + // + $sb = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = 0 AND `item_id` = 4910 LIMIT 1')); + // + if (isset($_GET['atackpuck'])) { + //! + $shbtu = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`battle` FROM `users` WHERE `id` = "' . mysql_real_escape_string($_GET['atackpuck']) . '" LIMIT 1')); + if (isset($shbtu['id'])) { + $shbts = mysql_fetch_array(mysql_query('SELECT `id`,`x`,`y`,`dnow` FROM `stats` WHERE `id` = "' . $shbtu['id'] . '" LIMIT 1')); + if ($shbts['dnow'] == $u->info['dnow']) { + $tm11 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $u->info['id'] . '" LIMIT 1')); + $tm22 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $shbtu['id'] . '" LIMIT 1')); + if ($tm11['team'] == $tm22['team']) { + $d->error = ' !'; + } elseif ($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x'] - 1 || $shbts['x'] == $u->info['x'] + 1) { + if ($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x'] - 1 || $shbts['x'] == $u->info['x'] + 1) { + // + if ($shbtu['battle'] > 0) { + $d->error = ' "' . $shbtu['login'] . '"!'; + } else { + $d->error = ' "' . $shbtu['login'] . '" !'; + } + // + } else { + $d->error = '"' . $shbtu['login'] . '" !'; + } + } else { + $d->error = '"' . $shbtu['login'] . '" !'; + } + } else { + $d->error = ' ...'; + } + } else { + $d->error = ' !'; + } + } elseif (isset($_GET['addpuck']) && isset($sb['id'])) { + // + $shbtu = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`battle` FROM `users` WHERE `id` = "' . mysql_real_escape_string($_GET['addpuck']) . '" LIMIT 1')); + if (isset($shbtu['id'])) { + $shbts = mysql_fetch_array(mysql_query('SELECT `id`,`x`,`y`,`dnow` FROM `stats` WHERE `id` = "' . $shbtu['id'] . '" LIMIT 1')); + if ($shbts['dnow'] == $u->info['dnow']) { + $tm11 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $u->info['id'] . '" LIMIT 1')); + $tm22 = mysql_fetch_array(mysql_query('SELECT * FROM `katok_now` WHERE `clone` = "' . $shbtu['id'] . '" LIMIT 1')); + if ($tm11['team'] != $tm22['team']) { + $d->error = ' !'; + } elseif ($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x'] - 1 || $shbts['x'] == $u->info['x'] + 1) { + if ($shbts['x'] == $u->info['x'] || $shbts['x'] == $u->info['x'] - 1 || $shbts['x'] == $u->info['x'] + 1) { + // + if ($shbtu['battle'] > 0) { + $d->error = '"' . $shbtu['login'] . '" !'; + } else { + mysql_query('UPDATE `items_users` SET `uid` = "' . $shbtu['id'] . '" WHERE `id` = "' . $sb['id'] . '" LIMIT 1'); + unset($sb); + $d->error = '"' . $shbtu['login'] . '" !'; + $d->sys_chat('' . $u->info['login'] . ' ' . $shbtu['login'] . '!'); + } + // + } else { + $d->error = '"' . $shbtu['login'] . '" !'; + } + } else { + $d->error = '"' . $shbtu['login'] . '" !'; + } + } else { + $d->error = ' ...'; + } + } else { + $d->error = ' !'; + } + } + // + $tm1win = mysql_fetch_array(mysql_query('SELECT SUM(`win`) FROM `katok_now` WHERE `team` = 1')); + $tm2win = mysql_fetch_array(mysql_query('SELECT SUM(`win`) FROM `katok_now` WHERE `team` = 2')); + $tm1win = 0 + $tm1win[0]; + $tm2win = 0 + $tm2win[0]; + $tmwin = 0; + if ($tm1win >= 2) { + $tmwin = 1; + } elseif ($tm2win >= 2) { + $tmwin = 2; + } + if ($tmwin > 0) { + $sp = mysql_query('SELECT * FROM `katok_now`'); + while ($pl = mysql_fetch_array($sp)) { + // + mysql_query('UPDATE `users` SET `inUser` = 0, `room` = 409 WHERE `inUser` = "' . $pl['clone'] . '" LIMIT 1'); + + // + mysql_query('DELETE FROM `users` WHERE `id` = "' . $pl['clone'] . '" LIMIT 1'); + mysql_query('DELETE FROM `stats` WHERE `id` = "' . $pl['clone'] . '" LIMIT 1'); + mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pl['clone'] . '"'); + mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pl['clone'] . '"'); + + // + mysql_query('DELETE FROM `katok_now` WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + // + } + header('location: https://new-combats.com/main.php'); + die(' ! ' . $tmwin . ''); + } + } + + if ($d->info['bsid'] == 0 && $d->info['id2'] != 106 && isset($_GET['exitd'])) { + // .. + $rb = 321; // + if ($u->info['room'] == 304) { + $rb = 209; // + } elseif ($u->info['room'] == 396) { + $rb = 321; // () + } elseif ($u->info['room'] == 398) { + $rb = 321; // + } elseif ($d->info['id2'] == 3) { + $rb = 321; // + } elseif ($d->info['id2'] == 1) { + $rb = 321; // + } elseif ($d->info['id2'] == 13) { + $rb = 321; // + } elseif ($d->info['id2'] == 12) { + $rb = 321; // + } elseif ($d->info['id2'] == 101) { + $rb = 321; // + } elseif ($d->info['id2'] == 444) { + $rb = 321; // + } elseif ($d->info['id2'] == 104) { + $rb = 2; // ( ) + } + $sp = mysql_query('SELECT * FROM `dungeon_now` WHERE `time_finish` = "0" LIMIT 50'); + while ($pl = mysql_fetch_array($sp)) { + $cn = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dnow` = "' . $pl['id'] . '" LIMIT 1')); + if (!isset($cn['id'])) { + mysql_query('DELETE FROM `dungeon_bots` WHERE `dn` = "' . $pl['id'] . '" AND `for_dn` = "0"'); + mysql_query('DELETE FROM `dungeon_obj` WHERE `dn` = "' . $pl['id'] . '" AND `for_dn` = "0"'); + mysql_query('DELETE FROM `dungeon_items` WHERE `dn` = "' . $pl['id'] . '" AND `for_dn` = "0"'); + mysql_query('DELETE FROM `dungeon_bots` WHERE `dn` = "' . $pl['id'] . '" AND `for_dn` = "0"'); + mysql_query('DELETE FROM `dungeon_actions` WHERE `dn` = "' . $pl['id'] . '"'); + mysql_query('UPDATE `dungeon_now` SET `time_finish` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + } + } + $cn = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dnow` = "' . $d->info['id'] . '" AND `id` != "' . $u->info['id'] . '" ORDER BY `exp` DESC LIMIT 1')); + if (isset($cn['id'])) { + if ($d->info['uid'] == $u->info['id']) { + $cn = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`sex` FROM `users` WHERE `id` = "' . $cn['id'] . '" LIMIT 1')); + mysql_query('UPDATE `dungeon_now` SET `uid` = "' . $cn['id'] . '" WHERE `id` = "' . $d->info['id'] . '" LIMIT 1'); + if ($cn['sex'] == 0) { + if ($u->info['sex'] == 0) { + $d->sys_chat('' . $u->info['login'] . ' , ' . $cn['login'] . ''); + } else { + $d->sys_chat('' . $u->info['login'] . ' , ' . $cn['login'] . ''); + } + } else { + if ($u->info['sex'] == 0) { + $d->sys_chat('' . $u->info['login'] . ' , ' . $cn['login'] . ''); + } else { + $d->sys_chat('' . $u->info['login'] . ' , ' . $cn['login'] . ''); + } + } + } else { + if ($u->info['sex'] == 0) { + $d->sys_chat('' . $u->info['login'] . ' !'); + } else { + $d->sys_chat('' . $u->info['login'] . ' !'); + } + } + } + + $city = mysql_fetch_assoc(mysql_query('SELECT `id`, `city` FROM `room` WHERE `id` = "' . $rb . '" LIMIT 1')); + mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `room` = "' . $rb . '", `city`="' . $city['city'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + // + mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `dn_delete` = "1" LIMIT 1000'); + + mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND (`item_id` = "1189" OR `item_id` = "4447" OR `item_id` = "1174") LIMIT 1000'); - // - mysql_query('DELETE FROM `users` WHERE `id` = "'.$pl['clone'].'" LIMIT 1'); - mysql_query('DELETE FROM `stats` WHERE `id` = "'.$pl['clone'].'" LIMIT 1'); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$pl['clone'].'"'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$pl['clone'].'"'); - - // - mysql_query('DELETE FROM `katok_now` WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - // - if( $pl['team'] == $tmwin ) { - // ! - - } - // - } - header('location: https://new-combats.com/main.php'); - die(' ! '.$tmwin.''); - } - } - - if($d->info['bsid']==0 && $d->info['id2'] != 106){ - if(isset($_GET['exitd'])) { - // .. - $rb = 321; // - if($u->info['room']==304){ - $rb = 209; // - }elseif($u->info['room']==396){ - $rb = 321; // () - }elseif($u->info['room']==398){ - $rb = 321; // - }elseif($d->info['id2']==3){ - $rb = 321; // - }elseif($d->info['id2']==1){ - $rb = 321; // - }elseif($d->info['id2']==13){ - $rb = 321; // - }elseif($d->info['id2']==12){ - $rb = 321; // - }elseif($d->info['id2']==101){ - $rb = 321; // - }elseif($d->info['id2']==444){ - $rb = 321; // - }elseif($d->info['id2']==104){ - $rb = 2; // ( ) - } - $sp = mysql_query('SELECT * FROM `dungeon_now` WHERE `time_finish` = "0" LIMIT 50'); - while($pl = mysql_fetch_array($sp)) { - $cn = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dnow` = "'.$pl['id'].'" LIMIT 1')); - if(!isset($cn['id'])) { - mysql_query('DELETE FROM `dungeon_bots` WHERE `dn` = "'.$pl['id'].'" AND `for_dn` = "0"'); - mysql_query('DELETE FROM `dungeon_obj` WHERE `dn` = "'.$pl['id'].'" AND `for_dn` = "0"'); - mysql_query('DELETE FROM `dungeon_items` WHERE `dn` = "'.$pl['id'].'" AND `for_dn` = "0"'); - mysql_query('DELETE FROM `dungeon_bots` WHERE `dn` = "'.$pl['id'].'" AND `for_dn` = "0"'); - mysql_query('DELETE FROM `dungeon_actions` WHERE `dn` = "'.$pl['id'].'"'); - mysql_query('UPDATE `dungeon_now` SET `time_finish` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - $cn = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dnow` = "'.$d->info['id'].'" AND `id` != "'.$u->info['id'].'" ORDER BY `exp` DESC LIMIT 1')); - if(isset($cn['id'])) { - if( $d->info['uid'] == $u->info['id'] ) { - $cn = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`sex` FROM `users` WHERE `id` = "'.$cn['id'].'" LIMIT 1')); - mysql_query('UPDATE `dungeon_now` SET `uid` = "'.$cn['id'].'" WHERE `id` = "'.$d->info['id'].'" LIMIT 1'); - if( $cn['sex'] == 0 ) { - if( $u->info['sex'] == 0 ) { - $d->sys_chat(''.$u->info['login'].' , '.$cn['login'].''); - }else{ - $d->sys_chat(''.$u->info['login'].' , '.$cn['login'].''); - } - }else{ - if( $u->info['sex'] == 0 ) { - $d->sys_chat(''.$u->info['login'].' , '.$cn['login'].''); - }else{ - $d->sys_chat(''.$u->info['login'].' , '.$cn['login'].''); - } - } - }else{ - if( $u->info['sex'] == 0 ) { - $d->sys_chat(''.$u->info['login'].' !'); - }else{ - $d->sys_chat(''.$u->info['login'].' !'); - } - } - } - - $city = mysql_fetch_assoc(mysql_query('SELECT `id`, `city` FROM `room` WHERE `id` = "'.$rb.'" LIMIT 1')); - mysql_query('UPDATE `stats` SET `dnow` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `room` = "'.$rb.'", `city`="'.$city['city'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - // - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `dn_delete` = "1" LIMIT 1000'); - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND (`item_id` = "1189" OR `item_id` = "4447" OR `item_id` = "1174") LIMIT 1000'); - //header("Location: main.php"); echo ''; - die(); - } - } -} + die(); + } + } -if( $d->point['fileadd']==1 && $d->point['file']!='0' && $d->point['file']!=''){ - $file = explode('=',$d->point['file']); - if( file_exists('modules_data/location/'.$file[0]) ) { - $information = ''; - include_once('modules_data/location/'.$file[0]); - #header('Location: /main.php'); - } else { - if( $file[3]<1 || $file[3]>4 ) { - $file[3] = 1; - } - echo '

    "'.str_replace('.php','',$file[0]).'" ,
    '; - mysql_query('UPDATE `stats` SET `x` = "'.$file[1].'",`y` = "'.$file[2].'",`s` = "'.$file[3].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } -} + if ($d->point['fileadd'] == 1 && $d->point['file'] != '0' && $d->point['file'] != '') { + $file = explode('=', $d->point['file']); + if (file_exists('modules_data/location/' . $file[0])) { + $information = ''; + include_once('modules_data/location/' . $file[0]); + #header('Location: /main.php'); + } else { + if ($file[3] < 1 || $file[3] > 4) { + $file[3] = 1; + } + echo '

    "' . str_replace('.php', '', $file[0]) . '" ,
    '; + mysql_query('UPDATE `stats` SET `x` = "' . $file[1] . '",`y` = "' . $file[2] . '",`s` = "' . $file[3] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + } + } -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]) ) { - require_once('modules_data/location/'.$file[0]); - } else { - if( $file[3]<1 || $file[3]>4 ) { - $file[3] = 1; - } - echo '

    "'.str_replace('.php','',$file[0]).'" ,
    '; - mysql_query('UPDATE `stats` SET `x` = "'.$file[1].'",`y` = "'.$file[2].'",`s` = "'.$file[3].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } -} else { -?> - - + - - - -
    - - - - - - @@ -192,7 +179,7 @@ if (isset($_POST['relogin'])) {
    -

     error)){ echo ''.$d->error.'
    '; } ?>

    -info['bsid']==0 && $d->info['id2'] != 106){ ?>

    -
    - -
    - - - - -
    -
    info['bsid']==0){ echo $d->usersDng(); - if( $dies > 0 ) { - echo '

    - : '.$dies.'

    '; - } - /*if($dies > 3) { + if (tgo > 0) { + tgo -= 1; + // console.log(" ") + setTimeout('locGoLineDng()', 100); + } else { + if (gotoup777 > 0) { + // , , + // + location.href = `/main.php?go=${gotoup777}&rnd=`; + } + } + + var $DomGotext777 = document.getElementById('gotext777') + + if (gotoup777 > 0 && gotext777 != '' && $DomGotext777.innerHTML != ` ${gotext777} ()`) { + $DomGotext777.innerHTML = ` ${gotext777} ()`; + } else if ($DomGotext777.innerHTML != '' && gotoup777 == 0 && gotext777 == '') { + $DomGotext777.innerHTML = ''; + } + } + } + info['timeGo'] - time(); // + $tmGol = $u->info['timeGo'] - $u->info['timeGoL']; // + echo 'var tgo = ' . ($tmGo * 10) . '; var tgol = ' . ($tmGol * 10) . ';'; ?> + + + + +
    + + + + + + - -
    +

     error)) { + echo '' . $d->error . '
    '; + } ?>

    + info['bsid'] == 0 && $d->info['id2'] != 106) { ?>

    +
    + + + - -
    + + + - + - -
    +
    +
    info['bsid'] == 0) { + echo $d->usersDng(); + if ($dies > 0) { + echo '

    - : ' . $dies . '

    '; + } + /*if($dies > 3) { mysql_query('UPDATE `users` set `room` = "321" WHERE `id` = "'.$u->info['id'].'" LIMIT1 '); }*/ - }else{ - if($d->info['id2'] != 15) { - // - echo '

    :

    '; - echo $d->usersDng(); - }else{ - echo '

    . : '.(0+$tm1win).' - : '.(0+$tm2win).'

    '; - if( $dies > 0 ) { - echo '

    - : '.$dies.'

    '; - } - if(isset($sb['id'])) { - echo '

    , !

    '; - } - } - } - // - $qsee = ''; - - $dungeon_enter = mysql_fetch_array( mysql_query('SELECT * FROM `dungeon_room` WHERE `dungeon_room` = "'.$u->info['room'].'" LIMIT 1') ); - $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 1000'); - while($pl = mysql_fetch_array($sp)){ - $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" AND (`tr_date` LIKE "%tr_dn:=:'.$d->info['id2'].'" OR `tr_date` LIKE "%tr_dn:=:'.$d->info['id2'].'|%" OR `tr_date` NOT LIKE "%tr_dn:=:%") LIMIT 1')); - if(isset($pq['id'])) { - $qsee .= ':   '.$pq['name'].' '.$q->infoDng($pq).'
    '; - $qx++; - } - } - $sp = mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "'.$u->info['id'].'" AND `val` = 0 AND `info` != ""'); - while($pl = mysql_fetch_array($sp)) { - $xrz = $pl['now']; - $r = $pl['max']; - if($xrz > $r) { - $xrz = $r; - } - $r = '
    -
    '.$xrz.'/'.$r.'
    + } else { + if ($d->info['id2'] != 15) { + // + echo '

    :

    '; + echo $d->usersDng(); + } else { + echo '

    . : ' . (0 + $tm1win) . ' - : ' . (0 + $tm2win) . '

    '; + if ($dies > 0) { + echo '

    - : ' . $dies . '

    '; + } + if (isset($sb['id'])) { + echo '

    , !

    '; + } + } + } + // + $qsee = ''; + + $dungeon_enter = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_room` WHERE `dungeon_room` = "' . $u->info['room'] . '" LIMIT 1')); + $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 1000'); + while ($pl = mysql_fetch_array($sp)) { + $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" AND (`tr_date` LIKE "%tr_dn:=:' . $d->info['id2'] . '" OR `tr_date` LIKE "%tr_dn:=:' . $d->info['id2'] . '|%" OR `tr_date` NOT LIKE "%tr_dn:=:%") LIMIT 1')); + if (isset($pq['id'])) { + $qsee .= ':   ' . $pq['name'] . ' ' . $q->infoDng($pq) . '
    '; + $qx++; + } + } + $sp = mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "' . $u->info['id'] . '" AND `val` = 0 AND `info` != ""'); + while ($pl = mysql_fetch_array($sp)) { + $xrz = $pl['now']; + $r = $pl['max']; + if ($xrz > $r) { + $xrz = $r; + } + $r = '
    +
    ' . $xrz . '/' . $r . '
    -
    +
    -

    '; +

    '; - $qsee .= ':   '.$pl['info'].' '.$r.'
    '; - } - if( $qsee != '' ) { - echo '

    '.$qsee; - } - ?>
    -
    itemsMap(); ?>
    -
    information)){ echo $d->information; } ?>
    -
    - info['admin'] > 0){ - #echo $d->genObjects(); - } - ?> -
    - -
    -
    -
    -
    - -
    -
    - - '; - $j = 1; - $htmlv2 = ''; - while($j<=9) - { - $htmlv2 = ''.$htmlv2; - $j++; - } - $htmlv .= $htmlv2.''; - $i++; - } - echo $htmlv; - unset($htmlv,$htmlv2); - ?> - -
    - -
    -
    - -
    - - testGone(3) > 0) { ?> - - testGone(4)>0){ ?> - - testGone(2)>0){ ?> - - testGone(1)>0){ ?> - - - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - info['admin']==0){ ?> -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    + $qsee .= ':   ' . $pl['info'] . ' ' . $r . '
    '; + } + if ($qsee != '') { + echo '

    ' . $qsee; + } + ?>
    +
    itemsMap(); ?>
    +
    information)) { + echo $d->information; + } ?>
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - + info['admin'] > 0) { + #echo $d->genObjects(); + } + ?> +
    +
    + +
    +
    +
    +
    + +
    +
    + + '; + $j = 1; + $htmlv2 = ''; + while ($j <= 9) { + $htmlv2 = '' . $htmlv2; + $j++; + } + $htmlv .= $htmlv2 . ''; + $i++; + } + echo $htmlv; + unset($htmlv, $htmlv2); + ?> + +
    + +
    +
    + +
    + + testGone(3) > 0) { ?> + + testGone(4) > 0) { ?> + + testGone(2) > 0) { ?> + + testGone(1) > 0) { ?> + + + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + info['admin'] == 0){ ?> +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    -
    -
    -
     
    -
    -
    - -

    -info['admin'] == 1) { - echo '
    X - Y -

    - S:'.$u->info['s'].''; -} -?> - \ No newline at end of file + location.href = "/main.php?look=2&rnd="; + }); + + }); + +

    + info['admin'] == 1) { + echo '
    X - Y -

    + S:' . $u->info['s'] . ''; + } + ?> + diff --git a/modules_data/location/elka.php b/modules_data/location/elka.php index 3f152aa9..cdc35742 100644 --- a/modules_data/location/elka.php +++ b/modules_data/location/elka.php @@ -12,7 +12,7 @@ if((date('n',time())==2 && date('j',time())<=14)) $dy = 0; } $dt = date('Y',time())+$dy; -$dt = 2022; +$dt = 2023; if($u->room['file']=='elka') { @@ -189,12 +189,12 @@ if($u->room['file']=='elka') testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.(time()-600).' AND `vars` = "use_cupNewYear" LIMIT 1',1); ?> - /> + /> testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.(time()-600).' AND `vars` = "take_gift'.$dt.'" LIMIT 1',1); ?> - /> + />
    diff --git a/modules_data/location/izlom2.php b/modules_data/location/izlom2.php index 0c35a6a2..39acbb93 100644 --- a/modules_data/location/izlom2.php +++ b/modules_data/location/izlom2.php @@ -1,133 +1,160 @@ room['file']=='izlom2') -{ -if(isset($_POST['level'])) -{ - if((int)$_POST['level']<=$u->info['level'] && (int)$_POST['level']<=7) - { - $eff1 = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = "31" AND `delete` = "0" LIMIT 1')); - if(!isset($eff1['id'])) - { - if(file_exists('_incl_data/class/__zv.php')) { - if(!isset($zv)) - { - require_once('_incl_data/class/__zv.php'); - } - $zv->startIzlom(1,((int)$_POST['level'])); - }else{ - echo '...'; - } - }else{ - echo ' " "'; - } - } +if ($u->room['file'] != 'izlom2') { + return; +} +if (isset($_POST['level']) && (int)$_POST['level'] <= $u->info['level'] && (int)$_POST['level'] <= 7) { + $eff1 = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = "31" AND `delete` = "0" LIMIT 1')); + if (isset($eff1['id'])) { + echo ' " "'; + } elseif (!isset($zv)) { + $zv = new FightRequest(); + } +} + +$i = 0; +$text = ''; +$sp = mysql_query('SELECT * FROM `izlom_rating` ORDER BY `voln` DESC LIMIT 50'); +$uidz = []; +while ($pl = mysql_fetch_array($sp)) { + if (isset($uidz[$pl['uid']])) { + continue; + } + $i++; + $uidz[$pl['uid']] = $i; + $text .= $i . '. ' . date('d.m.Y H:i', $pl['time']) . ', : ' . $pl['voln'] . ', ' . $u->microLogin($pl['uid'], 1) . '
    '; +} +if (empty($text)) { + $text = ' , ...'; } ?> - -
    '.$re.''; } ?>
    - - - -
    -
    - - - - -
      - - - -
    - - - - - - - - -
    - - - - - - - - -
    - 16
     
    -
    -
    - + +
    + + + + +
    +
    +
    + + + + + +
      + + + + +
    + + + + + + + + + +
    + + + + + + + + + +
    + - 16
    +
    +
     
    +
    +
    +
    +
    +
    - info['level']<7){ echo 'disabled'; } ?>> - « »
    + -
    -

    « »:
    '.date('d.m.Y H:i',$pl['time']).', : '.$pl['voln'].', '.$u->microLogin($pl['uid'],1).'
    '; - } - } - if(!isset($text)) - { - $text = ' , ...'; - } - echo $text; - unset($text); - ?>

    - \ No newline at end of file + +

    « »:

    \ No newline at end of file diff --git a/modules_data/location/loto.php b/modules_data/location/loto.php index 41575662..46c08200 100644 --- a/modules_data/location/loto.php +++ b/modules_data/location/loto.php @@ -308,18 +308,14 @@ $titm = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'. border: '4px solid transparent' }) - var idItem = await response.text() - - idItem = idItem.match(/\b[0-9]{0,2}\b/) - if (idItem[0]) { - // 0 29 - if (idItem[0] > 29) { - return $button.textContent = ", F5!" - } - idItem = idItem[0] - } - else { - return $button.textContent = ", F5!" + var textFromResponse = await response.text() + var resultRegexp = textFromResponse.match(/\b[0-9]{0,2}\b/); + var idItem = ''; + + if (resultRegexp && resultRegexp[0] && resultRegexp[0] >= 0 && resultRegexp[0] <= 29) { + idItem = resultRegexp[0]; + } else { + return ($button.textContent = ', F5!'); } var elemRul = 0 @@ -367,14 +363,10 @@ $titm = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'. var $tableItemChange = document.getElementById("tableItemChange") $buttonsElements.onclick = function (event) { - if ($tableItemChange.hidden) { - $tableItemChange.hidden = !$tableItemChange.hidden - event.target.textContent = " " - return - } + var contentIsHidden = $tableItemChange.hidden; - $tableItemChange.hidden = !$tableItemChange.hidden - event.target.textContent = " " + $tableItemChange.hidden = !contentIsHidden; + event.target.textContent = !contentIsHidden ? ' ' : ' '; }
    - - +
    -

    Достижения

    +

    getList(); ?> diff --git a/modules_data/transfer.php.bac b/modules_data/transfer.php.bac index 30055a96..0f596f95 100644 --- a/modules_data/transfer.php.bac +++ b/modules_data/transfer.php.bac @@ -10,7 +10,7 @@ if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') define('GAME',true); require_once('_incl_data/__config.php'); require_once('_incl_data/class/__db_connect.php'); - include('_incl_data/class/__user.php'); + require_once('_incl_data/class/__user.php'); if(isset($u->tfer['id']) && $u->info['align'] != 2) { if($u->tfer['finish1']==0 && $u->tfer['finish2']==0) diff --git a/mult.php b/mult.php index a28efc8a..d7b4d78a 100644 --- a/mult.php +++ b/mult.php @@ -1,38 +1,34 @@ info['id']) && $u->info['admin'] > 0 ) { - - $html = ''; - $i = 1; - $sp = mysql_query('SELECT `id`,`login`,`money`,`money2`,`level` FROM `users` WHERE `real` = 1 AND `admin` = 0 AND `level` >= 8 AND `pass` NOT LIKE "%saint%" ORDER BY `money` ASC'); - while( $pl = mysql_fetch_array($sp) ) { - // - //prckr - $b0 = mysql_fetch_array(mysql_query('SELECT SUM(`1price`) AS `a` , SUM(`2price`) AS `b` FROM `items_users` WHERE `uid` = "'.$pl['id'].'" AND `delete` = 0 LIMIT 1')); - $b1 = $pl['money'] + $b0['a']; - $b2 = $pl['money2'] + $b0['b']; - // - /*if( $b1 < 1000 ) { $html .= ''; } - $html .= $i.'. '.$u->microLogin($pl['id'],1).' ( '.$b1.' . / '.$b2.' . )
    '; - if( $b1 < 1000 ) { $html .= '
    '; }*/ - //$i++; - if( $b1 < 1000 ) { - $html .= ''; - $html .= $i.'. '.$u->microLogin($pl['id'],1).' ( '.$b1.' . / '.$b2.' . )
    '; - $html .= '
    '; - $i++; - } - } - - echo $html; - -}else{ - header('location: https://new-combats.com/'); - die(); +if (!$u->info['admin']) { + header('location: https://new-combats.com/'); + die(); } - -?> \ No newline at end of file +$html = ''; +$i = 1; +$sp = mysql_query( + 'SELECT `id`,`login`,`money`,`money2`,`level` FROM `users` WHERE `real` = 1 AND `admin` = 0 AND `level` >= 8 AND `pass` NOT LIKE "%saint%" ORDER BY `money` ASC' +); +while ($pl = mysql_fetch_array($sp)) { + // + //prckr + $b0 = mysql_fetch_array( + mysql_query( + 'SELECT SUM(`1price`) AS `a` , SUM(`2price`) AS `b` FROM `items_users` WHERE `uid` = "' . $pl['id'] . '" AND `delete` = 0 LIMIT 1' + ) + ); + $b1 = $pl['money'] + $b0['a']; + $b2 = $pl['money2'] + $b0['b']; + if ($b1 < 1000) { + $html .= ''; + $html .= $i . '. ' . $u->microLogin($pl['id'], 1) . ' ( ' . $b1 . ' . / ' . $b2 . ' . )
    '; + $html .= '
    '; + $i++; + } +} +echo $html; diff --git a/mults.php b/mults.php index 3c1b798b..2f89923d 100644 --- a/mults.php +++ b/mults.php @@ -1,15 +1,16 @@ info['admin'] > 0 ) { - $sp = mysql_query('SELECT * FROM `mults`'); - while( $pl = mysql_fetch_array($sp) ) { - echo ''.$u->microLogin($pl['uid'],1).' '.$u->microLogin($pl['uid2'],1).'
    '; - } + +const GAME = true; +include('_incl_data/__config.php'); +include('_incl_data/class/__db_connect.php'); +$u = User::start(); + +if (!$u->info['admin']) { + return; +} +$sp = mysql_query('SELECT * FROM `mults`'); +while ($pl = mysql_fetch_array($sp)) { + echo '' . $u->microLogin($pl['uid'], 1) . ' ' . $u->microLogin($pl['uid2'], 1) . '
    '; } -?> \ No newline at end of file diff --git a/myexp.php b/myexp.php index 749aec16..b5beb0db 100644 --- a/myexp.php +++ b/myexp.php @@ -1,29 +1,34 @@ \n"; + +use Insallah\Db; + +function var_info($vars, $d = false) +{ + echo "
    \n";
         var_dump($vars);
         echo "
    \n"; - if ($d) exit(); + if ($d) { + exit(); + } } -define('IP',GetRealIp()); +const GAME = true; include('_incl_data/__config.php'); -define('GAME',true); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); +define('IP', UserIp::get()); +$u = User::start(); -if(isset($u->info['id'])) { - $sp = mysql_query('SELECT * FROM `battle_last` WHERE `uid` = "'.$u->info['id'].'" ORDER BY `id` DESC'); - while( $pl = mysql_fetch_array($sp) ) { - echo ' '.$pl['battle_id'].' , : '.$pl['exp'].'
    '; - } +if (isset($u->info['id'])) { + $sp = Db::getRows('select battle_id, exp from battle_last where uid = ? order by id desc', [$u->info['id']]); + foreach ($sp as $row) { + echo ' ' . $row['battle_id'] . ' , : ' . $row['exp'] . '
    '; + } } - -?> \ No newline at end of file diff --git a/news_script/index.php b/news_script/index.php index 6eeb9315..837fd78e 100644 --- a/news_script/index.php +++ b/news_script/index.php @@ -1,7 +1,7 @@ '; +if (in_array($rv, [1, 2])) { + if ($rv == 1) { + $sex = 0; + // + } else { + $sex = 1; + // + } + $sp = Db::getRows( + 'select * from obraz where sex = ? and usr_add = 0 and align = 0 and clan = 0 and login = \'\' and tr = \'\' and itm = 0 and uid = 0', + [$sex] + ); +} +if ($rv === 3) { + $sp = Db::getRows('select * from obraz where login != \'\' or uid != 0'); } -/* */ -$rz = array( - '', - '', - '' -); - -// 3 ? True - , False - . -$img3dShow = true; - -/* */ -$u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`banned` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_COOKIE['login']).'" AND `pass` = "'.mysql_real_escape_string($_COOKIE['pass']).'" LIMIT 1')); - -/* */ -$itm = mysql_fetch_array(mysql_query('SELECT * FROM `obraz` WHERE `id` = "'.mysql_real_escape_string($_GET['id']).'" LIMIT 1')); - - - 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/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=='') - { - if($time_still<0) - { - $time_still = 0; - } - $out = $time_still.' .'; - } - return $out; - } - -function lookStats($m) { - $ist = array(); - $di = explode('|',$m); - $i = 0; $de = false; - while($i + {$itm['name']} +
    {$itm['name']}
    + +HTML; + } } -$itd = lookStats($itm['tr']); -if( $itm['name'] == '' ) { - $itm['name'] = ' '.$itm['id'].''; -} -if( $itm['history'] == '' ) { - $itm['history'] = ' ...'; -} - -$items = array( - 'tr' => array('lvl','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','a1','a2','a3','a4','a5','a6','a7','mg1','mg2','mg3','mg4','mg5','mg6','mg7','mall','m2all','aall'), - 'add' => array('min_heal_proc','no_yv1','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','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','aall','a1','a2','a3','a4','a5','a6','a7','m2all','mall','mg1','mg2','mg3','mg4','mg5','mg6','mg7','hpAll','mpAll','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','zona','zonb','maxves','minAtack','maxAtack'), - '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','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','aall','a1','a2','a3','a4','a5','a6','a7','m2all','mall','mg1','mg2','mg3','mg4','mg5','mg6','mg7','hpAll','mpAll','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') - ); - -$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'=>'. (%)','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'=>' '); - -if( !file_exists('../img.new-combats.com/i/encicl/pict_'.$rz[$rt[$itm['type']]][0].'.jpg') == true ) { - //subject - $rz[$rt[$itm['type']]][0] = 'subject'; -} - -if( !isset($rz[$rt[$itm['type']]][1])) { - $rz[$rt[$itm['type']]][1] = ''; -} - ?> - + - - | <? if(isset($itm['id'])) { ?>| <?=$rz[$rt[$itm['type']]][1]?> | <?=$itm['name']?><? } ?> - - + + | + + - - - - - -
    - - - -
    - - - - - - - - - - - - - - - -
    -

    -
    -

    / -

    - -

    - -
    - - - - - - - - - - - - - - - - -
      
    -
    - -

     

    -
    - - - -
    - - - - - -
    - -

    - :
    -
    + +
    + +
    -
    -

    - -

        
     
    - 0 ) { - - if($rv == 1) { - // - $sp = mysql_query('SELECT * FROM `obraz` WHERE `sex` = 0 AND `standart` = 1'); - }elseif($rv == 2) { - // - $sp = mysql_query('SELECT * FROM `obraz` WHERE `sex` = 1 AND `standart` = 1'); - } - - } - - - -?> - - - - - - - - - - - - - - -
    -

    » / -

    - -

    - '; - }else{ - - - while( $itm = mysql_fetch_array($sp) ) { - if( $itm['name'] == '' ) { - $itm['name'] = ' '.$itm['id']; - } - ?> - - - -
    - - - -


    <?=$itm['name']?>
    -
    - -

     

    -
    -

    - -

        
    - - - -
    - +
    + + + + + + + - - - - -
    + + + +
    +
    +

    + hr
    + +
    + + +      +

    -
    -    ·  
    -
    -    ·  
    -


    - - -
     
    - -
    - - - - - - - - - + + + +
    -  -
    Copyright www.new-combats.com

    + +
    +
    +
      +
    • +
    +
    +
    +
      +
    • +
    +
    + +
    + + +   +
    + diff --git a/online.php b/online.php index 92e7655c..9d8e8730 100644 --- a/online.php +++ b/online.php @@ -1,11 +1,14 @@ info['id']) || @@ -21,34 +24,37 @@ if ($u->info['bithday'] == '01.01.1800') { $_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); + $filter->setOnline($u->info['online'], $u->info['id']); $u->onlineBonus(); } -if ( - isset($_POST['delMsg']) && - ( - $u->info['admin'] > 0 || +function isModerOrAdmin($uinfo) +{ + return $uinfo['admin'] > 0 || ( - $u->info['align'] > 1 && - $u->info['align'] < 2) || + $uinfo['align'] > 1 && + $uinfo['align'] < 2) || ( - $u->info['align'] > 3 && - $u->info['align'] < 4 - ) - ) -) { + $uinfo['align'] > 3 && + $uinfo['align'] < 4 + ); +} + +if (isset($_POST['delMsg']) && isModerOrAdmin($u->info)) { 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'); + 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'); + mysql_query( + 'UPDATE `users` SET `molch3` = "' . (time() + 3600 * 3) . '" WHERE `id` = "' . mysql_real_escape_string( + -((int)$_POST['delMsg']) + ) . '" LIMIT 1' + ); } } @@ -58,12 +64,14 @@ $r = [ 'list' => null, 'msg' => null, 'js' => null, - 'xu' => 0 + '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')); + $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";'; } @@ -80,50 +88,74 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') { $x = explode(" ", $buf); $newbuf = ''; for ($j = 0; $j < count($x); $j++) { - $uname = '<Внутренняя ссылка>'; + $uname = '< >'; // 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')); + $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 = '<Информация о "' . $ulogin . '">'; + $uname = '< "' . $ulogin . '">'; } - } elseif (strripos($x[$j], 'audio_1610649509.mp3')) { //ТУТ аудио - $uname = '<Голосовое сообщение>'; + } elseif (strripos($x[$j], 'audio_1610649509.mp3')) { // + $uname = '< >'; } 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')); + $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 = '<Предмет "' . $ulogin . '">'; + $uname = '< "' . $ulogin . '">'; } else { - $uname = '<Библиотека предметов>'; + $uname = '< >'; } } 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')); + $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 = '<Новость "' . $ulogin . '">'; + $uname = '< "' . $ulogin . '">'; } else { - $uname = '<Новостная лента>'; + $uname = '< >'; } } 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')); + $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 = '<Библиотека "' . $ulogin . '">'; + $uname = '< "' . $ulogin . '">'; } else { - $uname = '<Библиотека>'; + $uname = '<>'; } } elseif (strripos($x[$j], 'new-combats.com/forum')) { $ulogin = explode('/forum?read=', $x[$j]); @@ -131,29 +163,45 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') { $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')); + $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 = '<Форум "' . $ulogin . '">'; + $uname = '< "' . $ulogin . '">'; } 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')); + $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 = '<Конференция форума "' . $ulogin['name'] . '">'; + $uname = '< "' . $ulogin['name'] . '">'; } else { - $uname = '<Форум проекта>'; + $uname = '< >'; } } } // $newbuf .= preg_match - ("/(https:\\/\\/)?(new-combats+\\.com(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?)))/", - $x[$j], $ok) ? str_replace($ok[2], "" . $uname . "", - str_replace("https://", "", $x[$j])) . " " : $x[$j] . " "; + ( + "/(https:\\/\\/)?(new-combats+\\.com(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?)))/", + $x[$j], $ok + ) ? str_replace( + $ok[2], "" . $uname . "", + str_replace("https://", "", $x[$j]) + ) . " " : $x[$j] . " "; } return $newbuf; } @@ -187,9 +235,19 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_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')); + $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')); + $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; } @@ -198,15 +256,19 @@ 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'] . '","Вы наказаны за спам на 20 минут ","Black","1","1","0"]);'; + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," 20 ","Black","1","1","0"]);'; - mysql_query('UPDATE `users` SET `molch1` = "' . $u->info['molch1'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'); + 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 ( + 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'] . '", "1", @@ -225,11 +287,13 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') { "red", "0", "0", - "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 ( + 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'] . '", "1", @@ -248,27 +312,35 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') { "Black", "0", "0", - "0")'); + "0")' + ); } } elseif ($lmg[0] > 0) { - $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","Вы не можете отправлять так часто сообщения... ","Black","1","1","0"]);'; + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," ... ","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'] . '","Вы наказаны за флуд на 5 минут ","Black","1","1","0"]);'; + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," 5 ","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'); + 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'] . '","Вы не можете отправлять приват до достижения 150000 опыта.","Black","1","1","0"]);'; + } 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'] . '"," 150000 .","Black","1","1","0"]);'; } else { - //Записываем данные + // $msg['time'] = time(); $msg['spam'] = 0; $msg['type'] = 1; @@ -285,7 +357,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']); @@ -305,41 +377,59 @@ 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')); + $admq = Db::getRow('select id, admin from users where login = ? and admin > 0', [$msg['to']]); if ($msg['type'] != 3) { unset($admq); } } 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'] . '","В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Повторные попытки могут привести к блокировке персонажа.","Black","1","1","0"]);'; + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," . .","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); + $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'); + 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('%', ',', $msg['fspam']); $msg['fspam'] = '' . ltrim($msg['fspam'], '0,') . ''; - $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Запрещенные слова: ' . $msg['fspam'] . '. Предупреждения [' . ($mban['vals'] + 1) . '/1]","Black","1","1","0"]);'; + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," . : ' . $msg['fspam'] . '. [' . ($mban['vals'] + 1) . '/1]","Black","1","1","0"]);'; } else { - $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Вы наказаны за нарушение правил общения.","Black","1","1","0"]);'; - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','0','','','Автоинформатор: Персонаж " . $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 . ' "' . $u->info['login'] . '" Автоинформатор: ' . $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)"); + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," . .","Black","1","1","0"]);'; + mysql_query( + "INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','0','','',': " . $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 . ' "' . $u->info['login'] . '" : ' . $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); @@ -348,14 +438,24 @@ 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')); + $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'] . '","Вас добавили в игнор: Вы не можете отправлять сообщения персонажу "' . htmlspecialchars($msg['to']) . '".","Black","1","1","0"]);'; + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," : "' . htmlspecialchars( + $msg['to'] + ) . '".","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'] . '","Вы не являетесь частью одного из Кланов и не можете общаться по этому каналу.","Black","1","1","0"]);'; + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," .","Black","1","1","0"]);'; $msg['cancel']++; } else { $msg['to'] = 'k' . $u->info['clan']; @@ -364,7 +464,13 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') { } 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')); + $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); } @@ -389,31 +495,34 @@ 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'] . '","Персонажа нет в данной комнате.","Black","1","1","0"]);'; + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," .","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%-', '%usrsmil%-', $_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']); + $_POST['msg'] = str_replace( + ':' . $usml[$i] . ':', ':%usersmile%-' . $usml[$i] . ':', $_POST['msg'] + ); $i++; } @@ -428,11 +537,13 @@ 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'] . '","В целях борьбы против рекламы, общение в чате доступно с 8-го уровня. ","red","1","1","0"]);'; + $r['js'] .= 'chat.sendMsg(["new","' . time( + ) . '","6","","' . $u->info['login'] . '"," , 8- . ","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 ( + 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'] . '", @@ -452,62 +563,88 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') { "' . $msg['color'] . '", "' . $msg['typeTime'] . '", "' . $msg['sound'] . '", - "' . $msg['global'] . '")'); + "' . $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))) { + 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')); + $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 = [ - 'Отстань попрошайка! ... Ищу анекдоты, интернет не маленький!', - 'Подожди... Сейчас что-нибудь найду', - 'Почти нашел...', - 'Вот один есть, но он не интересный...', - 'А свет на центральной площади тьму "пинает"... Эх...' + ' ! ... , !', + '... - ', + ' ...', + ' , ...', + ' ""... ...', ]; $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')); + $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("
    ", "
        ", $text_com); $text_com = str_replace("
    ", "
        ", $text_com); $text_com = str_ireplace("\r\n", "", $text_com); $text_com = str_replace("", "", $text_com); - $text_com = 'Анекдот:
        ' . $text_com . '
    '; + $text_com = ':
        ' . $text_com . '
    '; } else { - $text_com = 'Анекдот из головы вылетел...'; + $text_com = ' ...'; } - mysql_query('INSERT INTO `a_com_act` (`act`,`time`,`uid`) VALUES ("0","' . (time() + 60) . '","' . $u->info['id'] . '")'); + 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")' + ); } } } - mysql_query('UPDATE `users` SET `afk` = "",`dnd` = "",`timeMain` = "' . time() . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 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'); + $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; + $ar_all = '0'; $usl = []; $cw = []; $usid = []; @@ -518,7 +655,9 @@ if ($_GET['r1'] != 0) { $ysee = 0; } else { if ($pl['online'] < time() - 120) { - mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' + ); } } } else { @@ -570,9 +709,13 @@ if ($_GET['r1'] != 0) { 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 + $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')); + `time_finish` > ' . time() . ' LIMIT 1' + ) + ); if (isset($pl['cwar']['id'])) { $cw['war'][$pl['clan']][$u->info['clan']] = $pl['cwar']['type']; } else { @@ -584,7 +727,9 @@ if ($_GET['r1'] != 0) { } } if (!isset($cw[$pl['clan']])) { - $pl['clan'] = mysql_fetch_array(mysql_query('SELECT `name_mini` FROM `clan` WHERE `id` = "' . $pl['clan'] . '" LIMIT 1')); + $pl['clan'] = mysql_fetch_array( + mysql_query('SELECT `name_mini` FROM `clan` WHERE `id` = "' . $pl['clan'] . '" LIMIT 1') + ); } else { $pl['clan'] = $cw[$pl['clan']]; } @@ -597,15 +742,18 @@ if ($_GET['r1'] != 0) { } 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 = 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; - } + //trigger_error('align:' . $pl['align'] . ' clan:' . $pl['clan'] . ' molch1:' . $pl['molch1'] . ' banned:' . $pl['banned'] . ' battle:' . $pl['battle']); + $ar_all .= $pl['align'] . $pl['clan'] . $pl['molch1'] . $pl['banned'] . $pl['battle'] . 1; + } $r['xu']++; } @@ -621,13 +769,14 @@ function json_fix_cyr($json_str) } -//Получаем сообщения +// 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 +$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 @@ -685,7 +834,8 @@ $sp = mysql_query('SELECT `nosee`,`frv`,`id`,`dn`,`active`,`invis`,`login`,`to`, ) ) ) - ORDER BY `id` ASC'); + ORDER BY `id` ASC' +); while ($pl = mysql_fetch_array($sp)) { if ($pl['delete'] > 0) { @@ -698,20 +848,7 @@ while ($pl = mysql_fetch_array($sp)) { $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 - ) - ) - ) { + if ($pl['type'] == 8 && isModerOrAdmin($u->info)) { $see = 0; } @@ -720,7 +857,7 @@ while ($pl = mysql_fetch_array($sp)) { $pl['city'] = $u->info['city']; } - //Проверки на доступ к просмотру + // if ( (( ( @@ -737,14 +874,7 @@ while ($pl = mysql_fetch_array($sp)) { $pl['type'] == 5 || $pl['type'] == 6 || ( - $pl['type'] == 8 && - ( - $u->info['admin'] > 0 || - ( - $u->info['align'] > 1 && - $u->info['align'] < 2 - ) - ) + $pl['type'] == 8 && isModerOrAdmin($u->info) ) ) && ( @@ -785,7 +915,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']) { @@ -796,7 +926,7 @@ while ($pl = mysql_fetch_array($sp)) { $see = 0; } - //Системное сообщение только в этой комнате + // if ( $pl['type'] == 6 && $pl['room'] > 0 && @@ -806,17 +936,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 || @@ -834,24 +964,24 @@ 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; } $modr = 0; - if (($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4)) { + if (isModerOrAdmin($u->info)) { $modr = 1; } @@ -859,9 +989,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'] = '[' . $noseein . '] ' . $pl['text'] . ''; if ($u->info['admin'] > 0 || $modr == 1) { @@ -872,7 +1002,13 @@ while ($pl = mysql_fetch_array($sp)) { 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')); + $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; } @@ -885,7 +1021,10 @@ while ($pl = mysql_fetch_array($sp)) { $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'); + 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'); @@ -899,17 +1038,27 @@ while ($pl = mysql_fetch_array($sp)) { $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)) { + 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]', '', $pl['text']); + $pl['text'] = str_replace( + '[img[' . $reimg[1][$k] . ']][1]', + '', $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)) { + 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] . ']]', '', $pl['text']); + $pl['text'] = str_replace( + '[img[' . $reimg[1][$k] . ']]', '', + $pl['text'] + ); $k++; } } @@ -917,31 +1066,43 @@ 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] . ']', 'Предмет', $pl['text']); + $pl['text'] = str_replace( + 'item[' . $reimg[1][$k] . ']', + '', + $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] . ']', 'Аудио запись', $pl['text']); + $pl['text'] = str_replace( + 'item[' . $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] . ']', 'Предмет', $pl['text']); + $pl['text'] = str_replace( + 'item [' . $reimg[1][$k] . ']', + '', + $pl['text'] + ); $k++; } } if ($pl['type'] != 3 && ($pl['invis'] == 1 || $pl['invis'] > time())) { if ($u->info['admin'] == 0) { - $pl['login'] = 'Невидимка'; + $pl['login'] = ''; } else { - $pl['login'] = 'Невидимка (' . $pl['login'] . ')'; + $pl['login'] = ' (' . $pl['login'] . ')'; } } @@ -950,7 +1111,9 @@ while ($pl = mysql_fetch_array($sp)) { $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'] . '"]'; + $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']) { @@ -960,26 +1123,27 @@ while ($pl = mysql_fetch_array($sp)) { } $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 = 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) { @@ -988,17 +1152,25 @@ 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')); - $usr = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level` FROM `users` WHERE `id` = "' . $pl['uid_clan'] . '" LIMIT 1')); + $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'] . '
    [' . $usr['level'] . ']");'; } 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')); +// +$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) { @@ -1008,7 +1180,7 @@ if (isset($trf['id'])) { } } -//Перекодируем строки +// if ($r['js'] != null) { $r['js'] = iconv('cp1251', 'utf-8', $r['js']); } else { diff --git a/onlineList.js b/onlineList.js index 128a10cc..7b9bdd6f 100644 --- a/onlineList.js +++ b/onlineList.js @@ -1,14 +1,14 @@ var sml_img = { }; Element.prototype.remove = function() { - this.parentElement.removeChild(this); + this.parentElement.removeChild(this); } NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { - for(var i = 0, len = this.length; i < len; i++) { - if(this[i] && this[i].parentElement) { - this[i].parentElement.removeChild(this[i]); - } - } + for(var i = 0, len = this.length; i < len; i++) { + if(this[i] && this[i].parentElement) { + this[i].parentElement.removeChild(this[i]); + } + } } var chat = { @@ -49,8 +49,8 @@ var chat = { delete this.ignoreList[login]; return //msg - } - + } + this.ignoreList.x++; this.ignoreList[login] = this.ignoreList.x; this.ignoreList.nms[this.ignoreList.x] = login; @@ -74,11 +74,11 @@ var chat = { 'width':135, 'sound':this.getRandom(8,10), 'height':99, - 'zad':3 + 'zad':3 }; frc.left -= 35; } - + if( frc.name != undefined ) { this.sendSound( frc.sound ); var obj = top.frames.main.document.getElementById('frvrks'); @@ -87,7 +87,7 @@ var chat = { var i = 1; while( i <= frc.x ) { newhtml += ``; - i++; + i++; } newhtml = `
    ${newhtml}
    `; $(obj).append(newhtml); @@ -137,7 +137,7 @@ var chat = { lookSmiles: function () { if ($('#chbtn8').attr('class') == 'db cp chatBtn8_1') { return this.lookSmilesWork('', 'chatBtn8_2') - } + } return this.lookSmilesWork('none', 'chatBtn8_1') }, lookSmilesWork: function (display, className) { @@ -150,13 +150,13 @@ var chat = { $(elemId).attr('class', `db cp ${className}`); this[method] = count; }, - + // // 1 filterMsg: function () { if ($('#chbtn1').attr('class') == 'db cp chatBtn1_1') { return this.greyButton_work('#chbtn1', 'chatBtn1_2', "filter", 1) - } + } return this.greyButton_work('#chbtn1', 'chatBtn1_1', "filter", 0) }, @@ -172,7 +172,7 @@ var chat = { $.cookie('citySys', 0); return }, - + // // 3 soundChat: function () { @@ -180,7 +180,7 @@ var chat = { return this.greyButton_work('#chbtn7', 'chatBtn7_2', "sound", 1) } else if ($('#chbtn7').attr('class') == 'db cp chatBtn7_2') { return this.greyButton_work('#chbtn7', 'chatBtn7_3', "sound", 2) - } + } return this.greyButton_work('#chbtn7', 'chatBtn7_1', "sound", 0) }, @@ -189,47 +189,47 @@ var chat = { translitChat: function () { if ($('#chbtn6').attr('class') == 'db cp chatBtn6_1') { return this.greyButton_work('#chbtn6', 'chatBtn6_2', "translit", 1) - } + } return this.greyButton_work('#chbtn6', 'chatBtn6_1', "translit", 0) - }, + }, subValSend: '', - subSend: async function () { - if ($('#textmsg').val() != '') { - if ($('#textmsg').val() != this.subValSend) { - if (this.nozpros == 0) { - this.trmb(); - var textmsg = $('#textmsg').val(); + subSend: async function () { + if ($('#textmsg').val() != '') { + if ($('#textmsg').val() != this.subValSend) { + if (this.nozpros == 0) { + this.trmb(); + var textmsg = $('#textmsg').val(); - if (cb_date[cb_select] == 7 && (textmsg.match(/to *\[(.*?)\].*/i) || textmsg.match(/private *\[(.*?)\].*/i))) { - for (var cb in cb_date) { - if (cb_date[cb] == 5) { + if (cb_date[cb_select] == 7 && (textmsg.match(/to *\[(.*?)\].*/i) || textmsg.match(/private *\[(.*?)\].*/i))) { + for (var cb in cb_date) { + if (cb_date[cb] == 5) { open_cb(cb, null); - } - } - } - if (typeof window.online_send_jqxhr == "undefined" || window.online_jqxhr.readyState === 4) { - window.online_send_jqxhr = $.post('online.php?r' + c.rnd + '&cas' + ((new Date().getTime()) + Math.random()), { - msg: textmsg, - key: this.key, - mid: this.msg_id, - rndo: c.rnd, - cb: cb_date[cb_select] - }, function (data) { - chat.clearText(); - chat.fc(); + } + } + } + if (typeof window.online_send_jqxhr == "undefined" || window.online_jqxhr.readyState === 4) { + window.online_send_jqxhr = $.post('online.php?r' + c.rnd + '&cas' + ((new Date().getTime()) + Math.random()), { + msg: textmsg, + key: this.key, + mid: this.msg_id, + rndo: c.rnd, + cb: cb_date[cb_select] + }, function (data) { + chat.clearText(); + chat.fc(); chat.genchatData(data, 1); chat.scrollNow(true) - }); - } - } - } - } - }, + }); + } + } + } + } + }, addto:function(login, type2) { var loginaddT = login; var s = ''; - if($('#'+$(this.inObj).attr('id')).attr('id') == undefined) { + if($('#'+$(this.inObj).attr('id')).attr('id') == undefined) { $('#textmsg').focus(); s = $('#textmsg').val(); } else $(this.inObj).focus(); @@ -241,13 +241,13 @@ var chat = { } else if(s.match(reg551) == null) { type = "private"; } - var type3 = 'to'; + var type3 = 'to'; var reg2 = new RegExp(""+type+"(\\s*)\\[(.*?)\\]",""); var cs = s.replace(reg2,""+type+"$1[,$2,]"); var slogin = login.replace(/([\^.*{}$%?\[\]+|\/\(\)])/g,"\\$1"); var reg = new RegExp(""+type+"\\s*\\[.*,\\s*"+slogin+"\\s*,.*\\]",""); var result = ''; - var reg3 = new RegExp(""+type+"\\s*\\[(.*?)\\]",""); + var reg3 = new RegExp(""+type+"\\s*\\[(.*?)\\]",""); while(res = s.match(reg3)) { // result += res[1]+','; result += `${res[1]},`; @@ -271,7 +271,7 @@ var chat = { if (type2 == 'to') { if (test1 != null) type2 = 'private'; } - + if (loginaddT == 'klan' && type2 == 'private') { if (login == 'klan, ') { s = type2 + ' [klan] to [' + prob + '' + str + '' + prob + ']' + space + s; @@ -280,12 +280,12 @@ var chat = { } } else {s = type2+' ['+prob+''+login+str+''+prob+']'+space+s;} - } else { + } else { if(type3 == 'to') type3 = "private"; s = type3+' ['+prob+''+str+''+prob+']'+space+s; } } else s = login+str; - + if (this.inObj != null && $('#main').contents().find(`#${this.inObj.id}`).attr('id') != undefined) { $('#main').contents().find(`#${this.inObj.id}`).val(s); } else if ($('#' + $(this.inObj).attr('id')).attr('id') == undefined) { @@ -302,53 +302,53 @@ var chat = { reMoney: function () { $('#moneyGM').html(`${top.c.money} .`); }, - testTimer: function (n) { - clearTimeout(this.t); - if ($.cookie('btl') != this.btl) { - if ($.cookie('btl') > 0) { - this.sendSound(2); - if (top.frames['main'].smnpty == undefined) { + testTimer: function (n) { + clearTimeout(this.t); + if ($.cookie('btl') != this.btl) { + if ($.cookie('btl') > 0) { + this.sendSound(2); + if (top.frames['main'].smnpty == undefined) { top.frames['main'].location.href = "main.php"; - } - } - this.btl = $.cookie('btl'); - } - if (this.rtime != this.ct[$.cookie('chatCfg0')] && this.ct[$.cookie('chatCfg0')] != undefined) { - this.rtime = this.ct[$.cookie('chatCfg0')]; - if (this.time > this.rtime) this.time = this.rtime; - } - if (this.rtime >= 5 || this.r == 0) //was >- 30 lakris fix - { - if (this.time < 1) { - var aot = { - 0: 0, - 1: 1, - 2: 0 - }; - if ($('#chcf10').attr('checked') == true) aot[2] = 1; - if ($('#autoRefOnline').attr('checked') == true || this.r == 0 || n != false) { - aot[0] = 1; - } - if (this.nozpros == 0) { - - if (typeof window.online_jqxhr == "undefined" || window.online_jqxhr.readyState === 4) { - window.online_jqxhr = $.getJSON(`online.php?r${c.rnd}&cas${((new Date().getTime()) + Math.random())}`, {key: this.key, mid: this.msg_id, r1: aot[0], r2: aot[1], r3: aot[2], rndo: c.rnd}, function (data) { - if (data.rnd != null) { - chat.genchatData(data); - if (data.key != undefined) chat.saveData = data; - this.g++; - c.rnd = data.rnd; - } - }); - } - } - this.time = 5; - this.r++; - } else this.time--; - this.t = setTimeout('chat.testTimer(false);clearTimeout(this.t);', 1000); - } - }, - + } + } + this.btl = $.cookie('btl'); + } + if (this.rtime != this.ct[$.cookie('chatCfg0')] && this.ct[$.cookie('chatCfg0')] != undefined) { + this.rtime = this.ct[$.cookie('chatCfg0')]; + if (this.time > this.rtime) this.time = this.rtime; + } + if (this.rtime >= 5 || this.r == 0) //was >- 30 lakris fix + { + if (this.time < 1) { + var aot = { + 0: 0, + 1: 1, + 2: 0 + }; + if ($('#chcf10').attr('checked') == true) aot[2] = 1; + if ($('#autoRefOnline').attr('checked') == true || this.r == 0 || n != false) { + aot[0] = 1; + } + if (this.nozpros == 0) { + + if (typeof window.online_jqxhr == "undefined" || window.online_jqxhr.readyState === 4) { + window.online_jqxhr = $.getJSON(`online.php?r${c.rnd}&cas${((new Date().getTime()) + Math.random())}`, {key: this.key, mid: this.msg_id, r1: aot[0], r2: aot[1], r3: aot[2], rndo: c.rnd}, function (data) { + if (data.rnd != null) { + chat.genchatData(data); + if (data.key != undefined) chat.saveData = data; + this.g++; + c.rnd = data.rnd; + } + }); + } + } + this.time = 5; + this.r++; + } else this.time--; + this.t = setTimeout('chat.testTimer(false);clearTimeout(this.t);', 1000); + } + }, + gUser:function(data,ol) { var rt = ''; @@ -371,11 +371,11 @@ var chat = { } else rt = `${rt}`; if(data[13]!=0) rt = `${rt}`; - + if (data[10] > 0) { rt = `${rt}`; } - + if (data[8] != 0) data_work(8) else if (data[9] != 0) data_work(9) @@ -388,11 +388,11 @@ var chat = { { rt = `${rt}`; } - - if( data[16] > 0 ) rtData(16) - + + if( data[16] > 0 ) rtData(16) + rtData(3) - + if(c.lvl>-1) { if(c.city==data[6]) @@ -443,7 +443,7 @@ var chat = { $(`#molch${id}`).html(this.timeOut(this.mlch[id])); this.t_all[id] = setTimeout(`chat.refMolch(${id})`, 1000); return - } + } $(`#img_molch${id}`).remove(); return delete this.mlch[id], this.t_all; }, @@ -451,7 +451,7 @@ var chat = { fc: function () { $('#textmsg').focus(); }, - + timeOut: function (v) { msPerDay = ''; @@ -500,13 +500,13 @@ var chat = { $('#textmsg').focus(); return } - } + } return $('#textmsg').val(''); }, scrollNow: function (userTrue) { var $chat_list = document.getElementById("chat_list") - + var $countChatList = $chat_list.scrollHeight - $chat_list.scrollTop if ($countChatList < $chat_list.offsetHeight + 60) { return $chat_list.scrollBy(0, $chat_list.scrollHeight) @@ -517,7 +517,7 @@ var chat = { sendMsg:function(data) { var msg_see = 1; var global_type = 0; - + if( data[5] != undefined ) { if( data[5].substring(0,7) == 'global:' ) { global_type = 1; @@ -525,203 +525,203 @@ var chat = { } } if (data[0] == 'new') { - data[0] = `new_msg_ ${this.newmsg++}`; + data[0] = `new_msg_ ${this.newmsg++}`; } - if (data[2] == 'delete') this.deleteMessage(data[0]); - else if (data['d'] > 0) this.deleteMessage(data['d']); + if (data[2] == 'delete') this.deleteMessage(data[0]); + else if (data['d'] > 0) this.deleteMessage(data['d']); else if (data['s'] > 0) this.deleteMessage(data['s']); else if(data[0]!=undefined && top.document.getElementById(`msg_${data[0]}`) == undefined) { var msg = ''; - if(data[0]!=0) + if(data[0]!=0) + { + if(top.c.admin > 0) { + if(data[12] == 1) { + msg += ' unactive '; + } + } + if(data[3]!='') { - if(top.c.admin > 0) { - if(data[12] == 1) { - msg += ' unactive '; - } - } - if(data[3]!='') - { - if(data[16] > 0) { - msg += `[${data[3]}]`; - }else{ - msg += `[${data[3]}]`; - } - if(chat.ignoreList[data[3]]!=undefined) msg_see = 0; + if(data[16] > 0) { + msg += `[${data[3]}]`; + }else{ + msg += `[${data[3]}]`; } + if(chat.ignoreList[data[3]]!=undefined) msg_see = 0; + } + if(data[4]!='') + { + var forYou = 0; + // + + // , if(data[4]!='') { - var forYou = 0; - // - - // , - if(data[4]!='') + var to = '',to2 = '',arr = data[4].split(','),i = 0,vl = ''; + // + while(i!=-1) { - var to = '',to2 = '',arr = data[4].split(','),i = 0,vl = ''; - // - while(i!=-1) + if(arr[i]!=undefined) { - if(arr[i]!=undefined) - { - vl = this.trim(arr[i]); - if (vl.toLowerCase() == top.c.login.toLowerCase()) { - forYou++; - } - if (vl.toLowerCase() == top.c.login.toLowerCase()) { - vl = this.trim(data[3]); - } - if (i > 0) { - to += ', '; - to2 += ', '; - } - if (data[3] != '') { - to += `${this.trim(arr[i])}`; - - if (this.trim(arr[i].toLowerCase()) != top.c.login.toLowerCase()) { - to2 += this.trim(arr[i]); - } else { - if (data[2] == 2) to2 += this.trim(arr[i]); - else to2 += this.trim(vl); - } - } - } else i = -2; - i++; - } - } - - if(data[2] == 6 || data[2] == 8) { - var zmlogin = new RegExp("\\[login:(.*?)\\]",""); - var reflcd = new RegExp("\\[reflesh_main_zv_priem:(.*?)\\]",""); - if (data[5].match(zmlogin) != null) { - zmlogin = data[5].match(zmlogin)[1]; - data[5] = data[5].replace(`[login:${zmlogin}]`, `${zmlogin}`); - } - if (data[5].match(reflcd) != null) { - reflcd = data[5].match(reflcd)[1]; - data[5] = data[5].replace(`[reflesh_main_zv_priem:${reflcd}]`, ''); - } - } - - // - if (data[2] == 6) { - // , - msg += ' ! '; - } else if (data[2] == 2) - { - if (forYou > 0) { - msg += ` to [${to2}]`; - } else { - msg += ` to [${to2}]`; - } - }else if(data[2]==3) - { - if (this.trim(data[3].toLowerCase()) == top.c.login.toLowerCase()) { - forYou++; - } - if (data[3] != '') { - if (data[4] == 'klan' && data[2] == 3) { - msg += ' private [klan]'; - } else if (data[4] == 'paladins' && data[2] == 3) { - msg += ' private [paladins]'; - } else if (data[4] == 'tarmans' && data[2] == 3) { - msg += ' private [tarmans]'; - } else { - msg += ` private [ ${to} ]`; + vl = this.trim(arr[i]); + if (vl.toLowerCase() == top.c.login.toLowerCase()) { + forYou++; } - } - } - } - msg += ' '; - } - - data[5] = this.replaceAll(data[5],"[s1;]",'"'); - data[5] = this.replaceAll(data[5],"[s2;]",'\''); - data[5] = this.replaceAll(data[5],"[s3;]",'<'); - data[5] = this.replaceAll(data[5],"[s4;]",'>'); - - - if ($.cookie('chatCfg2') != 0) { - data[5] = chat.testSmile(data[5]); - } - - if (data[6] != 'Black' && data[6] != '') { - msg += `${data[5]}`; - } else msg += data[5]; - - if(data[2] == 21) { - //e text - var text = `[loginfrom] ${data[5]}`; - var ftps = `${data[3]}`; - var mblogin = new RegExp("\\[login:(.*?)\\]",""); - text = text.replace('[loginfrom]',ftps); - if(text.match(mblogin)!=null) - { - mblogin = text.match(mblogin)[1]; - text = text.replace(`[login:${mblogin}]`,`${mblogin}`); - } - msg = `${text}`; - } - if(data[1]>0) - { - var td = new Date((parseInt(data[1]))*1000); - td = [td,null,null,null]; - td[1] = td[0].getHours(); - td[2] = td[0].getMinutes(); - td[3] = td[0].getSeconds(); - td[4] = td[0].getDay(); - td[5] = td[0].getMonth(); - td[6] = td[0].getYear(); - var j = 1; - while (j < 6) { - if (td[j] < 10) td[j] = `0${td[j]}`; - j++; - } - - var cls = forYou > 0 ? 'date2' : 'date' - if (data[11] > 0) { - msg = ` ! ${msg}`; - } - if (data[10] > 0) { - msg = ` G ${msg}`; - } - var msg22 = ' 0) { - msg22 += `oncontextmenu="chat.deleteMessage(${data[0]}); - return false;" `; + if (vl.toLowerCase() == top.c.login.toLowerCase()) { + vl = this.trim(data[3]); + } + if (i > 0) { + to += ', '; + to2 += ', '; + } + if (data[3] != '') { + to += `${this.trim(arr[i])}`; + + if (this.trim(arr[i].toLowerCase()) != top.c.login.toLowerCase()) { + to2 += this.trim(arr[i]); + } else { + if (data[2] == 2) to2 += this.trim(arr[i]); + else to2 += this.trim(vl); + } + } + } else i = -2; + i++; + } } - // !!! - if( data[8] == 2 ) { - if( data[14] == undefined ) { - data[14] = '--:--'; + if(data[2] == 6 || data[2] == 8) { + var zmlogin = new RegExp("\\[login:(.*?)\\]",""); + var reflcd = new RegExp("\\[reflesh_main_zv_priem:(.*?)\\]",""); + if (data[5].match(zmlogin) != null) { + zmlogin = data[5].match(zmlogin)[1]; + data[5] = data[5].replace(`[login:${zmlogin}]`, `${zmlogin}`); } - if( data[14] == '--:--' && data[1] > 0 ) { - data[14] = data[1]; - var date14 = new Date(data[14]*1000); - data[14] = `${date14.getHours()}:${date14.getMinutes()}`; + if (data[5].match(reflcd) != null) { + reflcd = data[5].match(reflcd)[1]; + data[5] = data[5].replace(`[reflesh_main_zv_priem:${reflcd}]`, ''); + } + } + + // + if (data[2] == 6) { + // , + msg += ' ! '; + } else if (data[2] == 2) + { + if (forYou > 0) { + msg += ` to [${to2}]`; + } else { + msg += ` to [${to2}]`; + } + }else if(data[2]==3) + { + if (this.trim(data[3].toLowerCase()) == top.c.login.toLowerCase()) { + forYou++; + } + if (data[3] != '') { + if (data[4] == 'klan' && data[2] == 3) { + msg += ' private [klan]'; + } else if (data[4] == 'paladins' && data[2] == 3) { + msg += ' private [paladins]'; + } else if (data[4] == 'tarmans' && data[2] == 3) { + msg += ' private [tarmans]'; + } else { + msg += ` private [ ${to} ]`; + } } - msg22 += `class="${cls}">${data[14]} `; - }else{ - if( data[13] == undefined ) { - data[13] = '--:--'; - } - if( data[13] == '--:--' && data[1] > 0 ) { - data[13] = data[1]; - var date13 = new Date(data[13]*1000); - data[13] = `${date13.getHours()}:${date13.getMinutes()}`; - } - msg22 += `class="${cls}">${data[13]} `; } - msg = msg22+msg; } - this.msgcount++; - + msg += ' '; + } + + data[5] = this.replaceAll(data[5],"[s1;]",'"'); + data[5] = this.replaceAll(data[5],"[s2;]",'\''); + data[5] = this.replaceAll(data[5],"[s3;]",'<'); + data[5] = this.replaceAll(data[5],"[s4;]",'>'); + + + if ($.cookie('chatCfg2') != 0) { + data[5] = chat.testSmile(data[5]); + } + + if (data[6] != 'Black' && data[6] != '') { + msg += `${data[5]}`; + } else msg += data[5]; + + if(data[2] == 21) { + //e text + var text = `[loginfrom] ${data[5]}`; + var ftps = `${data[3]}`; + var mblogin = new RegExp("\\[login:(.*?)\\]",""); + text = text.replace('[loginfrom]',ftps); + if(text.match(mblogin)!=null) + { + mblogin = text.match(mblogin)[1]; + text = text.replace(`[login:${mblogin}]`,`${mblogin}`); + } + msg = `${text}`; + } + if(data[1]>0) + { + var td = new Date((parseInt(data[1]))*1000); + td = [td,null,null,null]; + td[1] = td[0].getHours(); + td[2] = td[0].getMinutes(); + td[3] = td[0].getSeconds(); + td[4] = td[0].getDay(); + td[5] = td[0].getMonth(); + td[6] = td[0].getYear(); + var j = 1; + while (j < 6) { + if (td[j] < 10) td[j] = `0${td[j]}`; + j++; + } + + var cls = forYou > 0 ? 'date2' : 'date' + if (data[11] > 0) { + msg = ` ! ${msg}`; + } + if (data[10] > 0) { + msg = ` G ${msg}`; + } + var msg22 = ' 0) { + msg22 += `oncontextmenu="chat.deleteMessage(${data[0]}); + return false;" `; + } + + // !!! + if( data[8] == 2 ) { + if( data[14] == undefined ) { + data[14] = '--:--'; + } + if( data[14] == '--:--' && data[1] > 0 ) { + data[14] = data[1]; + var date14 = new Date(data[14]*1000); + data[14] = `${date14.getHours()}:${date14.getMinutes()}`; + } + msg22 += `class="${cls}">${data[14]} `; + }else{ + if( data[13] == undefined ) { + data[13] = '--:--'; + } + if( data[13] == '--:--' && data[1] > 0 ) { + data[13] = data[1]; + var date13 = new Date(data[13]*1000); + data[13] = `${date13.getHours()}:${date13.getMinutes()}`; + } + msg22 += `class="${cls}">${data[13]} `; + } + msg = msg22+msg; + } + this.msgcount++; + msg = `${msg}
    `; - + if (forYou > 0 && this.sound > 0 && this.trim(data[3].toLowerCase()) != top.c.login.toLowerCase()) { this.sendSound(1); } - + if(msg_see == 1) { if(this.trim(data[3].toLowerCase()) == top.c.login.toLowerCase() || forYou == 1 || this.filter == 0) @@ -731,7 +731,7 @@ var chat = { this.feerverk( data[15] ); this.feerverk( data[15] ); } - + if( top.des == 1 ) { if( data[2] < 4 || global_type == 1 ) { // @@ -766,7 +766,7 @@ var chat = { v = i; i = -2; } - } + } else i = -2; i++; } @@ -838,7 +838,7 @@ var chat = { var p1 = new RegExp("private\\s*\\[(.*?)\\]", ""); var t1 = new RegExp("to\\s*\\[(.*?)\\]", ""); var newstr = ''; - + if (str.match(p1) != null) this.convert_work(p1) else if (str.match(t1) != null) this.convert_work(t1) @@ -847,24 +847,24 @@ var chat = { newstr += str; return newstr; }, - sendSound: function (s) { + sendSound: function (s) { var svolm = 100; if (this.sound == 0) svolm = 0 else if (this.sound == 1) svolm = 25; - else if (this.sound == 2) svolm = 100; + else if (this.sound == 2) svolm = 100; - var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1; - - if (isInternetExplorer && window.document["Sound"] && typeof window.document["Sound"].SetVariable !== "undefined") { - window.document["Sound"].SetVariable("Volume", svolm); - window.document["Sound"].SetVariable("Sndplay", s); - } + var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1; + + if (isInternetExplorer && window.document["Sound"] && typeof window.document["Sound"].SetVariable !== "undefined") { + window.document["Sound"].SetVariable("Volume", svolm); + window.document["Sound"].SetVariable("Sndplay", s); + } else if(document.getElementById('Sound2') && typeof document.getElementById('Sound2').SetVariable !== "undefined") { - document.getElementById('Sound2').SetVariable("Volume", svolm); - document.getElementById('Sound2').SetVariable("Sndplay", s); - } - - }, + document.getElementById('Sound2').SetVariable("Volume", svolm); + document.getElementById('Sound2').SetVariable("Sndplay", s); + } + + }, getSwf:function(val) { var M$ = navigator.appName.indexOf("Microsoft")!=-1 return (M$ ? window : document)[val] @@ -920,11 +920,11 @@ var chat = { } // JS if (data.js != '') eval(data.js); - if(data.rnd!=undefined) c.rnd = data.rnd; + if(data.rnd!=undefined) c.rnd = data.rnd; if (data.rn != undefined) { if ($('#chcf10').attr('checked') == true) { $('#roomName').html(`${data.rn}
    : ${data.xu}`); - } + } else $('#roomName').html(`${data.rn} (${data.xu})`); } if(data.key!=undefined) this.key = data.key; diff --git a/page/lib.php b/page/lib.php index 1046c654..1f4872c9 100644 --- a/page/lib.php +++ b/page/lib.php @@ -91,7 +91,7 @@ if( !isset($url[2]) || $url[2] == '' ) { }else{ if( isset($_FILES['filename']) ) { - include('html/class.upload.php'); + require_once('html/class.upload.php'); $handle = new upload($_FILES['filename']); $count = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `uid` = "'.$u->info['id'].'" AND `time` > '.(time()-60).' LIMIT 1')); if( $count > 3 && $u->info['admin'] == 0 ) { diff --git a/quest_dlg_edit.php b/quest_dlg_edit.php index f9036c3f..b29fc00e 100644 --- a/quest_dlg_edit.php +++ b/quest_dlg_edit.php @@ -1,4 +1,5 @@ info['admin'] > 0 ) { - - $itm = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_dlg` WHERE `id` = "'.mysql_real_escape_string($_GET['pid']).'" LIMIT 1')); - if(isset($itm['id'])) { - if($itm['qid'] == 0) { - if(isset($_POST['newdata'])) { - mysql_query('UPDATE `dungeon_dlg` SET `text` = "'.mysql_real_escape_string($_POST['newdata']).'" WHERE `id` = "'.mysql_real_escape_string($itm['id']).'" LIMIT 1'); - die(''); - }elseif(isset($_GET['delete']) && $_GET['delete'] == 'true') { - // - mysql_query('DELETE FROM `dungeon_dlg` WHERE `id` = "'.mysql_real_escape_string($itm['id']).'" LIMIT 1'); - // - mysql_query('DELETE FROM `dungeon_dlg` WHERE `qid` = "'.mysql_real_escape_string($itm['id']).'"'); - die(''); - } - echo '
    : '.$itm['id'].'

    '; - }else{ - if(isset($_POST['newdata'])) { - mysql_query('UPDATE `dungeon_dlg` SET `text` = "'.mysql_real_escape_string($_POST['newdata']).'",`action` = "'.mysql_real_escape_string($_POST['newdata2']).'",`tr` = "'.mysql_real_escape_string($_POST['newdata3']).'",`sort` = "'.mysql_real_escape_string((int)$_POST['newdata4']).'" WHERE `id` = "'.mysql_real_escape_string($itm['id']).'" LIMIT 1'); - die(''); - }elseif(isset($_GET['delete']) && $_GET['delete'] == 'true') { - // - mysql_query('DELETE FROM `dungeon_dlg` WHERE `id` = "'.mysql_real_escape_string($itm['id']).'" LIMIT 1'); - die(''); - } - echo '
    : '.$itm['id'].'

    :
    :
    :
    '; - } - }else{ - echo ' .'; - } +if ($u->info['admin'] <= 0) { + return; +} + +$itm = mysql_fetch_array( + mysql_query('SELECT * FROM `dungeon_dlg` WHERE `id` = "' . mysql_real_escape_string($_GET['pid']) . '" LIMIT 1') +); +if (isset($itm['id'])) { + if ($itm['qid'] == 0) { + if (isset($_POST['newdata'])) { + mysql_query( + 'UPDATE `dungeon_dlg` SET `text` = "' . mysql_real_escape_string( + $_POST['newdata'] + ) . '" WHERE `id` = "' . mysql_real_escape_string($itm['id']) . '" LIMIT 1' + ); + die(''); + } elseif (isset($_GET['delete']) && $_GET['delete'] == 'true') { + // + mysql_query( + 'DELETE FROM `dungeon_dlg` WHERE `id` = "' . mysql_real_escape_string($itm['id']) . '" LIMIT 1' + ); + // + mysql_query('DELETE FROM `dungeon_dlg` WHERE `qid` = "' . mysql_real_escape_string($itm['id']) . '"'); + die(''); + } + echo '
    : ' . $itm['id'] . '

    '; + } else { + if (isset($_POST['newdata'])) { + mysql_query( + 'UPDATE `dungeon_dlg` SET `text` = "' . mysql_real_escape_string( + $_POST['newdata'] + ) . '",`action` = "' . mysql_real_escape_string( + $_POST['newdata2'] + ) . '",`tr` = "' . mysql_real_escape_string( + $_POST['newdata3'] + ) . '",`sort` = "' . mysql_real_escape_string( + (int)$_POST['newdata4'] + ) . '" WHERE `id` = "' . mysql_real_escape_string($itm['id']) . '" LIMIT 1' + ); + die(''); + } elseif (isset($_GET['delete']) && $_GET['delete'] == 'true') { + // + mysql_query( + 'DELETE FROM `dungeon_dlg` WHERE `id` = "' . mysql_real_escape_string($itm['id']) . '" LIMIT 1' + ); + die(''); + } + echo '
    : ' . $itm['id'] . '

    :
    :
    :
    '; + } +} else { + echo ' .'; } - -?> \ No newline at end of file diff --git a/recaptchalib.php b/recaptchalib.php index 7b7992c6..c79d0db5 100644 --- a/recaptchalib.php +++ b/recaptchalib.php @@ -1,129 +1,135 @@ -" . self::$_signupUrl . ""); - } - $this->_secret=$secret; - } - /** - * Encodes the given data into a query string format. - * - * @param array $data array of string elements to be encoded. - * - * @return string - encoded request. - */ - private function _encodeQS($data) - { - $req = ""; - foreach ($data as $key => $value) { - $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; - } - // Cut the last '&' - $req=substr($req, 0, strlen($req)-1); - return $req; - } - /** - * Submits an HTTP GET to a reCAPTCHA server. - * - * @param string $path url path to recaptcha server. - * @param array $data array of parameters to be sent. - * - * @return array response - */ - private function _submitHTTPGet($path, $data) - { - $req = $this->_encodeQS($data); - $response = file_get_contents($path . $req); - return $response; - } - /** - * Calls the reCAPTCHA siteverify API to verify whether the user passes - * CAPTCHA test. - * - * @param string $remoteIp IP address of end user. - * @param string $response response string from recaptcha verification. - * - * @return ReCaptchaResponse - */ - public function verifyResponse($remoteIp, $response) - { - // Discard empty solution submissions - if ($response == null || strlen($response) == 0) { - $recaptchaResponse = new ReCaptchaResponse(); - $recaptchaResponse->success = false; - $recaptchaResponse->errorCodes = 'missing-input'; - return $recaptchaResponse; - } - $getResponse = $this->_submitHttpGet( - self::$_siteVerifyUrl, - array ( - 'secret' => $this->_secret, - 'remoteip' => $remoteIp, - 'v' => self::$_version, - 'response' => $response - ) - ); - $answers = json_decode($getResponse, true); - $recaptchaResponse = new ReCaptchaResponse(); - if (trim($answers ['success']) == true) { - $recaptchaResponse->success = true; - } else { - $recaptchaResponse->success = false; - $recaptchaResponse->errorCodes = $answers [error-codes]; - } - return $recaptchaResponse; - } -} -?> \ No newline at end of file +" . self::$_signupUrl . "" + ); + } + $this->_secret = $secret; + } + + /** + * Encodes the given data into a query string format. + * + * @param array $data array of string elements to be encoded. + * + * @return string - encoded request. + */ + private function _encodeQS($data) + { + $req = ""; + foreach ($data as $key => $value) { + $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; + } + // Cut the last '&' + $req = substr($req, 0, strlen($req) - 1); + return $req; + } + + /** + * Submits an HTTP GET to a reCAPTCHA server. + * + * @param string $path url path to recaptcha server. + * @param array $data array of parameters to be sent. + * + * @return array response + */ + private function _submitHTTPGet($path, $data) + { + $req = $this->_encodeQS($data); + return file_get_contents($path . $req); + } + + /** + * Calls the reCAPTCHA siteverify API to verify whether the user passes + * CAPTCHA test. + * + * @param string $remoteIp IP address of end user. + * @param string $response response string from recaptcha verification. + * + * @return ReCaptchaResponse + */ + public function verifyResponse($remoteIp, $response) + { + // Discard empty solution submissions + if ($response == null || strlen($response) == 0) { + $recaptchaResponse = new ReCaptchaResponse(); + $recaptchaResponse->success = false; + $recaptchaResponse->errorCodes = 'missing-input'; + return $recaptchaResponse; + } + $getResponse = $this->_submitHttpGet( + self::$_siteVerifyUrl, + [ + 'secret' => $this->_secret, + 'remoteip' => $remoteIp, + 'v' => self::$_version, + 'response' => $response, + ] + ); + $answers = json_decode($getResponse, true); + $recaptchaResponse = new ReCaptchaResponse(); + if (trim($answers ['success'])) { + $recaptchaResponse->success = true; + } else { + $recaptchaResponse->success = false; + $recaptchaResponse->errorCodes = $answers [error - codes]; + } + return $recaptchaResponse; + } +} diff --git a/recovery.php b/recovery.php index 136047d1..9a762817 100644 --- a/recovery.php +++ b/recovery.php @@ -1,106 +1,115 @@ info['id']) || $u->info['admin'] == 0) { +if(!$u->info['admin']) { header('location: https://new-combats.com/'); die(); } -// $_GET['id'] = (int)$_GET['id']; $_GET['exp'] = (int)$_GET['exp']; -// $us = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.mysql_real_escape_string($_GET['id']).'" LIMIT 1')); -if( !isset($us['id']) ) { - -}else{ - $st = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "'.mysql_real_escape_string($us['id']).'" LIMIT 1')); - $lvl = mysql_fetch_array(mysql_query('SELECT * FROM `levels` WHERE `upLevel` = "'.$st['upLevel'].'" LIMIT 1')); - $lvn = mysql_fetch_array(mysql_query('SELECT * FROM `levels` WHERE `exp` <= "'.mysql_real_escape_string($_GET['exp']).'" ORDER BY `exp` DESC LIMIT 1')); - // - echo ': '.$us['login'].' ['.$us['level'].', :'.$st['upLevel'].']
    '.$_GET['exp'].' (: '.$lvn['nextLevel'].' , : '.$lvn['upLevel'].').
    '; - // - $r = array( 0 , 0 , 0 , 0 , 0 , 0 ); - // - $sp = mysql_query('SELECT * FROM `levels` WHERE `upLevel` <= '.$st['upLevel'].' AND `upLevel` > '.$lvn['upLevel'].''); - while( $pl = mysql_fetch_array($sp) ) { - if(isset($pl['vinosl'])) { - $pl['vinos'] = $pl['vinosl']; - } - $r[0] -= $pl['ability']; - $r[1] -= $pl['skills']; - $r[2] -= $pl['nskills']; - $r[3] -= $pl['vinos']; - $r[4] -= $pl['duh']; - $r[5] -= $pl['money']; - } - // - $sts = $u->lookStats($st['stats']); - $nst = array( - 's1' => 3, - 's2' => 3, - 's3' => 3, - 's4' => 3, - 's5' => 0, - 's6' => 0, - 's7' => 0 - ); - // - $sp = mysql_query('SELECT * FROM `levels` WHERE `upLevel` <= '.$lvn['upLevel'].''); - while( $pl = mysql_fetch_array($sp) ) { - if(isset($pl['vinosl'])) { - $pl['vinos'] = $pl['vinosl']; - } - $nst['s4'] += $pl['vinos']; - $nst['s7'] += $pl['duh']; - $nst['a'] += $pl['ability']; - $nst['s'] += $pl['skills']; - $nst['n'] += $pl['nskills']; - } - // - $rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$us['id'].'" LIMIT 1')); - $nst['a'] += $rep['add_stats']; - $nst['s'] += $rep['add_skills']; - $nst['n'] += $rep['add_skills2']; - // - echo '
    : '.($lvn['nextLevel']-$us['level']).'
    '; - echo '
    : '. $r[0]; - echo '
    : '. $r[1]; - echo '
    : '. $r[2]; - echo '
    : '. $r[3]; - echo '
    : '. $r[4]; - echo '
    : '. $r[5]; - echo '
    '; - // - echo '
    '; - // - $stt = 's7='.$nst['s7'].'|s1=3|s2=3|s3=3|s4='.$nst['s4'].'|s5=0|s6=0|s8=0|s9=0|s10=0|s11=0|a1=0|mg1=0|a2=0|mg2=0|a3=0|mg3=0|a4=10|mg4=0|a5=0|mg5=0|a6=0|mg6=0|a7=0|mg7=0|os1=0|os2=0|os3=0|os4=0|os5=0|os6=0|os7=0|os8=0|os9=0|os10=0|os11=0|s12=0|s13=0|s14=0|s15=0'; - echo $stt; - print_r($nst); - // - if(isset($_GET['good'])) { - // - mysql_query('UPDATE `users` SET `level` = "'.$lvn['nextLevel'].'" , `money` = "'.($us['money'] + $r['5']).'" WHERE `id` = "'.$us['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET - - `stats` = "'.$stt.'", - `upLevel` = "'.$lvn['upLevel'].'", - `ability` = "'.$nst['a'].'", - `skills` = "'.$nst['s'].'", - `nskills` = "'.$nst['n'].'", - `exp` = "'.mysql_real_escape_string($_GET['exp']).'" - - WHERE `id` = "'.$us['id'].'" LIMIT 1'); - // - }else{ - echo '
    !'; - } - // +if(!isset($us['id'])) { + return; +} +$st = mysql_fetch_array( + mysql_query('SELECT * FROM `stats` WHERE `id` = "' . mysql_real_escape_string($us['id']) . '" LIMIT 1') +); +$lvl = mysql_fetch_array(mysql_query('SELECT * FROM `levels` WHERE `upLevel` = "' . $st['upLevel'] . '" LIMIT 1')); +$lvn = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `levels` WHERE `exp` <= "' . mysql_real_escape_string( + $_GET['exp'] + ) . '" ORDER BY `exp` DESC LIMIT 1' + ) +); +// +echo ': ' . $us['login'] . ' [' . $us['level'] . ', :' . $st['upLevel'] . ']
    ' . $_GET['exp'] . ' (: ' . $lvn['nextLevel'] . ' , : ' . $lvn['upLevel'] . ').
    '; +// +$r = [0, 0, 0, 0, 0, 0]; +// +$sp = mysql_query( + 'SELECT * FROM `levels` WHERE `upLevel` <= ' . $st['upLevel'] . ' AND `upLevel` > ' . $lvn['upLevel'] . '' +); +while ($pl = mysql_fetch_array($sp)) { + if (isset($pl['vinosl'])) { + $pl['vinos'] = $pl['vinosl']; + } + $r[0] -= $pl['ability']; + $r[1] -= $pl['skills']; + $r[2] -= $pl['nskills']; + $r[3] -= $pl['vinos']; + $r[4] -= $pl['duh']; + $r[5] -= $pl['money']; +} +// +$sts = $u->lookStats($st['stats']); +$nst = [ + 's1' => 3, + 's2' => 3, + 's3' => 3, + 's4' => 3, + 's5' => 0, + 's6' => 0, + 's7' => 0 +]; +// +$sp = mysql_query('SELECT * FROM `levels` WHERE `upLevel` <= ' . $lvn['upLevel'] . ''); +while ($pl = mysql_fetch_array($sp)) { + if (isset($pl['vinosl'])) { + $pl['vinos'] = $pl['vinosl']; + } + $nst['s4'] += $pl['vinos']; + $nst['s7'] += $pl['duh']; + $nst['a'] += $pl['ability']; + $nst['s'] += $pl['skills']; + $nst['n'] += $pl['nskills']; +} +// +$rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "' . $us['id'] . '" LIMIT 1')); +$nst['a'] += $rep['add_stats']; +$nst['s'] += $rep['add_skills']; +$nst['n'] += $rep['add_skills2']; +// +echo '
    : ' . ($lvn['nextLevel'] - $us['level']) . '
    '; +echo '
    : ' . $r[0]; +echo '
    : ' . $r[1]; +echo '
    : ' . $r[2]; +echo '
    : ' . $r[3]; +echo '
    : ' . $r[4]; +echo '
    : ' . $r[5]; +echo '
    '; +// +echo '
    '; +// +$stt = 's7=' . $nst['s7'] . '|s1=3|s2=3|s3=3|s4=' . $nst['s4'] . '|s5=0|s6=0|s8=0|s9=0|s10=0|s11=0|a1=0|mg1=0|a2=0|mg2=0|a3=0|mg3=0|a4=10|mg4=0|a5=0|mg5=0|a6=0|mg6=0|a7=0|mg7=0|os1=0|os2=0|os3=0|os4=0|os5=0|os6=0|os7=0|os8=0|os9=0|os10=0|os11=0|s12=0|s13=0|s14=0|s15=0'; +echo $stt; +print_r($nst); +// +if (isset($_GET['good'])) { + // + mysql_query( + 'UPDATE `users` SET `level` = "' . $lvn['nextLevel'] . '" , `money` = "' . ($us['money'] + $r['5']) . '" WHERE `id` = "' . $us['id'] . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `stats` SET + + `stats` = "' . $stt . '", + `upLevel` = "' . $lvn['upLevel'] . '", + `ability` = "' . $nst['a'] . '", + `skills` = "' . $nst['s'] . '", + `nskills` = "' . $nst['n'] . '", + `exp` = "' . mysql_real_escape_string($_GET['exp']) . '" + + WHERE `id` = "' . $us['id'] . '" LIMIT 1' + ); + // +} else { + echo '
    !'; } -?> \ No newline at end of file diff --git a/reg.php b/reg.php index fcee65b4..f8566f85 100644 --- a/reg.php +++ b/reg.php @@ -1,333 +1,349 @@ info['id']) && $u->info['bithday'] == '01.01.1800') { - // - $_POST['reg_login'] = iconv('UTF-8', 'windows-1251', $_POST['reg_login']); - // - $reg_d = array( - 0 => $_POST['reg_login'], - 1 => $_POST['reg_pass'], - 2 => $_POST['reg_pass2'], - 3 => $_POST['reg_mail'], - 7 => $_POST['reg_dd'], - 8 => $_POST['reg_mm'], - 9 => $_POST['reg_yy'], - 15 => $_POST['reg_sex'] - ); - // - $error = ''; - // - // - $nologin = array(0=>'',1=>'angel',2=>'',3=>'administration',4=>'',5=>'',6=>'',7=>'',8=>'',9=>'',10=>'',11=>'',12=>' ',13=>'',14=>'',15=>'',16=>'',17=>'coombats',18=>' ',19=>' _'); - $blacklist = "!@#$%^&*()\+|/'`\""; - $sr = '_-1234567890'; - $i = 0; - while($imystr($reg_d[0]))) - { - $error = ', , .
    '; $_POST['step'] = 1; $i = count($nologin); - } - $i++; - } - $reg_d[0] = str_replace(' ',' ',$reg_d[0]); - // 2 20 - if(strlen($reg_d[0])>20) - { - $error = ' 20 .
    '; $_POST['step'] = 1; - } - if(strlen($reg_d[0])<2) - { - $error = ' 2 .
    '; $_POST['step'] = 1; - } - // - $er = $r->en_ru($reg_d[0]); - if($er==true) - { - $error = ' . .
    '; $_POST['step'] = 1; - } - // - if(strpos($sr,$reg_d[0])) - { - $error = ' .
    '; $_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')); - $log3 = mysql_fetch_array(mysql_query('SELECT `id` from `test_bot` where `login`="'.mysql_real_escape_string($reg_d[0]).'" OR `login` LIKE "'.mysql_real_escape_string($reg_d[0]).' [%]" LIMIT 1')); - - if(isset($log['id']) || isset($log2['id']) || isset($log3['id'])) - { - $error = ' '.$reg_d[0].' , .
    '; $_POST['step'] = 1; - } - // - if(substr_count($reg_d[0],' ')+substr_count($reg_d[0],'-')+substr_count($reg_d[0],'_')>2) - { - $error = ' (, , ).
    '; $_POST['step'] = 1; - } - $reg_d[0] = trim($reg_d[0],' '); - - // - if(strlen($reg_d[1])<6 || strlen($reg_d[1])>30) - { - $error = ' 6 30 .
    '; $_POST['step'] = 2; - } - if($reg_d[1]!=$reg_d[2]) - { - $error = ' , . , .
    '; $_POST['step'] = 2; - } - if(preg_match('/'.$reg_d[0].'/i',$reg_d[1])) - { - $error = ' .
    '; $_POST['step'] = 2; - } - if( $reg_d[1] != $reg_d[2] ) { - $error = ' .
    '; $_POST['step'] = 2; - } - if($_POST['step']!=2) - { - $stp = 3; $noup = 0; - } - // e-mail - if(strlen($reg_d[3])<6 || strlen($reg_d[3])>50) - { - $error = 'E-mail 6- 50-.
    '; $_POST['step'] = 3; - } - - if(!preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $reg_d[3])) - { - $error = ' E-mail.
    '; $_POST['step'] = 3; - } - - if( $_POST['mail_post'] != 'true' ) { - $error = ' E-mail'; - } - - $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; - } - - $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 = ' .
    '; $_POST['step'] = 4; - } - - if($reg_d[15]!=1 && $reg_d[15]!=2) - { - $error = ' .
    '; $_POST['step'] = 4; - } - - if( $error == '' ) { - if( $reg_d[15] != 2 ) { - $reg_d[15] = 0; - }else{ - $reg_d[15] = 1; - } - 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']); - mysql_query('UPDATE `users` SET - `login` = "'.mysql_real_escape_string($reg_d[0]).'", +if (isset($_POST['ajax_reg'])) { + $u = User::start(); + if (isset($u->info['id']) && $u->info['bithday'] == '01.01.1800') { + // + $_POST['reg_login'] = iconv('UTF-8', 'windows-1251', $_POST['reg_login']); + // + $reg_d = [0 => $_POST['reg_login'], 1 => $_POST['reg_pass'], 2 => $_POST['reg_pass2'], 3 => $_POST['reg_mail'], 7 => $_POST['reg_dd'], 8 => $_POST['reg_mm'], 9 => $_POST['reg_yy'], 15 => $_POST['reg_sex']]; + // + $error = ''; + // + // + $nologin = [0 => '', 1 => 'angel', 2 => '', 3 => 'administration', 4 => '', 5 => '', 6 => '', 7 => '', 8 => '', 9 => '', 10 => '', 11 => '', 12 => ' ', 13 => '', 14 => '', 15 => '', 16 => '', 17 => 'coombats', 18 => ' ', 19 => ' _']; + $blacklist = "!@#$%^&*()\+|/'`\""; + $sr = '_-1234567890'; + $i = 0; + while ($i < count($nologin)) { + if (preg_match("/" . $nologin[$i] . "/i", $filter->mystr($reg_d[0]))) { + $error = ', , .
    '; + $_POST['step'] = 1; + $i = count($nologin); + } + $i++; + } + $reg_d[0] = str_replace(' ', ' ', $reg_d[0]); + // 2 20 + if (strlen($reg_d[0]) > 20) { + $error = ' 20 .
    '; + $_POST['step'] = 1; + } + if (strlen($reg_d[0]) < 2) { + $error = ' 2 .
    '; + $_POST['step'] = 1; + } + // + $er = $r->en_ru($reg_d[0]); + if ($er) { + $error = ' . .
    '; + $_POST['step'] = 1; + } + // + if (strpos($sr, $reg_d[0])) { + $error = ' .
    '; + $_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' + ) + ); + $log3 = mysql_fetch_array( + mysql_query( + 'SELECT `id` from `test_bot` where `login`="' . mysql_real_escape_string( + $reg_d[0] + ) . '" OR `login` LIKE "' . mysql_real_escape_string($reg_d[0]) . ' [%]" LIMIT 1' + ) + ); + + if (isset($log['id']) || isset($log2['id']) || isset($log3['id'])) { + $error = ' ' . $reg_d[0] . ' , .
    '; + $_POST['step'] = 1; + } + // + if (substr_count($reg_d[0], ' ') + substr_count($reg_d[0], '-') + substr_count($reg_d[0], '_') > 2) { + $error = ' (, , ).
    '; + $_POST['step'] = 1; + } + $reg_d[0] = trim($reg_d[0], ' '); + + // + if (strlen($reg_d[1]) < 6 || strlen($reg_d[1]) > 30) { + $error = ' 6 30 .
    '; + $_POST['step'] = 2; + } + if ($reg_d[1] != $reg_d[2]) { + $error = ' , . , .
    '; + $_POST['step'] = 2; + } + if (preg_match('/' . $reg_d[0] . '/i', $reg_d[1])) { + $error = ' .
    '; + $_POST['step'] = 2; + } + if ($reg_d[1] != $reg_d[2]) { + $error = ' .
    '; + $_POST['step'] = 2; + } + if ($_POST['step'] != 2) { + $stp = 3; + $noup = 0; + } + // e-mail + if (strlen($reg_d[3]) < 6 || strlen($reg_d[3]) > 50) { + $error = 'E-mail 6- 50-.
    '; + $_POST['step'] = 3; + } + + if (!preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $reg_d[3])) { + $error = ' E-mail.
    '; + $_POST['step'] = 3; + } + + if ($_POST['mail_post'] != 'true') { + $error = ' E-mail'; + } + + $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; + } + + $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 = ' .
    '; + $_POST['step'] = 4; + } + + if ($reg_d[15] != 1 && $reg_d[15] != 2) { + $error = ' .
    '; + $_POST['step'] = 4; + } + + if ($error == '') { + if ($reg_d[15] != 2) { + $reg_d[15] = 0; + } else { + $reg_d[15] = 1; + } + 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']); + mysql_query( + 'UPDATE `users` SET + `login` = "' . mysql_real_escape_string($reg_d[0]) . '", `activ` = "1", - `pass` = "'.mysql_real_escape_string(md5($reg_d[1])).'", - `mail` = "'.mysql_real_escape_string($reg_d[3]).'", - `bithday` = "'.mysql_real_escape_string($reg_d[7].'.'.$reg_d[8].'.'.$reg_d[9]).'", - `sex` = "'.mysql_real_escape_string($reg_d[15]).'", + `pass` = "' . mysql_real_escape_string(md5($reg_d[1])) . '", + `mail` = "' . mysql_real_escape_string($reg_d[3]) . '", + `bithday` = "' . mysql_real_escape_string($reg_d[7] . '.' . $reg_d[8] . '.' . $reg_d[9]) . '", + `sex` = "' . mysql_real_escape_string($reg_d[15]) . '", `fnq` = "0" - WHERE `id` = "'.mysql_real_escape_string($u->info['id']).'" LIMIT 1'); - - if( $u->info['host_reg'] > 0 ) { - $refer = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "'.$u->info['host_reg'].'" LIMIT 1')); - if( isset($refer['id']) ) { - $u->addItem(3199,$u->info['id']); - $u->addItem(4005,$refer['id']); - }else{ - $u->addItem(3199,$u->info['id']); - $nast = 1001398; - mysql_query('UPDATE `users` SET - `host_reg` = "'.$nast.'" - WHERE `id` = "'.mysql_real_escape_string($u->info['id']).'" LIMIT 1'); - } - }else{ - $u->addItem(3199,$u->info['id']); - $nast = 1001398; - mysql_query('UPDATE `users` SET - `host_reg` = "'.$nast.'" - WHERE `id` = "'.mysql_real_escape_string($u->info['id']).'" LIMIT 1'); - } - - // // // // - - $text = ''.$reg_d[0].', , - www.new-combats.com/library/noobguide '; - mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','6','0','1')"); - /* $text = ' . , . >> , " ", +300 000 , 8 , . , , , : +15, , -- , 99% , ! , . , : ( events.new-combats.com ). , '; - mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','6','0','1')"); - */ - - $refer = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`banned`,`admin`,`level` FROM `users` WHERE `id` = "'.mysql_real_escape_string($_GET['ref']).'" LIMIT 1')); - if(isset($refer['id'])) { - mysql_query("INSERT INTO `items_users` (`gift`,`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$refer['login']."','".$u->info['id']."','3199','noodet=1|items_in_file=sunduk_new|var_id=1|open=1|noremont=1|nodelete=1|nosale=1|sudba=".mysql_real_escape_string($reg_d[0])."',1,2,'capitalcity',".time().")"); - } - - // - $re = $u->addItem(1,$u->info['id'],'|'); - if( $re > 0 ) { - mysql_query('UPDATE `items_users` SET `gift` = "" WHERE `id` = "'.$re.'" LIMIT 1'); - } - // - $re = $u->addItem(73,$u->info['id'],'|'); - if( $re > 0 ) { - mysql_query('UPDATE `items_users` SET `gift` = "" WHERE `id` = "'.$re.'" LIMIT 1'); - } - $re = $u->addItem(2133,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1|srok='.(86400*14).''); - if( $re > 0 ) { - mysql_query('UPDATE `items_users` SET `gift` = "" WHERE `id` = "'.$re.'" LIMIT 1'); - } - // +300.000 - /*$re = $u->addItem(4014,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1|nodelete=1'); - if( $re > 0 ) { - mysql_query('UPDATE `items_users` SET `gift` = "" WHERE `id` = "'.$re.'" LIMIT 1'); - } - // - //$re = $u->addItem(1190,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1',NULL,0); - // - $re = $u->addItem(724,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1',NULL,50); - // - $re = $u->addItem(1463,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1',NULL,1); - // - $re = $u->addItem(1462,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1',NULL,1); - // - $re = $u->addItem(1461,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1',NULL,1); - // - $re = $u->addItem(4038,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1',NULL,1); - // - $re = $u->addItem(4039,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1',NULL,1); - // - $re = $u->addItem(4037,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1',NULL,1); - // - $re = $u->addItem(4040,$u->info['id'],'|sudba='.$reg_d[0].'|nosale=1',NULL,1); - */ - // // // // - - $error = ' ! !
    3 . !'; - } - - die( $error ); - } -}else{ + WHERE `id` = "' . mysql_real_escape_string($u->info['id']) . '" LIMIT 1' + ); - 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()); - - function error($e) - { - global $c; - die(''); - } - - if( isset($_COOKIE['login']) ) { - setcookie('login','',time()-60*60*24*30,'','.new-combats.com/'); - setcookie('pass','',time()-60*60*24*30,'','.new-combats.com/'); - // - setcookie('login','',time()-60*60*24*30); - setcookie('pass','',time()-60*60*24*30); - // - } - - $lr = mysql_fetch_array(mysql_query('SELECT `id`,`ipreg`,`pass`,`bithday`,`login` FROM `users` WHERE `cityreg`="capitalcity" AND `timereg`>"'.(time()-60*60*1).'" AND `ipreg` = "'.mysql_real_escape_string(IP).'" LIMIT 1')); - if(/*isset($_COOKIE['reg_capitalcity']) || (int)$_COOKIE['reg_capitalcity']>time() ||*/ isset($lr['id2'])) { - if( isset($lr['id']) && $lr['bithday'] == '01.01.1800' ) { - if( isset($_GET['enter']) ) { - setcookie('login',$lr['login'],time()+60*60*24*7,'',$c['host']); - setcookie('pass',$lr['pass'],time()+60*60*24*7,'',$c['host']); - header('location: /bk'); - } - error(' IP . IP , . .
    '.$lr['login'].' : '); - }else{ - error(' IP . IP , . .
    '); - } - }else{ - // - if( (int)$_GET['ref'] > 0 ) { - mysql_query("UPDATE `users` SET `referals` = `referals` + 1 WHERE `id` = '".mysql_real_escape_string((int)$_GET['ref'])."' LIMIT 1"); - } - $pass = md5(md5(rand(0,100.).'#'.rand(0,1000))); - mysql_query('INSERT INTO `users` (`host_reg`,`pass`,`ip`,`ipreg`,`city`,`cityreg`,`room`,`timereg`) VALUES ( - "'.mysql_real_escape_string(0+$_GET['ref']).'", - "'.mysql_real_escape_string($pass).'", - "'.mysql_real_escape_string(IP).'", - "'.mysql_real_escape_string(IP).'", + if ($u->info['host_reg'] > 0) { + $refer = mysql_fetch_array( + mysql_query('SELECT `id` FROM `users` WHERE `id` = "' . $u->info['host_reg'] . '" LIMIT 1') + ); + if (isset($refer['id'])) { + $u->addItem(3199, $u->info['id']); + $u->addItem(4005, $refer['id']); + } else { + $u->addItem(3199, $u->info['id']); + $nast = 1001398; + mysql_query( + 'UPDATE `users` SET + `host_reg` = "' . $nast . '" + WHERE `id` = "' . mysql_real_escape_string($u->info['id']) . '" LIMIT 1' + ); + } + } else { + $u->addItem(3199, $u->info['id']); + $nast = 1001398; + mysql_query( + 'UPDATE `users` SET + `host_reg` = "' . $nast . '" + WHERE `id` = "' . mysql_real_escape_string($u->info['id']) . '" LIMIT 1' + ); + } + + // // // // + + $text = '' . $reg_d[0] . ', , - www.new-combats.com/library/noobguide '; + mysql_query( + "INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','','" . $reg_d[0] . "','" . $text . "','" . time( + ) . "','6','0','1')" + ); + $refer = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`login`,`banned`,`admin`,`level` FROM `users` WHERE `id` = "' . mysql_real_escape_string( + $_GET['ref'] + ) . '" LIMIT 1' + ) + ); + if (isset($refer['id'])) { + mysql_query( + "INSERT INTO `items_users` (`gift`,`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('" . $refer['login'] . "','" . $u->info['id'] . "','3199','noodet=1|items_in_file=sunduk_new|var_id=1|open=1|noremont=1|nodelete=1|nosale=1|sudba=" . mysql_real_escape_string( + $reg_d[0] + ) . "',1,2,'capitalcity'," . time() . ")" + ); + } + + // + $re = $u->addItem(1, $u->info['id'], '|'); + if ($re > 0) { + mysql_query('UPDATE `items_users` SET `gift` = "" WHERE `id` = "' . $re . '" LIMIT 1'); + } + // + $re = $u->addItem(73, $u->info['id'], '|'); + if ($re > 0) { + mysql_query('UPDATE `items_users` SET `gift` = "" WHERE `id` = "' . $re . '" LIMIT 1'); + } + $re = $u->addItem(2133, $u->info['id'], '|sudba=' . $reg_d[0] . '|nosale=1|srok=' . (86400 * 14) . ''); + if ($re > 0) { + mysql_query('UPDATE `items_users` SET `gift` = "" WHERE `id` = "' . $re . '" LIMIT 1'); + } + $error = ' ! !
    3 . !'; + } + + die($error); + } +} else { + + function error($e) + { + exit($e); + } + + if (isset($_COOKIE['login'])) { + setcookie('login', '', time() - 60 * 60 * 24 * 30, '', '.new-combats.com/'); + setcookie('pass', '', time() - 60 * 60 * 24 * 30, '', '.new-combats.com/'); + // + setcookie('login', '', time() - 60 * 60 * 24 * 30); + setcookie('pass', '', time() - 60 * 60 * 24 * 30); + // + } + + $lr = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`ipreg`,`pass`,`bithday`,`login` FROM `users` WHERE `cityreg`="capitalcity" AND `timereg`>"' . (time( + ) - 60 * 60 * 1) . '" AND `ipreg` = "' . mysql_real_escape_string(IP) . '" LIMIT 1' + ) + ); + if (isset($lr['id2'])) { + if (isset($lr['id']) && $lr['bithday'] == '01.01.1800') { + if (isset($_GET['enter'])) { + setcookie('login', $lr['login'], time() + 60 * 60 * 24 * 7, '', $c['host']); + setcookie('pass', $lr['pass'], time() + 60 * 60 * 24 * 7, '', $c['host']); + header('location: /bk'); + } + error( + ' IP . IP , . .
    ' . $lr['login'] . ' : ' + ); + } else { + error( + ' IP . IP , . .
    ' + ); + } + } else { + // + if ((int)$_GET['ref'] > 0) { + mysql_query( + "UPDATE `users` SET `referals` = `referals` + 1 WHERE `id` = '" . mysql_real_escape_string( + (int)$_GET['ref'] + ) . "' LIMIT 1" + ); + } + $pass = md5(md5(rand(0, 100.) . '#' . rand(0, 1000))); + mysql_query( + 'INSERT INTO `users` (`host_reg`,`pass`,`ip`,`ipreg`,`city`,`cityreg`,`room`,`timereg`) VALUES ( + "' . mysql_real_escape_string(0 + $_GET['ref']) . '", + "' . mysql_real_escape_string($pass) . '", + "' . mysql_real_escape_string(IP) . '", + "' . mysql_real_escape_string(IP) . '", "capitalcity", "capitalcity", "0", - "'.time().'" - )'); - $uid = mysql_insert_id(); - if( $uid > 0 ) { - $login = ''.$uid; - mysql_query('UPDATE `users` SET `login` = "'.mysql_real_escape_string($login).'" WHERE `id` = "'.$uid.'" LIMIT 1'); - // - 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')"); - - // - $ipm1 = mysql_fetch_array(mysql_query('SELECT * FROM `logs_auth` WHERE `uid` = "'.mysql_real_escape_string($uid).'" AND `ip`!="'.mysql_real_escape_string(IP).'" ORDER BY `id` ASC LIMIT 1')); - $ppl = mysql_query('SELECT * FROM `logs_auth` WHERE `ip`!="" AND (`ip` = "'.mysql_real_escape_string(IP).'" OR `ip`="'.mysql_real_escape_string($ipm1['ip']).'" OR `ip`="'.mysql_real_escape_string($_COOKIE['ip']).'")'); - while($spl = mysql_fetch_array($ppl)) - { - $ml = mysql_fetch_array(mysql_query('SELECT `id` FROM `mults` WHERE (`uid` = "'.$spl['uid'].'" AND `uid2` = "'.$uid.'") OR (`uid2` = "'.$spl['uid'].'" AND `uid` = "'.$uid.'") LIMIT 1')); - if(!isset($ml['id']) && $spl['ip']!='' && $spl['ip']!='127.0.0.1') - { - mysql_query('INSERT INTO `mults` (`uid`,`uid2`,`ip`) VALUES ("'.$uid.'","'.$spl['uid'].'","'.$spl['ip'].'")'); - } - } - mysql_query("INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('".$uid."','".mysql_real_escape_string(IP)."','".mysql_real_escape_string($_SERVER['HTTP_USER_AGENT'])."','1','".time()."','')"); - - // - mysql_query("UPDATE `users` SET `online`='".time()."',`ip` = '".mysql_real_escape_string(IP)."' WHERE `uid` = '".$uid."' LIMIT 1"); - - if(!setcookie('login',$login, (time()+60*60*24*7) , '' , '.new-combats.com' ) || !setcookie('pass',$pass, (time()+60*60*24*7) , '' , '.new-combats.com' )) { - die(' cookie.'); - }else{ - /* - die(' !
    '); - */ - } - header('location: /bk'); - } - } -} + "' . time() . '" + )' + ); + $uid = mysql_insert_id(); + if ($uid > 0) { + $login = '' . $uid; + mysql_query( + 'UPDATE `users` SET `login` = "' . mysql_real_escape_string( + $login + ) . '" WHERE `id` = "' . $uid . '" LIMIT 1' + ); + // + 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')" + ); -?> \ No newline at end of file + // + $ipm1 = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `logs_auth` WHERE `uid` = "' . mysql_real_escape_string( + $uid + ) . '" AND `ip`!="' . mysql_real_escape_string(IP) . '" ORDER BY `id` ASC LIMIT 1' + ) + ); + $ppl = mysql_query( + 'SELECT * FROM `logs_auth` WHERE `ip`!="" AND (`ip` = "' . mysql_real_escape_string( + IP + ) . '" OR `ip`="' . mysql_real_escape_string($ipm1['ip']) . '" OR `ip`="' . mysql_real_escape_string( + $_COOKIE['ip'] + ) . '")' + ); + while ($spl = mysql_fetch_array($ppl)) { + $ml = mysql_fetch_array( + mysql_query( + 'SELECT `id` FROM `mults` WHERE (`uid` = "' . $spl['uid'] . '" AND `uid2` = "' . $uid . '") OR (`uid2` = "' . $spl['uid'] . '" AND `uid` = "' . $uid . '") LIMIT 1' + ) + ); + if (!isset($ml['id']) && $spl['ip'] != '' && $spl['ip'] != '127.0.0.1') { + mysql_query( + 'INSERT INTO `mults` (`uid`,`uid2`,`ip`) VALUES ("' . $uid . '","' . $spl['uid'] . '","' . $spl['ip'] . '")' + ); + } + } + mysql_query( + "INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('" . $uid . "','" . mysql_real_escape_string( + IP + ) . "','" . mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']) . "','1','" . time() . "','')" + ); + + // + mysql_query( + "UPDATE `users` SET `online`='" . time() . "',`ip` = '" . mysql_real_escape_string( + IP + ) . "' WHERE `uid` = '" . $uid . "' LIMIT 1" + ); + + if (!setcookie('login', $login, (time() + 60 * 60 * 24 * 7), '', '.new-combats.com') || !setcookie( + 'pass', $pass, (time() + 60 * 60 * 24 * 7), '', '.new-combats.com' + )) { + die(' cookie.'); + } + header('location: /bk'); + } + } +} diff --git a/register.php b/register.php index 415ccf2f..3bd06691 100644 --- a/register.php +++ b/register.php @@ -1,9 +1,12 @@ - 'ангел', 1 => 'angel', 2 => 'администрация', 3 => 'administration', 4 => 'Комментатор', 5 => 'Мироздатель', 6 => 'Мусорщик', 7 => 'Падальщик', 8 => 'Повелитель', 9 => 'Архивариус', 10 => 'Пересмешник', 11 => 'Волынщик', 12 => 'Лорд Разрушитель', 13 => 'Милосердие', 14 => 'Справедливость', 15 => 'Искушение', 16 => 'Вознесение']; + $nologin = [ + 0 => '', + 1 => 'angel', + 2 => '', + 3 => 'administration', + 4 => '', + 5 => '', + 6 => '', + 7 => '', + 8 => '', + 9 => '', + 10 => '', + 11 => '', + 12 => ' ', + 13 => '', + 14 => '', + 15 => '', + 16 => '', + ]; $i = 0; while ($i < count($nologin)) { if (preg_match("/" . $nologin[$i] . "/i", $str_u)) { - $error = 'Выберите, пожалуйста, другой ник.'; + $error = ', , .'; $i = count($nologin); } $i++; } $str_u = str_replace(' ', ' ', $str_u); - //Логин от 4 до 20 символов + // 4 20 if (strlen($str_u) > 20) { - $error = 'Логин должен содержать не более 20 символов.'; - $error = $error . '
    Пример правильного никнейма: Петя Убиватор, Коля, xalop.
    Пример неправильного никнейма: )))), kolя)=-/.'; + $error = ' 20 .'; + $error = $error . '
    : , , xalop.
    : )))), kol)=-/.'; } if (strlen($str_u) < 4) { - $error = 'Логин должен содержать не менее 4 символов.'; - $error = $error . '
    Пример правильного никнейма: Петя Убиватор, Коля, xalop.
    Пример неправильного никнейма: )))), kolя)=-/.'; + $error = ' 4 .'; + $error = $error . '
    : , , xalop.
    : )))), kol)=-/.'; } - //Один алфавит + // $er = en_ru($str_u); if ($er) { - $error = 'В логине разрешено использовать только буквы одного алфавита русского или английского. Нельзя смешивать.'; - $error = $error . '
    Пример правильного никнейма: Петя Убиватор, Коля, xalop.
    Пример неправильного никнейма: )))), kolя)=-/.'; + $error = ' . .'; + $error = $error . '
    : , , xalop.
    : )))), kol)=-/.'; } - //Разделители + // if (substr_count($str_u, ' ') + substr_count($str_u, '-') + substr_count($str_u, '_') > 2) { - $error = 'Не более двух разделителей одновременно (пробел, тире, нижнее подчеркивание).'; - $error = $error . '
    Пример правильного никнейма: Петя Убиватор, Коля, xalop.
    Пример неправильного никнейма: )))), kolя)=-/.'; + $error = ' (, , ).'; + $error = $error . '
    : , , xalop.
    : )))), kol)=-/.'; } - //Персонажи в базе + // $q = mysql_query('SELECT `id` from `users` where `login`="' . mysql_real_escape_string($str_u) . '" LIMIT 1'); if ($q) { $log = mysql_fetch_array($q); @@ -111,27 +131,27 @@ function error_check($id, $str_u, $name = 0) unset($q); } if (isset($log['id']) || isset($log2['id'])) { - $error = 'Логин ' . $str_u . ' уже занят, выберите другой.'; + $error = ' ' . $str_u . ' , .'; } } - if ($id == 2 && !empty($str_u)) //проверка емаила + if ($id == 2 && !empty($str_u)) // { if (strlen($str_u) < 6 || strlen($str_u) > 50) { - $error = 'E-mail не может быть короче 6-х символов и длинее 50-ти.'; + $error = 'E-mail 6- 50-.'; } else { $testEREm = mysql_fetch_array(mysql_query('SELECT `mail` FROM `users` WHERE `mail` LIKE "' . $str_u . '" LIMIT 1')); $emails = mysql_fetch_array(mysql_query('SELECT * FROM `ban_email` WHERE `email` LIKE "' . $str_u . '" LIMIT 1')); if (isset($testEREm['mail'])) { - $error = 'E-mail уже занят.'; + $error = 'E-mail .'; } if (isset($emails['email'])) { - $error = 'E-mail заблокирован свяжитесь с Администрацией.'; + $error = 'E-mail .'; } $x = 1; $i = 1; - $tx = '
    Возможно использовать только сервисы почты:
    '; + $tx = '
    :
    '; $sp = mysql_query('SELECT * FROM `trust_email`'); while ($pl = mysql_fetch_array($sp)) { $emailtest = $pl['email']; @@ -142,12 +162,11 @@ function error_check($id, $str_u, $name = 0) $x++; } if ($i == $x) { - $error = 'Данный почтовый сервис использовать нельзя.' . $tx; + $error = ' .' . $tx; } - } if (!preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $str_u)) { - $error = 'Вы указали явно ошибочный E-mail.
    '; + $error = ' E-mail.
    '; } if ($error != '') { $gd[4] = $error; @@ -157,47 +176,47 @@ function error_check($id, $str_u, $name = 0) } } - if ($id == 3 && !empty($str_u) && !empty($name)) //отсылка емаила при удачном емаиле str_u -> mail name -> nickname + if ($id == 3 && !empty($str_u) && !empty($name)) // str_u -> mail name -> nickname { $code = rand(10000000, 99999999); mysql_query('INSERT INTO `secure_code`(`email`, `code`, `time`) VALUES ("' . $str_u . '","' . $code . '","' . time() . '");'); - mails($str_u, 'Секретный Код: ' . $code, 'Секретный Код - Новый Бойцовский Клуб ' . $name); + mails($str_u, ' : ' . $code, ' - ' . $name); } - if ($id == 4 && !empty($str_u) && !empty($name)) //проверка кода безопасности str_u -> введенный код name -> email + if ($id == 4 && !empty($str_u) && !empty($name)) // str_u -> name -> email { $testcode = mysql_fetch_array(mysql_query('SELECT code FROM `secure_code` WHERE `email` = "' . $name . '" ORDER BY id DESC LIMIT 1')); if ($testcode['code'] != $str_u) { - $error = 'Неверный код безопасности (Проверте пробелы и сам код в последнем емеиле)'; + $error = ' ( )'; } } - if ($id == 5 && !empty($str_u) && !empty($name)) //проверка пароля str_u -> p1 код name -> p2 + if ($id == 5 && !empty($str_u) && !empty($name)) // str_u -> p1 name -> p2 { if (strlen($str_u) < 8 || strlen($str_u) > 30) { - $error = 'Длина пароля не может быть меньше 8 символов или более 30 символов.'; - $error = $error . '
    Пример правильного пароля: Parol228, Kotik111, Pswerd112.
    Пример неправильного пароля: parol228, kotik.'; + $error = ' 8 30 .'; + $error = $error . '
    : Parol228, Kotik111, Pswerd112.
    : parol228, kotik.'; } if ($str_u != $name) { - $error = 'В анкете пароль нужно ввести дважды, для проверки. Во второй раз вы его ввели неверно, будьте внимательнее.'; - $error = $error . '
    Пример правильного пароля: Parol228, Kotik111, Pswerd112.
    Пример неправильного пароля: parol228, kotik.'; + $error = ' , . , .'; + $error = $error . '
    : Parol228, Kotik111, Pswerd112.
    : parol228, kotik.'; } - if (!preg_match('/[a-zа-я]+/', $str_u)) { - $error = 'Пароль не содержит букв нижнего регитра а..я/a..z.'; - $error = $error . '
    Пример правильного пароля: Parol228, Kotik111, Pswerd112.
    Пример неправильного пароля: parol228, kotik.'; - } elseif (!preg_match('/[A-ZА-Я]+/', $str_u)) { - $error = 'Пароль не содержит букв верхнего регитра А..Я/A..Z .'; - $error = $error . '
    Пример правильного пароля: Parol228, Kotik111, Pswerd112.
    Пример неправильного пароля: parol228, kotik.'; + if (!preg_match('/[a-z-]+/', $str_u)) { + $error = ' ../a..z.'; + $error = $error . '
    : Parol228, Kotik111, Pswerd112.
    : parol228, kotik.'; + } elseif (!preg_match('/[A-Z-]+/', $str_u)) { + $error = ' ../A..Z .'; + $error = $error . '
    : Parol228, Kotik111, Pswerd112.
    : parol228, kotik.'; } else { if (!preg_match('/[0-9]+/', $str_u)) { - $error = 'Пароль не содержит цифр.'; - $error = $error . '
    Пример правильного пароля: Parol228, Kotik111, Pswerd112.
    Пример неправильного пароля: parol228, kotik.'; + $error = ' .'; + $error = $error . '
    : Parol228, Kotik111, Pswerd112.
    : parol228, kotik.'; } } } //*************************************************** - return $error ? '

    ' . $error . '

    ' : ''; + return $error ?: ''; } if ($_SERVER['HTTP_USER_AGENT'] != '' && @@ -209,29 +228,28 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' && - Регистрация - создай персонажа в игре Новый «Бойцовский клуб» + - + content=" ? - . , , . "/> +
    -
    -

    -

    -

    Введите никнейм для Вашего персонажа

    +

    +

    -

    -

    Введите никнейм для Вашего персонажа

    -

    +

    +

    +

    -
    -

    Имя вашего персонажа (login):

    +

    (login):

    - -

    -

    Введите ваш действующий и настоящий "Email" адрес

    +

    "Email"

    +

    -

    Внимание! Не используйте несуществующие "Email" адреса, а так же проверяйте то, какой эмеил вы вводите, - ибо перед стартом игры, вам необходимо будет подтвердить ваш эмеил адрес.

    -

    -

    Ваш "Email" Адрес не будет использоваться нигде и служит исключительно для того, чтобы вы смогли - восстановить пароль от своего персонажа, а так же для получения новостной рассылки.

    +

    ! "", , .

    -

    -

    Введите ваш действующий и настоящий "Email" адрес

    -

    +

    "Email"

    +

    +

    -
    -

    +

    - -

    -

    Войдите на "Email": и проверьте почту,
    вам пришло письмо с кодом - подтверждения, скопируйте его и вставьте сюда:

    +

    "Email": ,
    + , :

    +

    -

    -

    Войдите на "Email": и проверьте почту,
    вам пришло письмо с кодом - подтверждения, скопируйте его и вставьте сюда:

    -

    +

    "Email": ,
    + , :

    +

    +

    -
    -

    +

    - -

    -

    Придумайте пароль для Вашего персонажа

    +

    +

    -

    Подтвердите придуманный пароль для Вашего персонажа


    +

    +


    -

    Пароль должен состоять с букв верхнего и нижнего регистра, а так же, помимо букв, необходимо добавить и - цифры для надёжности.

    +

    , , , + .

    -

    -

    Придумайте пароль для Вашего персонажа

    +

    +

    -

    Подтвердите придуманный пароль для Вашего персонажа

    +

    +

    -

    Пароль должен состоять с букв верхнего и нижнего регистра, а так же, помимо букв, необходимо добавить и - цифры для надёжности.

    -


    +

    , , , + .

    +


    -
    -

    -

    +

    +

    - -

    -

    Выберите пол вашего персонажа:

    +

    :

    -

    - -
    -

    Укажите дату вашего рождения:

    +

    :

    -
    - +
    - -

    -

    Выберите игровой класс для вашего персонажа:

    +

    :

    -

    Внимание! Выбор игрового класса не влияет на игру в целом и нигде не фиксируется или же используется, - это необходимо для того, чтобы ваш персонаж получил нужные предметы в начале игры, а так же нужные - баффы.

    +

    ! , + , , + .

    + for="radio-1">

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    -

    +

    +

    +
    +
    +

    -

    Внимание! Выбрав класс персонажа вы автоматически соглашаетесь с правилами и законами игрового мира

    +

    !


    - 0) { $ref = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string($_POST['ref']) . '" LIMIT 1')); if (isset($ref['id'])) { @@ -665,570 +702,208 @@ if ($_SERVER['HTTP_USER_AGENT'] != '' && } unset($ref); } + 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` + `activ`,`mail`,`bithday`,`sex`,`fnq`,`battle`,`design`,`molch2`,`level`, `hobby`, `clan_zv` ) VALUES ( "", - "0", - "1", + 0, + 1, "' . mysql_real_escape_string($_POST['nick_u']) . '", - "' . mysql_real_escape_string(0 + (int)$_POST['ref']) . '", + "' . (int)$_POST['ref'] . '", "' . mysql_real_escape_string(md5($_POST['pass1_u'])) . '", - "' . mysql_real_escape_string(getIp()) . '", - "' . mysql_real_escape_string(getIp()) . '", + "' . getIp() . '", + "' . getIp() . '", "capitalcity", "capitalcity", - "9", + 9, "' . time() . '", - "0", + 0, "' . mysql_real_escape_string($_POST['email_u']) . '", - "' . mysql_real_escape_string(date('d.m.Y', strtotime($_POST['bday_u']))) . '", + "' . date('d.m.Y', strtotime($_POST['bday_u'])) . '", "' . mysql_real_escape_string($_POST['pol_u'] - 10) . '", - "0", - "0", - "1", - "' . mysql_real_escape_string(time() + 86400) . '", - "8" + 0, + 0, + 1, + "' . (time() + 86400) . '", + 8, + "", + 0 )'); $uid = mysql_insert_id(); if ($uid > 0) { - //=================================================================== - if (isset($_COOKIE['from'])) { mysql_query('INSERT INTO `from` (`type`,`ip`,`uid`,`time`,`val`) VALUES ( "0", "' . getIp() . '","' . $uid . '", "' . time() . '", "' . mysql_real_escape_string($_COOKIE['from']) . '" ) '); } - //Сообщения при регистрации от паладинов. + // . $pal = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `align` > 1 AND `align` < 2 AND `online` > "' . (time() - 120) . '" ORDER BY `online` DESC LIMIT 1')); if (!isset($pal['id'])) { $pal = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `align` > 3 AND `align` < 4 AND `online` > "' . (time() - 120) . '" ORDER BY `online` DESC LIMIT 1')); } if (isset($pal['id'])) { - //отсылаем сообщение от $pal['login'] - $paltext = 'Приветствую ' . $_POST['nick_u'] . '. Отправляемся драться в хаоты, если нет заявок, создайте бой, дополнительно купите зверя и не забывайте выходить на центральную площать убивать Трупожора своего уровня!Приятной игры. '; + // $pal['login'] + $paltext = ' ' . $_POST['nick_u'] . '. , , , ! . '; mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','" . $pal['login'] . "','" . $_POST['nick_u'] . "','" . $paltext . "','" . time() . "','3','0','1')"); } else { - //Не знаю что делать, пусть будет просто приветствие :) - $text = 'Приветствую ' . $_POST['nick_u'] . '. Отправляемся драться в хаоты, если нет заявок, создайте бой, дополнительно купите зверя и не забывайте выходить на центральную площать убивать Трупожора своего уровня!Приятной игры.'; + // , :) + $text = ' ' . $_POST['nick_u'] . '. , ! !'; mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','','" . $_POST['nick_u'] . "','" . $text . "','" . time() . "','3','0','1')"); } - //$text = 'Приветствую '.$_POST['nick_u'].'. Крайне рекомендую прочесть мини гайд по ссылке https://new-combats.com/forum?read=5762&rnd=1 , если останутся вопросы,задавайте в общий чат!'; - //mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('capitalcity','0','','".$_POST['nick_u']."','".$text."','".time()."','6','0','1')"); - - /** Много однотипых запросов это боль. - * - * @param array $itemset - * @param double $itemscost - * @param string $stats - * - * @return void - */ - function sql_01(array $itemset, $itemscost, $stats) + // + if ($_POST['class_u'] == 1) { + // + $us = add_effn($uid, 1); // + $us = add_effn($uid, 20); // + // + mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=62|s2=3|s3=3|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=9|a3=0|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(6433, $uid); + Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6433, $re]); + // + mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');// 2244 - 2101 + // + } elseif ($_POST['class_u'] == 2) { + // + $us = add_effn($uid, 8); // + $us = add_effn($uid, 20); // + mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=21|s2=31|s3=16|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=9|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(6431, $uid); + Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6431, $re]); + // + mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');// 2244 - 1972 + // + } elseif ($_POST['class_u'] == 3) { + // + $us = add_effn($uid, 1); // + $us = add_effn($uid, 20); // + mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','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(6432, $uid); + Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6432, $re]); + // + mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');// 2244 - 2101 + // + } elseif ($_POST['class_u'] == 4)// { - global $u, $uid; - array_unshift($itemset, null); - foreach ($itemset as $inodet => $itemId) { - if (empty($itemId)) { - continue; - } - mysql_query(sprintf('update items_users set - 1price = (select price_1 from items_shop where sid = 1 and item_id = %d), - inOdet = %d - where id = %d', - $itemId, $inodet, $u->addItem($itemId, $uid))); - } - mysql_query(sprintf('update users set money = money - %f where id = %d', $itemscost, $uid)); - mysql_query(sprintf('insert into stats (id, stats, ability, skills, exp) - values (%d, %s, -75, -9, 100000)', $uid, $stats)); - } - - if ($_POST['class_u'] == 1) //топор + $us = add_effn($uid, 7); // + $us = add_effn($uid, 20); // + mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=24|s2=15|s3=29|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(6430, $uid); + Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6430, $re]); + // + mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');// 2244 - 1988 + // + } elseif ($_POST['class_u'] == 5)// { - //кастим эфекты - $us = add_effn($uid, 1); // сила - $us = add_effn($uid, 20); // сокрушение - - $wear = [528, 540, 552, 291, 543, null, 627, 653, 681, 687, 687, 687, 320, 552, null, 709, 716]; - $itemcost = 2101; - $stats = 's1=62|s2=3|s3=3|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=9|a3=0|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'; - - } elseif ($_POST['class_u'] == 2) //уворот - { - //кастим эфекты - $us = add_effn($uid, 8); // ловка - $us = add_effn($uid, 20); // сокрушение - - $wear = [525, 539, 523, 290, 541, null, 633, 647, 680, 685, 685, 685, 1151, 523, null, 707, 712]; - $itemcost = 1972; - $stats = 's1=21|s2=31|s3=16|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=9|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'; - - } elseif ($_POST['class_u'] == 3)//танк - { - //кастим эфекты - $us = add_effn($uid, 1); // сила - $us = add_effn($uid, 20); // сокрушение - - $wear = [533, 536, 558, 291, 545, null, 628, 654, 684, 689, 689, 689, 700, 722, null, 710, 718]; - $itemcost = 2101; - $stats = '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'; - - } elseif ($_POST['class_u'] == 4)//крит - { - //кастим эфекты - $us = add_effn($uid, 7); // инта - $us = add_effn($uid, 20); // сокрушение - - $wear = [527, 537, 567, 291, 544, null, 626, 651, 683, 686, 686, 686, 706, 723, null, 708, 717]; - $itemcost = 1988; - $stats = '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'; - - } elseif ($_POST['class_u'] == 5)//воздух - { - //кастим эфекты - $us = add_effn($uid, 9); // интелект - $us = add_effn($uid, 32); // Холодный разум - $us = add_effn($uid, 53); // Маг уселок воздух - $us = add_effn($uid, 439); // Маг уселок - - + // + $us = add_effn($uid, 9); // + $us = add_effn($uid, 32); // + $us = add_effn($uid, 53); // + $us = add_effn($uid, 439); // mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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(698, $uid); - 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` = "698" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - - $re = $u->addItem(711, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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 `users` SET `money` = `money`-1988 WHERE `id` = "' . $uid . '" LIMIT 1');//коректировка денег 2244 - 1988 - } elseif ($_POST['class_u'] == 6)//огонь - { - //кастим эфекты - $us = add_effn($uid, 9); // интелект - $us = add_effn($uid, 32); // Холодный разум - $us = add_effn($uid, 51); // Маг уселок огонь - $us = add_effn($uid, 439); // Маг уселок - + $re = $u->addItem(6435, $uid); + Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6435, $re]); + // + mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');// 2244 - 1988 + // + } elseif ($_POST['class_u'] == 6) { + // + $us = add_effn($uid, 9); // + $us = add_effn($uid, 32); // + $us = add_effn($uid, 51); // + $us = add_effn($uid, 439); // mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','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=6|mg2=0|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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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(549, $uid); - 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` = "549" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - - $re = $u->addItem(629, $uid); - 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(698, $uid); - 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` = "698" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - - $re = $u->addItem(711, $uid); - 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, $uid); - 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(655, $uid); - 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` = "655" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - - $re = $u->addItem(679, $uid); - 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` = "679" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - - $re = $u->addItem(696, $uid); - 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` = "696" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - $re = $u->addItem(696, $uid); - 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` = "696" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - $re = $u->addItem(696, $uid); - 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` = "696" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - ///---- - - mysql_query('UPDATE `users` SET `money` = `money`-1988 WHERE `id` = "' . $uid . '" LIMIT 1');//коректировка денег 2244 - 1988 - } elseif ($_POST['class_u'] == 7)//земля - { - - - //кастим эфекты - $us = add_effn($uid, 9); // интелект - $us = add_effn($uid, 32); // Холодный разум - $us = add_effn($uid, 54); // Маг уселок земля - $us = add_effn($uid, 439); // Маг уселок - + $re = $u->addItem(6447, $uid); + Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6447, $re]); + // + mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');// 2244 - 1988 + // + } elseif ($_POST['class_u'] == 7) { + // + $us = add_effn($uid, 9); // + $us = add_effn($uid, 32); // + $us = add_effn($uid, 54); // + $us = add_effn($uid, 439); // mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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(698, $uid); - 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` = "698" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - - $re = $u->addItem(711, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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 `users` SET `money` = `money`-1988 WHERE `id` = "' . $uid . '" LIMIT 1');//коректировка денег 2244 - 1988 - } elseif ($_POST['class_u'] == 8)//вода - { - //кастим эфекты - $us = add_effn($uid, 9); // интелект - $us = add_effn($uid, 32); // Холодный разум - $us = add_effn($uid, 52); // Маг уселок вода - $us = add_effn($uid, 439); // Маг уселок + $re = $u->addItem(6436, $uid); + Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6436, $re]); + // + mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');// 2244 - 1988 + // + } elseif ($_POST['class_u'] == 8) { + // + $us = add_effn($uid, 9); // + $us = add_effn($uid, 32); // + $us = add_effn($uid, 52); // + $us = add_effn($uid, 439); // mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','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=6|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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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, $uid); - 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(318, $uid); - 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` = "318" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - - $re = $u->addItem(711, $uid); - 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, $uid); - 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(660, $uid); - 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` = "660" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - - $re = $u->addItem(677, $uid); - 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` = "677" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - - $re = $u->addItem(695, $uid); - 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` = "695" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - $re = $u->addItem(695, $uid); - 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` = "695" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - $re = $u->addItem(695, $uid); - 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` = "695" AND `sid`=1 LIMIT 1')); - mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1'); - ///---- - - mysql_query('UPDATE `users` SET `money` = `money`-1988 WHERE `id` = "' . $uid . '" LIMIT 1');//коректировка денег 2244 - 1988 + $re = $u->addItem(6448, $uid); + Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6448, $re]); + // + mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');// 2244 - 1988 + // + } elseif ($_POST['class_u'] == 9) { + // + $us = add_effn($uid, 8); // + $us = add_effn($uid, 20); // + mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uid . "','s1=15|s2=23|s3=30|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=9|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(6530, $uid); + Db::sql('update items_users set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1) where id = ?', [6530, $re]); + // + mysql_query('UPDATE `users` SET `money` = `money`200 WHERE `id` = "' . $uid . '" LIMIT 1');// 2244 - 1972 } - - if (!empty($wear) && !empty($itemcost) && !empty($stats)) { - sql_01($wear, $itemcost, $stats); - unset($wear, $itemcost, $stats); - } - if ($_POST['ref'] > 0) { - $re = $u->addItem(6417, $uid); + $re = $u->addItem(4811, $uid); } - //катим эфекты - // - // + // $us = add_effn($uid, 37); $us = add_effn($uid, 38); $us = add_effn($uid, 283); $us = add_effn($uid, 25); $us = add_effn($uid, 296); $us = add_effn($uid, 472); - - //Магическое усиление - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (4942, 40, 0.00, 0.00, 0.00, " . $uid . ", 0, 'oneType=72|onlyOne=1|musor=1|noremont=1|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 4, 'Администрация', '', '', 1, 2, '439', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Защита от оружия - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (1001, 40, 0.00, 0.00, 0.00, " . $uid . ", 0, 'onlyOne=1|oneType=7|noremont=1|musor=1|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 4, 'Администрация', '', '', 1, 2, '25', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Защита от магии - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (4941, 40, 0.00, 0.00, 0.00, " . $uid . ", 0, 'oneType=71|onlyOne=1|musor=1|noremont=1|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 4, 'Администрация', '', '', 1, 2, '438', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Жажда жизни +6 - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (3101, 50, 0.00, 0.00, 0.00, " . $uid . ", 0, 'onlyOne=1|noremont=1|oneType=33|musor=1|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 5, 'Администрация', '', '', 1, 2, '296', 'capitalcity', " . time() . ", 0, 33, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Аптечка (Исцеляет легкие травмы) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (4412, 7, 0.00, 0.00, 0.00, " . $uid . ", 0, 'tr_lvl=1|useOnLogin=1|musor=1|noremont=1', 0, 0, 0, 0, 0.00, 2, 'Администрация', '', '', 1, 2, 'lech_free_1', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Аптечка (Исцеляет средние травмы) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (4413, 14, 0.00, 0.00, 0.00, " . $uid . ", 0, 'tr_lvl=1|useOnLogin=1|musor=1|noremont=1', 0, 0, 0, 0, 0.00, 2, 'Администрация', '', '', 1, 2, 'lech_free_2', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Аптечка (Исцеляет тяжелые травмы) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (4414, 21, 0.00, 0.00, 0.00, " . $uid . ", 0, 'tr_lvl=1|useOnLogin=1|musor=1|noremont=1', 0, 0, 0, 0, 0.00, 2, 'Администрация', '', '', 1, 2, 'lech_free_3', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Холодный разум - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (1460, 15, 0.00, 0.00, 0.00, " . $uid . ", 0, 'musor=1|noremont=1|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 5, 'Администрация', '', '', 1, 5, '32', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Сокрушение - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (994, 40, 0.00, 0.00, 0.00, " . $uid . ", 0, 'onlyOne=1|oneType=44|noremont=1|musor=1|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 4, 'Администрация', '', '', 1, 4, '20', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Эликсир жизни (восстанавливает +500 хп) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (4736, 5, 0.00, 0.00, 0.00, " . $uid . ", 0, 'moment=1|moment_hp=500|nohaos=1|musor=2|noremont=1|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 10, 'Администрация', '', '', 1, 4, 'elicsir_hp -w500', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Зелье жизни (восстанавливает +200 хп) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (724, 2, 0.00, 0.00, 0.00, " . $uid . ", 0, 'moment=1|moment_hp=200|nohaos=1|musor=2|noremont=1|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 10, 'Администрация', '', '', 1, 4, 'elicsir_hp -w200', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Зелье могущества (+10 силы) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (870, 5, 0.00, 0.00, 0.00, " . $uid . ", 0, 'nohaos=1|onlyOne=1|oneType=1|musor=2|noremont=1|nohaos=1|onlyOne=1|oneType=1|noremont=1|add_s1=15|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 5, 'Администрация', '', '', 1, 4, '1', 'capitalcity', " . time() . ", 0, 1, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Зелье стремительности (+10 ловкости) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (872, 5, 0.00, 0.00, 0.00, " . $uid . ", 0, 'nohaos=1|onlyOne=1|oneType=1|musor=2|noremont=1|nohaos=1|onlyOne=1|oneType=1|noremont=1|add_s2=15|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 5, 'Администрация', '', '', 1, 4, '8', 'capitalcity', " . time() . ", 0, 1, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Зелье прозрения(+10 интуиции) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (871, 5, 0.00, 0.00, 0.00, " . $uid . ", 0, 'nohaos=1|onlyOne=1|oneType=1|musor=2|noremont=1|nohaos=1|onlyOne=1|oneType=1|noremont=1|add_s3=15|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 5, 'Администрация', '', '', 1, 4, '7', 'capitalcity', " . time() . ", 0, 1, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Зелье разума(+10 интеллекта) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (873, 5, 0.00, 0.00, 0.00, " . $uid . ", 0, 'nohaos=1|onlyOne=1|oneType=1|musor=2|noremont=1|nohaos=1|onlyOne=1|oneType=1|noremont=1|add_s5=15|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 5, 'Администрация', '', '', 1, 4, '9', 'capitalcity', " . time() . ", 0, 1, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Нектар Отрицания(+160 защиты от магии) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (2140, 30, 0.00, 0.00, 0.00, " . $uid . ", 0, 'nohaos=1|onlyOne=1|oneType=8|musor=2|noremont=1|add_zm=160|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 5, 'Администрация', '', '', 1, 4, '38', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Нектар уязвимости(+160 защиты от урона) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (2139, 30, 0.00, 0.00, 0.00, " . $uid . ", 0, 'nohaos=1|onlyOne=1|oneType=8|musor=2|noremont=1|add_za=160|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 5, 'Администрация', '', '', 1, 4, '37', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - //Бутер (+180 хп) - mysql_query("INSERT INTO `items_users` (`item_id`, `1price`, `2price`, `3price`, `4price`, `uid`, `use_text`, `data`, `inOdet`, `inShop`, `inGroup`, `delete`, `iznosNOW`, `iznosMAX`, `gift`, `gtxt1`, `gtxt2`, `kolvo`, `geniration`, `magic_inc`, `maidin`, `lastUPD`, `timeOver`, `overType`, `secret_id`, `time_create`, `time_sleep`, `dn_delete`, `inTransfer`, `post_delivery`, `lbtl_`, `bexp`, `so`, `blvl`, `pok_itm`, `btl_zd`) VALUES - (3075, 10, 0.00, 0.00, 0.00, " . $uid . ", 0, 'nohaos=1|onlyOne=1|oneType=4|musor=1|noremont=1|sudba=1|nosale=1', 0, 0, 0, 0, 0.00, 10, 'Администрация', '', '', 1, 4, '283', 'capitalcity', " . time() . ", 0, 0, '', " . time() . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);"); - mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $uid . '" LIMIT 1'); - //Создаем статы персонажа + // mysql_query("INSERT INTO `online` (`uid`,`timeStart`) VALUES ('" . $uid . "','" . time() . "')"); - //добовляем благодать ангела 1н день + // $ttime = time(); 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 - (412,'" . $uid . "','Благодать Ангела [1]','add_gold=1|add_speedhp=35|add_speedmp=35|add_exp=35|add_repair_discount=25|add_speed_dungeon=10|add_hpVinos=5|add_m10=5|add_m11=5|add_za=25|add_zma=25',52," . $ttime . ",0,'',0,0,0,'',1,-1,0,0,1,'',0,0,0,0,0)"); - - //мульты - $ipm1 = mysql_fetch_array(mysql_query('SELECT * FROM `logs_auth` WHERE `uid` = "' . mysql_real_escape_string($uid) . '" AND `ip`!="' . mysql_real_escape_string(getIp()) . '" ORDER BY `id` ASC LIMIT 1')); - $ppl = mysql_query('SELECT * FROM `logs_auth` WHERE `ip`!="" AND (`ip` = "' . mysql_real_escape_string(getIp()) . '" OR `ip`="' . mysql_real_escape_string($ipm1['ip']) . '" OR `ip`="' . mysql_real_escape_string($_COOKIE['ip']) . '")'); + (412,'" . $uid . "',' [1]','add_gold=1|add_speedhp=35|add_speedmp=35|add_exp=35|add_repair_discount=25|add_speed_dungeon=10|add_hpVinos=5|add_m10=5|add_m11=5|add_za=25|add_zma=25',52," . $ttime . ",0,'',0,0,0,'',1,-1,0,0,1,'',0,0,0,0,0)"); + + // + $ipm1 = mysql_fetch_array(mysql_query('SELECT * FROM `logs_auth` WHERE `uid` = "' . $uid . '" AND `ip`!="' . getIp() . '" ORDER BY `id` LIMIT 1')); + $ppl = mysql_query('SELECT * FROM `logs_auth` WHERE `ip`!="" AND (`ip` = "' . getIp() . '" OR `ip`="' . $ipm1['ip'] . '" OR `ip`="' . $_COOKIE['ip'] . '")'); while ($spl = mysql_fetch_array($ppl)) { $ml = mysql_fetch_array(mysql_query('SELECT `id` FROM `mults` WHERE (`uid` = "' . $spl['uid'] . '" AND `uid2` = "' . $uid . '") OR (`uid2` = "' . $spl['uid'] . '" AND `uid` = "' . $uid . '") LIMIT 1')); if (!isset($ml['id']) && $spl['ip'] != '' && $spl['ip'] != '127.0.0.1') { mysql_query('INSERT INTO `mults` (`uid`,`uid2`,`ip`) VALUES ("' . $uid . '","' . $spl['uid'] . '","' . $spl['ip'] . '")'); } } - mysql_query("INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('" . $uid . "','" . mysql_real_escape_string(getIp()) . "','" . mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']) . "','1','" . time() . "','')"); + mysql_query("INSERT INTO `logs_auth` (`uid`,`ip`,`browser`,`type`,`time`,`depass`) VALUES ('" . $uid . "','" . getIp() . "','" . $_SERVER['HTTP_USER_AGENT'] . "','1','" . time() . "','')"); - //Обновяем таблицы - mysql_query("UPDATE `users` SET `online`='" . time() . "',`ip` = '" . mysql_real_escape_string(getIp()) . "' WHERE `uid` = '" . $uid . "' LIMIT 1"); + // + mysql_query("UPDATE `users` SET `online`='" . time() . "',`ip` = '" . getIp() . "' WHERE `uid` = '" . $uid . "' LIMIT 1"); - if (!setcookie('login', $_POST['nick_u'], (time() + 60 * 60 * 24 * 7), '', '.new-combats.com') || !setcookie('pass', md5($_POST['pass1_u']), (time() + 60 * 60 * 24 * 7), '', '.new-combats.com')) { - die('Ошибка сохранения cookie.'); + if ( + !setcookie('login', $_POST['nick_u'], (time() + 60 * 60 * 24 * 7), '', '.new-combats.com') || + !setcookie('pass', md5($_POST['pass1_u']), (time() + 60 * 60 * 24 * 7), '', '.new-combats.com') || + !setcookie('registrationModal', 'true', (time() + 60 * 60 * 24 * 7), '', 'new-combats.com') + ) { + die(' cookie.'); } else { - - die('Спасибо за регистрацию в игровом мире Бойцовского Клуба, желаем вам побед и долгой игры. -В случае вопросов по игре, Вам будет доступен общий чат!
    '); - + Db::sql('insert into users_learning_status (uid) values (?)', [$uid]); + die(' , . + , !
    '); } - - setcookie('login', $_POST['nick_u'], time() + 60 * 60 * 24 * 7, '', $c['host']); - setcookie('pass', md5($_POST['pass1_u']), time() + 60 * 60 * 24 * 7, '', $c['host']); - setcookie('login', $_POST['nick_u'], time() + 60 * 60 * 24 * 7); - setcookie('pass', md5($_POST['pass1_u']), time() + 60 * 60 * 24 * 7); - - header('location: https://new-combats.com/bk'); - - //=================================================================== } - //================================ } else { ?> -
    -

    -
    +

    - - ' . (time() - 24 * 60 * 60) . ' AND `type` = "1" LIMIT 1')); if (isset($lst_psw['id'])) { - $error = 'Высылать пароль можно не более одного раза в сутки.'; + $error = ' .'; } elseif (str_replace('0', '', $_POST['redate']) == str_replace('0', '', $usr['bithday']) && ($_POST['reanswer'] == $usr['q1'] || $usr['q1'] == '')) { - $error = '


    Пароль от персонажа "' . $usr['login'] . '" был успешно выслан на E-mail указанный при регистрации!


    '; + $error = '


    "' . $usr['login'] . '" E-mail !


    '; $re = mysql_fetch_array(mysql_query('SELECT * FROM `logs_auth` WHERE `uid` = "' . $usr['id'] . '" AND `type` = "0" AND `depass` != "" ORDER BY `id` DESC LIMIT 1')); if ($u['securetime'] < $c['securetime']) { unset($re); @@ -48,14 +35,14 @@ if (isset($_POST['relogin'])) { $sm = ['a', 'b', 'c', 'd', 'e', 'f', 'x', 'd', 'f', 'X', 'e', 'ER', 'XX', 'X']; $re['depass'] = $sm[rand(0, 12)] . rand(0, 9) . $sm[rand(0, 12)] . rand(0, 9) . $sm[rand(0, 12)] . rand(0, 9) . $sm[rand(0, 12)] . rand(0, 9) . $sm[rand(0, 12)] . rand(0, 9); } - $title = 'Восстановление пароля от "' . $usr['login'] . '".'; - $txt = 'Добрый день.
    '; - $txt .= 'С IP-адреса - ' . IP . ', был запрошен пароль для вашего персонажа.
    Если это не Вы, просто удалите это письмо.

    '; - $txt .= 'Ваш логин: ' . $usr['login'] . '
    '; - $txt .= 'Ваш пароль: ' . $re['depass'] . '

    '; - $txt .= 'Отвечать на данное письмо не нужно.

    '; - $txt .= 'С уважением,
    '; - $txt .= 'Администрация Бойцовского Клуба'; + $title = ' "' . $usr['login'] . '".'; + $txt = ' .
    '; + $txt .= ' IP- - ' . IP . ', .
    , .

    '; + $txt .= ' : ' . $usr['login'] . '
    '; + $txt .= ' : ' . $re['depass'] . '

    '; + $txt .= ' .

    '; + $txt .= ' ,
    '; + $txt .= ' '; $mail = mails($usr['mail'], $txt, $title); if ($mail === 1) { @@ -67,14 +54,14 @@ if (isset($_POST['relogin'])) { } unset($mail); } else { - $error = 'Неверный ответ на секретный вопрос или неверно указан день рождения.'; + $error = ' .'; } } } else { - $error = 'Персонажу "' . $_POST['relogin'] . '" запрещена высылка пароля!'; + $error = ' "' . $_POST['relogin'] . '" !'; } } else { - $error = 'Логин "' . htmlspecialchars($_POST['relogin'], null, 'cp1251') . '" не найден в базе.'; + $error = ' "' . htmlspecialchars($_POST['relogin'], null, 'cp1251') . '" .'; } } @@ -83,11 +70,11 @@ if (isset($_POST['relogin'])) { - Восстановление пароля от персонажа Бойцовский Клуб + + content=" , , , , , , , , , , , , , , , combats, , combats ru, combats com, OldBK, oldbk ru, oldbk com, , old bk, , mycombats, rebk, recombats, oldcombats, obk2"> + content=" "/> @@ -121,7 +108,7 @@ if (isset($_POST['relogin'])) {
    «Старый Бойцовский Клуб»     2018- © Браузерная онлайн игра + class="testro">« »     2018- ©
    diff --git a/reting_clans.php b/reting_clans.php index f3ce70e1..3bdf4cf6 100644 --- a/reting_clans.php +++ b/reting_clans.php @@ -1,7 +1,7 @@ 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($u->info['activ']>0) { - die(' .
    .'); +if ($u->info['activ'] > 0) { + die(' .
    .'); } -if(isset($_POST['set_name'])) { - $_POST['set_name'] = htmlspecialchars($_POST['set_name']); - $set_x = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `ruine_sets` WHERE `uid` = "'.$u->info['id'].'" AND `name` != "'.mysql_real_escape_string($_POST['set_name']).'" LIMIT 1')); - if( $set_x[0] > 20 ) { - $u->error = ' 20 '; - }else{ - $set_x = mysql_fetch_array(mysql_query('SELECT `id` FROM `ruine_sets` WHERE `uid` = "'.$u->info['id'].'" AND `name` = "'.mysql_real_escape_string($_POST['set_name']).'" LIMIT 1')); - // - - $f = $free_stats; // - $i = 1; - while( $i <= 6 ) { - $_POST['s'.$i] = round((int)$_POST['s'.$i]); - if( $_POST['s'.$i] < 0 ) { - $_POST['s'.$i] = 0; - } - $f -= $_POST['s'.$i]; - $i++; - } - - // - if( $f < 0 || $f > $free_stats ) { - $u->error = ' .'; - }elseif(isset($set_x['id'])) { - mysql_query('UPDATE `ruine_sets` SET - `s1` = "'.mysql_real_escape_string($_POST['s1']).'", - `s2` = "'.mysql_real_escape_string($_POST['s2']).'", - `s3` = "'.mysql_real_escape_string($_POST['s3']).'", - `s4` = "'.mysql_real_escape_string($_POST['s4']).'", - `s5` = "'.mysql_real_escape_string($_POST['s5']).'", - `s6` = "'.mysql_real_escape_string($_POST['s6']).'", - `free` = "'.mysql_real_escape_string($f).'", - `time` = "'.time().'" - WHERE `id` = "'.$set_x['id'].'" LIMIT 1'); - $u->error = ' "'.$_POST['set_name'].'" !'; - }else{ - mysql_query('INSERT INTO `ruine_sets` ( +if (isset($_POST['set_name'])) { + $_POST['set_name'] = htmlspecialchars($_POST['set_name']); + $set_x = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(*) FROM `ruine_sets` WHERE `uid` = "' . $u->info['id'] . '" AND `name` != "' . mysql_real_escape_string( + $_POST['set_name'] + ) . '" LIMIT 1' + ) + ); + if ($set_x[0] > 20) { + $u->error = ' 20 '; + } else { + $set_x = mysql_fetch_array( + mysql_query( + 'SELECT `id` FROM `ruine_sets` WHERE `uid` = "' . $u->info['id'] . '" AND `name` = "' . mysql_real_escape_string( + $_POST['set_name'] + ) . '" LIMIT 1' + ) + ); + // + + $f = $free_stats; // + $i = 1; + while ($i <= 6) { + $_POST['s' . $i] = round((int)$_POST['s' . $i]); + if ($_POST['s' . $i] < 0) { + $_POST['s' . $i] = 0; + } + $f -= $_POST['s' . $i]; + $i++; + } + + // + if ($f < 0 || $f > $free_stats) { + $u->error = ' .'; + } elseif (isset($set_x['id'])) { + mysql_query( + 'UPDATE `ruine_sets` SET + `s1` = "' . mysql_real_escape_string($_POST['s1']) . '", + `s2` = "' . mysql_real_escape_string($_POST['s2']) . '", + `s3` = "' . mysql_real_escape_string($_POST['s3']) . '", + `s4` = "' . mysql_real_escape_string($_POST['s4']) . '", + `s5` = "' . mysql_real_escape_string($_POST['s5']) . '", + `s6` = "' . mysql_real_escape_string($_POST['s6']) . '", + `free` = "' . mysql_real_escape_string($f) . '", + `time` = "' . time() . '" + WHERE `id` = "' . $set_x['id'] . '" LIMIT 1' + ); + $u->error = ' "' . $_POST['set_name'] . '" !'; + } else { + mysql_query( + 'INSERT INTO `ruine_sets` ( `uid`,`name`,`free`,`s1`,`s2`,`s3`,`s4`,`s5`,`s6`,`time` ) VALUES ( - "'.$u->info['id'].'","'.mysql_real_escape_string($_POST['set_name']).'","'.mysql_real_escape_string($f).'", - "'.mysql_real_escape_string($_POST['s1']).'", - "'.mysql_real_escape_string($_POST['s2']).'", - "'.mysql_real_escape_string($_POST['s3']).'", - "'.mysql_real_escape_string($_POST['s4']).'", - "'.mysql_real_escape_string($_POST['s5']).'", - "'.mysql_real_escape_string($_POST['s6']).'", - "'.time().'" - )'); - $u->error = ' "'.$_POST['set_name'].'" .'; - } - } -}elseif( isset($_GET['use']) ) { - $set_x = mysql_fetch_array(mysql_query('SELECT * FROM `ruine_sets` WHERE `uid` = "'.$u->info['id'].'" AND `id` = "'.mysql_real_escape_string($_GET['use']).'" LIMIT 1')); - if(isset($set_x['id'])) { - mysql_query('UPDATE `ruine_sets` SET `use` = 0 WHERE `uid` = "'.$u->info['id'].'"'); - mysql_query('UPDATE `ruine_sets` SET `use` = 1 WHERE `id` = "'.$set_x['id'].'" LIMIT 1'); - $u->error = ' "'.$set_x['name'].'" .'; - } -}elseif( isset($_GET['delete']) ) { - $set_x = mysql_fetch_array(mysql_query('SELECT * FROM `ruine_sets` WHERE `uid` = "'.$u->info['id'].'" AND `id` = "'.mysql_real_escape_string($_GET['delete']).'" LIMIT 1')); - if(isset($set_x['id'])) { - mysql_query('DELETE FROM `ruine_sets` WHERE `id` = "'.$set_x['id'].'" LIMIT 1'); - $u->error = ' "'.$set_x['name'].'" .'; - } + "' . $u->info['id'] . '","' . mysql_real_escape_string( + $_POST['set_name'] + ) . '","' . mysql_real_escape_string($f) . '", + "' . mysql_real_escape_string($_POST['s1']) . '", + "' . mysql_real_escape_string($_POST['s2']) . '", + "' . mysql_real_escape_string($_POST['s3']) . '", + "' . mysql_real_escape_string($_POST['s4']) . '", + "' . mysql_real_escape_string($_POST['s5']) . '", + "' . mysql_real_escape_string($_POST['s6']) . '", + "' . time() . '" + )' + ); + $u->error = ' "' . $_POST['set_name'] . '" .'; + } + } +} elseif (isset($_GET['use'])) { + $set_x = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `ruine_sets` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string( + $_GET['use'] + ) . '" LIMIT 1' + ) + ); + if (isset($set_x['id'])) { + mysql_query('UPDATE `ruine_sets` SET `use` = 0 WHERE `uid` = "' . $u->info['id'] . '"'); + mysql_query('UPDATE `ruine_sets` SET `use` = 1 WHERE `id` = "' . $set_x['id'] . '" LIMIT 1'); + $u->error = ' "' . $set_x['name'] . '" .'; + } +} elseif (isset($_GET['delete'])) { + $set_x = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `ruine_sets` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string( + $_GET['delete'] + ) . '" LIMIT 1' + ) + ); + if (isset($set_x['id'])) { + mysql_query('DELETE FROM `ruine_sets` WHERE `id` = "' . $set_x['id'] . '" LIMIT 1'); + $u->error = ' "' . $set_x['name'] . '" .'; + } } ?> - - - - - - + + - + + +


    error != '' ) { - echo '
    '.$u->error.'

    '; +if ($u->error != '') { + echo '
    ' . $u->error . '

    '; } ?> - ? , , ! , . ! + ? , , ! + , . !

    - - - - - - info['id'].'" ORDER BY `time` DESC'); - while( $pl = mysql_fetch_array($sp) ) { - ?> - - - - - - + + + + + + info['id'] . '" ORDER BY `time` DESC'); + while ($pl = mysql_fetch_array($sp)) { + ?> + + + + + +
    - - - - -
    + + + + +
    -
    '; +
    '; } ?>
    - +



    -:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - + :

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    diff --git a/ruins.php b/ruins.php index a5006665..f7d26d38 100644 --- a/ruins.php +++ b/ruins.php @@ -1,8 +1,7 @@ - - +

                          #

    -
    © , www.new-combats.com    


    -
    - - < - - - -
    + diff --git a/ruletka.php b/ruletka.php index f3d4bddc..b876a852 100644 --- a/ruletka.php +++ b/ruletka.php @@ -2,663 +2,627 @@ die(); -define('GAME',true); +define('GAME', true); include_once('_incl_data/__config.php'); include_once('_incl_data/class/__db_connect.php'); -include_once('_incl_data/class/__user.php'); +$u = User::start(); -if(!isset($u->bank['id'])) { - die(); +if (!isset($u->bank['id'])) { + die(); } - if($u->info['admin'] == 0) { - //die(''); - } - /*mysql_query("LOCK TABLES - `actions` WRITE, - `bank` WRITE, - - `users` WRITE, - `users_delo` WRITE, - - `chat` WRITE, - - `stats` WRITE, - - `ruletka` WRITE, - `ruletka_coin` WRITE, - - `bandit` WRITE;");*/ +/* +33|2-0-0-0-2-0, +32|4-0-0-0-4-6, +11|4-0-0-42-4-0, +21|2-0-0-0-2-0, +2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35|8-0-8-0-0-0, +7|4-0-0-0-4-0, +2|4-0-0-0-4-0, +17|4-0-0-4-4-0, +1|6-0-0-0-0-6, +18|4-0-0-0-4-0, +30|4-0-0-6-4-6, +16|4-0-0-0-4-0, +13|4-0-0-0-4-0, +25|6-0-0-0-0-6, +27|2-0-0-0-2-0, +36|2-0-0-0-2-0, +3|4-0-0-0-4-0, +20|4-0-0-0-4-0, +8|8-0-0-16-4-0, +38|2-0-0-0-2-6, +4|8-0-0-16-0-0, +34|4-0-0-0-4-0, +37|1-0-0-0-4-7, +19|2-0-0-0-2-0, +10|4-0-0-10-2-0, +31|6-0-0-6-4-0 +*/ + +if ($u->room['name'] != '') { + die(); +} else { + + // - /* - 33|2-0-0-0-2-0, - 32|4-0-0-0-4-6, - 11|4-0-0-42-4-0, - 21|2-0-0-0-2-0, - 2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35|8-0-8-0-0-0, - 7|4-0-0-0-4-0, - 2|4-0-0-0-4-0, - 17|4-0-0-4-4-0, - 1|6-0-0-0-0-6, - 18|4-0-0-0-4-0, - 30|4-0-0-6-4-6, - 16|4-0-0-0-4-0, - 13|4-0-0-0-4-0, - 25|6-0-0-0-0-6, - 27|2-0-0-0-2-0, - 36|2-0-0-0-2-0, - 3|4-0-0-0-4-0, - 20|4-0-0-0-4-0, - 8|8-0-0-16-4-0, - 38|2-0-0-0-2-6, - 4|8-0-0-16-0-0, - 34|4-0-0-0-4-0, - 37|1-0-0-0-4-7, - 19|2-0-0-0-2-0, - 10|4-0-0-10-2-0, - 31|6-0-0-6-4-0 - */ + function get2str($key = '', $val = '') + { + $get = $_GET; + if (is_array($key)) { + if (count($key) > 0) { + foreach ($key as $k => $v) { + $get[$k] = $v; + } + } + } else { + $get[$key] = $val; + } + if (count($get) > 0) { + foreach ($get as $k => $v) { + if (empty($v)) { + unset($get[$k]); + } + } + } + if (count($get) > 0) { + foreach ($get as $k => $v) { + $get[$k] = $k . '=' . urlencode($v); + } + return '?' . implode('&', $get); + } + } -if($u->room['name']!='') -{ - die(); -}else{ - - // - - - function get2str($key='', $val='') { - $get = $_GET; - if ( is_array($key) ) { - if ( count($key)>0 ) foreach ( $key as $k=>$v ) $get[$k] = $v; - } else $get[$key] = $val; - if ( count($get)>0 ) { - foreach ( $get as $k=>$v ) if ( empty($v) ) unset($get[$k]); - } - if ( count($get)>0 ) { - foreach ( $get as $k=>$v ) $get[$k] = $k.'='.urlencode($v); - return '?'.implode('&', $get); - } - } + $r = ''; + $time = 74; // + $status = 0; // , 2 - + $win = [ + 0 => 0, // + 1 => '', // + 2 => 0, // + 3 => 0, // + // + 4 => '', + // + 5 => '', + ]; - $r = ''; - $time = 74; // - $status = 0; // , 2 - - $win = array( - 0 => 0, // - 1 => '', // - 2 => 0, // - 3 => 0, // - // - 4 => '', - // - 5 => '' - ); - - // , , - $gid = mysql_fetch_array(mysql_query('SELECT * FROM `ruletka` WHERE (`end` = 0 OR `id` = "'.((int)$_GET['id']).'") ORDER BY `id` DESC LIMIT 1')); - if($gid['time_start']+16>time() || isset($_GET['bet'])) - { - $mnr = true; - } - $gid3 = mysql_fetch_array(mysql_query('SELECT * FROM `ruletka` WHERE `end` >0 AND `id` = "'.((int)$_GET['id']).'" ORDER BY `id` DESC LIMIT 1')); - if(isset($gid3['id'])) - { - $gid = $gid3; - unset($gid3); - } - $add = false; - if(isset($gid['id'])) - { - // , - $time = $gid['time_start']-time(); - if($time<1) - { - // + - //mysql_query('UPDATE `ruletka` SET `end` = "'.time().'" WHERE `id` = "'.$gid['id'].'" LIMIT 1'); - // - $win[0] = $gid['win']; - $win[1] = $gid['win_line']; - $win[2] = 0; - $win[3] = 0; - if($gid['end']==0) - { - $add = true; - } - }else{ - // , - if(isset($_GET['bet'])) - { - $bt = $_GET['bet']; - $good = 0; - $i = 0; - while($i<=38) - { - if($i==$bt) - { - $good++; - } - $i++; - } - - /* - - - 1, ... ,36 - [x8] - - 2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35 - [x2] - 1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36 - [x2] - - 37 - [x36] - 38 - [x36] - - 1-2-3-37-38 - [x5] - - 1-2-3-4-5-6-7-8-9-10-11-12 - 1 [x3] - 13-14-15-16-17-18-19-20-21-22-23-24 - 2 [x3] - 25-26-27-28-29-30-31-32-33-34-35-36 - 3 [x3] - - */ - - if($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '35-36' && $good == 0 ) { - $good++; - }elseif($bt == '34-35' && $good == 0 ) { - $good++; - }elseif($bt == '32-33' && $good == 0 ) { - $good++; - }elseif($bt == '31-32' && $good == 0 ) { - $good++; - }elseif($bt == '29-30' && $good == 0 ) { - $good++; - }elseif($bt == '28-29' && $good == 0 ) { - $good++; - }elseif($bt == '26-27' && $good == 0 ) { - $good++; - }elseif($bt == '25-26' && $good == 0 ) { - $good++; - }elseif($bt == '23-24' && $good == 0 ) { - $good++; - }elseif($bt == '22-23' && $good == 0 ) { - $good++; - }elseif($bt == '20-21' && $good == 0 ) { - $good++; - }elseif($bt == '19-20' && $good == 0 ) { - $good++; - }elseif($bt == '17-18' && $good == 0 ) { - $good++; - }elseif($bt == '16-17' && $good == 0 ) { - $good++; - }elseif($bt == '14-15' && $good == 0 ) { - $good++; - }elseif($bt == '13-14' && $good == 0 ) { - $good++; - }elseif($bt == '11-12' && $good == 0 ) { - $good++; - }elseif($bt == '10-11' && $good == 0 ) { - $good++; - }elseif($bt == '8-9' && $good == 0 ) { - $good++; - }elseif($bt == '7-8' && $good == 0 ) { - $good++; - }elseif($bt == '5-6' && $good == 0 ) { - $good++; - }elseif($bt == '4-5' && $good == 0 ) { - $good++; - }elseif($bt == '2-3' && $good == 0 ) { - $good++; - }elseif($bt == '1-2' && $good == 0 ) { - $good++; - }elseif($bt == '32-33-35-36' && $good == 0 ) { - $good++; - }elseif($bt == '31-32-34-35' && $good == 0 ) { - $good++; - }elseif($bt == '29-30-32-33' && $good == 0 ) { - $good++; - }elseif($bt == '28-29-31-32' && $good == 0 ) { - $good++; - }elseif($bt == '26-27-29-30' && $good == 0 ) { - $good++; - }elseif($bt == '25-26-28-29' && $good == 0 ) { - $good++; - }elseif($bt == '23-24-26-27' && $good == 0 ) { - $good++; - }elseif($bt == '22-23-25-26' && $good == 0 ) { - $good++; - }elseif($bt == '20-21-23-24' && $good == 0 ) { - $good++; - }elseif($bt == '19-20-22-23' && $good == 0 ) { - $good++; - }elseif($bt == '17-18-20-21' && $good == 0 ) { - $good++; - }elseif($bt == '16-17-19-20' && $good == 0 ) { - $good++; - }elseif($bt == '14-15-17-18' && $good == 0 ) { - $good++; - }elseif($bt == '13-14-16-17' && $good == 0 ) { - $good++; - }elseif($bt == '11-12-14-15' && $good == 0 ) { - $good++; - }elseif($bt == '10-11-13-14' && $good == 0 ) { - $good++; - }elseif($bt == '8-9-11-12' && $good == 0 ) { - $good++; - }elseif($bt == '7-8-10-11' && $good == 0 ) { - $good++; - }elseif($bt == '5-6-8-9' && $good == 0 ) { - $good++; - }elseif($bt == '4-5-7-8' && $good == 0 ) { - $good++; - }elseif($bt == '2-3-5-6' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-4-5' && $good == 0 ) { - $good++; - }elseif($bt == '2-3-37' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-38' && $good == 0 ) { - $good++; - }elseif($bt == '38-1' && $good == 0 ) { - $good++; - }elseif($bt == '2-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36' && $good == 0 ) { - $good++; - }elseif($bt == '1-3-5-7-9-11-13-15-17-19-21-23-25-27-29-31-33-35' && $good == 0 ) { - $good++; - }elseif($bt == '19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18' && $good == 0 ) { - $good++; - }elseif($bt == '28-29-30-31-32-33' && $good == 0 ) { - $good++; - }elseif($bt == '22-23-24-25-26-27' && $good == 0 ) { - $good++; - }elseif($bt == '16-17-18-19-20-21' && $good == 0 ) { - $good++; - }elseif($bt == '10-11-12-13-14-15' && $good == 0 ) { - $good++; - }elseif($bt == '4-5-6-7-8-9' && $good == 0 ) { - $good++; - }elseif($bt == '31-32-33-34-35-36' && $good == 0 ) { - $good++; - }elseif($bt == '25-26-27-28-29-30' && $good == 0 ) { - $good++; - }elseif($bt == '19-20-21-22-23-24' && $good == 0 ) { - $good++; - }elseif($bt == '13-14-15-16-17-18' && $good == 0 ) { - $good++; - }elseif($bt == '7-8-9-10-11-12' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-3-4-5-6' && $good == 0 ) { - $good++; - }elseif($bt == '34-35-36' && $good == 0 ) { - $good++; - }elseif($bt == '31-32-33' && $good == 0 ) { - $good++; - }elseif($bt == '28-29-30' && $good == 0 ) { - $good++; - }elseif($bt == '25-26-27' && $good == 0 ) { - $good++; - }elseif($bt == '22-23-24' && $good == 0 ) { - $good++; - }elseif($bt == '19-20-21' && $good == 0 ) { - $good++; - }elseif($bt == '16-17-18' && $good == 0 ) { - $good++; - }elseif($bt == '13-14-15' && $good == 0 ) { - $good++; - }elseif($bt == '10-11-12' && $good == 0 ) { - $good++; - }elseif($bt == '7-8-9' && $good == 0 ) { - $good++; - }elseif($bt == '6-5-4' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-3' && $good == 0 ) { - $good++; - }elseif($bt == '3-6-9-12-15-18-21-24-27-30-33-36' && $good == 0 ) { - $good++; - }elseif($bt == '2-5-8-11-14-17-20-23-26-29-32-35' && $good == 0 ) { - $good++; - }elseif($bt == '1-4-7-10-13-16-19-22-25-28-31-34' && $good == 0 ) { - $good++; - }elseif($bt == '2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35' && $good==0) - { - $good++; - }elseif($bt == '1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36' && $good==0) - { - $good++; - }elseif($bt == '1-2-3-37-38' && $good==0) - { - $good++; - }elseif($bt == '1-2-3-4-5-6-7-8-9-10-11-12' && $good==0) - { - $good++; - }elseif($bt == '13-14-15-16-17-18-19-20-21-22-23-24' && $good==0) - { - $good++; - }elseif($bt == '25-26-27-28-29-30-31-32-33-34-35-36' && $good==0) - { - $good++; - }elseif($bt == '1-2-4-5' && $good==0) - { - $good++; - } - $_GET['coin'] = (int)$_GET['coin']; - if($_GET['coin']<1) - { - $good = 0; - } - if($_GET['coin']>$u->bank['money2']) - { - $good = 0; - } - if($good==1) - { - $u->bank['money2'] -= ((int)$_GET['coin']); - - $stvka = ''; - - if($stvka == '') { - $stvka = ' '; - } - - - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','[] ".mysql_real_escape_string($u->info['login'])." : ".(0+((int)$_GET['coin'])).".00 . ".$stvka.", ".$gid['id']."','".time()."','6','0')"); - - - mysql_query('UPDATE `bank` SET `money2` = '.$u->bank['money2'].' WHERE `id` = "'.$u->bank['id'].'" LIMIT 1'); - mysql_query('INSERT INTO `ruletka_coin` (`uid`,`login`,`money`,`time`,`game_id`,`win2`) VALUES ("'.$u->info['id'].'","'.$u->info['login'].'","'.$_GET['coin'].'","'.time().'","'.$gid['id'].'","'.$bt.'")'); - } - } - } - }else{ - $add = true; - } - - // - $pos = array( - 0 => '2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35', - 1 => '1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36', - 2 => '1-2-3-37-38', - 3 => '1-2-3-4-5-6-7-8-9-10-11-12', - 4 => '13-14-15-16-17-18-19-20-21-22-23-24', - 5 => '25-26-27-28-29-30-31-32-33-34-35-36', - 6 => '1-4-7-10-13-16-19-22-25-28-31-34', - 7 => '2-5-8-11-14-17-20-23-26-29-32-35', - 8 => '3-6-9-12-15-18-21-24-27-30-33-36', - 9 => '1-2-3', - 10 => '6-5-4', - 11 => '7-8-9', - 12 => '10-11-12', - 13 => '13-14-15', - 14 => '16-17-18', - 15 => '19-20-21', - 16 => '22-23-24', - 17 => '25-26-27', - 18 => '28-29-30', - 19 => '31-32-33', - 20 => '34-35-36', - 21 => '1-2-3-4-5-6', - 22 => '7-8-9-10-11-12', - 23 => '13-14-15-16-17-18', - 24 => '19-20-21-22-23-24', - 25 => '25-26-27-28-29-30', - 26 => '31-32-33-34-35-36', - 27 => '4-5-6-7-8-9', - 28 => '10-11-12-13-14-15', - 29 => '16-17-18-19-20-21', - 30 => '22-23-24-25-26-27', - 31 => '28-29-30-31-32-33', - 32 => '1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18', - 33 => '19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36', - 34 => '1-3-5-7-9-11-13-15-17-19-21-23-25-27-29-31-33-35', - 35 => '2-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36', - 36 => '38-1', - 37 => '1-2-38', - 38 => '2-3-37', - 39 => '32-33-35-36', - 40 => '31-32-34-35', - 41 => '29-30-32-33', - 42 => '28-29-31-32', - 43 => '26-27-29-30', - 44 => '25-26-28-29', - 45 => '23-24-26-27', - 46 => '22-23-25-26', - 47 => '20-21-23-24', - 48 => '19-20-22-23', - 49 => '17-18-20-21', - 50 => '16-17-19-20', - 51 => '14-15-17-18', - 52 => '13-14-16-17', - 53 => '11-12-14-15', - 54 => '10-11-13-14', - 55 => '8-9-11-12', - 56 => '7-8-10-11', - 57 => '5-6-8-9', - 58 => '4-5-7-8', - 59 => '2-3-5-6', - 60 => '1-2-4-5', - 61 => '1-2', - 62 => '2-3', - 63 => '4-5', - 64 => '5-6', - 65 => '7-8', - 66 => '8-9', - 67 => '10-11', - 68 => '11-12', - 69 => '13-14', - 70 => '14-15', - 71 => '16-17', - 72 => '17-18', - 73 => '19-20', - 74 => '20-21', - 75 => '22-23', - 76 => '23-24', - 77 => '25-26', - 78 => '26-27', - 79 => '28-29', - 80 => '29-30', - 81 => '31-32', - 82 => '32-33', - 83 => '34-35', - 84 => '35-36' - ); - - function testCoin($s,$stt) - { - global $u,$win; - $sp = mysql_query('SELECT * FROM `ruletka_coin` WHERE `game_id` = "'.$s.'" AND `money` > 0 AND `win2` = "'.$stt.'" AND `uid` != "'.$u->info['id'].'"'); - $cr = 0; $am = 0; - $usr = ''; $lu = array(); - while($pl = mysql_fetch_array($sp)) - { - $cr = $pl['money']; - if(!isset($lu[$pl['uid']]) && count($lu)<4) - { - $usr .= '-'.$pl['money']; - $lu[$pl['uid']] = true; - } - $am++; - } - $us = 0; // - $sp = mysql_query('SELECT * FROM `ruletka_coin` WHERE `game_id` = "'.$s.'" AND `money` > 0 AND `win2` = "'.$stt.'" AND `uid` = "'.$u->info['id'].'" LIMIT 100'); - while($pl = mysql_fetch_array($sp)) - { - $cr = $pl['money']; - $us += $pl['money']; - $am++; - } - $i = 0; - while($i<4) - { - if($i > count($lu)) - { - $usr .= '-0'; - } - $i++; - } - if($am>0) - { - $win[4] .= $stt.'|'.$cr.'-'.$us.''.$usr.','; - } - } - - // - $i = 1; - while($i<=38) - { - testCoin($gid['id'],$i); - $i++; - } - // - $i = 0; - while($i0,'room'=>$u->info['room'],'time'=>time(),'time_start'=>time()+74,'win'=>floor(rand(100,3800)/100),'win_line'=>'','end'=>0); - $s37 = mysql_fetch_array(mysql_query('SELECT `id` FROM `ruletka` WHERE `win` = "37" OR `win` = "38" AND `time` > "'.(time()-round(3600/10000*rand(5000,10000))).'" LIMIT 1')); - if(isset($s37['id'])) { - $gid2['win'] = floor(rand(100,3600)/100); - } - $ins = mysql_query('INSERT INTO `ruletka` (`room`,`time`,`time_start`,`win`,`win_line`) VALUES ("'.$gid2['room'].'","'.$gid2['time'].'","'.$gid2['time_start'].'","'.$gid2['win'].'","'.$gid2['win_line'].'")'); - $gid2['id'] = mysql_insert_id(); - if($ins) - { - $gid = $gid2; - } - unset($gid2); - } - - $u_w = array(0=>array(),1=>array(),2=>array(),3=>array()); - - $sm = $u->testAction('`city` = "'.$u->info['city'].'" AND `vars` = "casino_balance" LIMIT 1',1); - if(!isset($sm['id'])) { - $u->addAction(time(),'casino_balance',0); - } - - // - $sp = mysql_query('SELECT * FROM `ruletka` WHERE `end` = "0" AND `time_start` <= '.time().''); - while($pl = mysql_fetch_array($sp)) - { - /*$pl['win'] = floor(rand(10000000,360000000)/10000000); - if( rand(0,1) == 1 ) { - $pl['win'] = floor(rand(10000000,360000000)/10000000); - } - if( rand(0,1) == 1 ) { - $pl['win'] = floor(rand(10000000,360000000)/10000000); - }*/ - $end = mysql_query('UPDATE `ruletka` SET `end` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - if($end) - { - // - $sp2 = mysql_query('SELECT * FROM `ruletka_coin` WHERE `end` = "0" AND `game_id` = "'.$pl['id'].'"'); - while($pl2 = mysql_fetch_array($sp2)) - { - $upd = mysql_query('UPDATE `ruletka_coin` SET `end` = "'.time().'" WHERE `id` = "'.$pl2['id'].'" LIMIT 1'); - if($upd) - { - $wn = 0; $wn2 = 0; - $xv = 2; - if($pl2['win2']==$pl['win']) - { - $wn++; - }else{ - $i = 0; $j = explode('-',$pl2['win2']); - $xv = floor(1+34/count($j)); - while($i0) - { - // [x8], [x36] - if($pl['win']>36) - { - $nmn = ((int)$pl2['money']*35); - }else{ - $nmn = ((int)$pl2['money']*35); - } - mysql_query('UPDATE `bank` SET `money2` = `money2` + "'.$nmn.'" WHERE `uid` = "'.$pl2['uid'].'" ORDER BY `useNow` DESC LIMIT 1'); - }elseif($wn2>0) - { - // - $nmn = ((int)$pl2['money']*$xv); - mysql_query('UPDATE `bank` SET `money2` = `money2` + "'.$nmn.'" WHERE `uid` = "'.$pl2['uid'].'" ORDER BY `useNow` DESC LIMIT 1'); - }else{ - // - mysql_query('UPDATE `ruletka_coin` SET `end` = "1" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `actions` SET `vals` = `vals` + "'.mysql_real_escape_string(0+$pl2['money']).'" WHERE `id` = "'.$sm['id'].'" LIMIT 1'); - } - - if($wn > 0 || $wn2 > 0) { - $u->addDelo(1,$pl2['uid'],'"Casino.'.$u->info['city'].'": '.$nmn.' .',time(),$u->info['city'],'Casino.'.$u->info['city'].'',0,0); - if(!isset($u_w[1][$pl2['uid']])) { - $u_w[0][count($u_w[0])] = $pl2['uid']; - $u_w[2][count($u_w[0])-1] = $pl2['game_id']; - } - $u_w[1][$pl2['uid']] += (int)$nmn; - } - $u_w[3][$pl2['uid']] += (int)$pl2['money']; - - } - } - } - } - - if(count($u_w[0]) > 0) { - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','225','','',' ".$pl['login']." ".$nmn.".00 .','".time()."','6','0')"); - $i = 0; - while($i < count($u_w[0])) { - if($u_w[1][$u_w[0][$i]] > 0) { - $infu = mysql_fetch_array(mysql_query('SELECT + // , , + $gid = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `ruletka` WHERE (`end` = 0 OR `id` = "' . ((int)$_GET['id']) . '") ORDER BY `id` DESC LIMIT 1' + ) + ); + if ($gid['time_start'] + 16 > time() || isset($_GET['bet'])) { + $mnr = true; + } + $gid3 = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `ruletka` WHERE `end` >0 AND `id` = "' . ((int)$_GET['id']) . '" ORDER BY `id` DESC LIMIT 1' + ) + ); + if (isset($gid3['id'])) { + $gid = $gid3; + unset($gid3); + } + $add = false; + if (isset($gid['id'])) { + // , + $time = $gid['time_start'] - time(); + if ($time < 1) { + // + + //mysql_query('UPDATE `ruletka` SET `end` = "'.time().'" WHERE `id` = "'.$gid['id'].'" LIMIT 1'); + // + $win[0] = $gid['win']; + $win[1] = $gid['win_line']; + $win[2] = 0; + $win[3] = 0; + if ($gid['end'] == 0) { + $add = true; + } + } else { + // , + if (isset($_GET['bet'])) { + $bt = $_GET['bet']; + $good = 0; + $i = 0; + while ($i <= 38) { + if ($i == $bt) { + $good++; + } + $i++; + } + + /* + + + 1, ... ,36 - [x8] + + 2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35 - [x2] + 1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36 - [x2] + + 37 - [x36] + 38 - [x36] + + 1-2-3-37-38 - [x5] + + 1-2-3-4-5-6-7-8-9-10-11-12 - 1 [x3] + 13-14-15-16-17-18-19-20-21-22-23-24 - 2 [x3] + 25-26-27-28-29-30-31-32-33-34-35-36 - 3 [x3] + + */ + + if ($bt == '' && $good == 0) { + $good++; + } elseif ($bt == '35-36' && $good == 0) { + $good++; + } elseif ($bt == '34-35' && $good == 0) { + $good++; + } elseif ($bt == '32-33' && $good == 0) { + $good++; + } elseif ($bt == '31-32' && $good == 0) { + $good++; + } elseif ($bt == '29-30' && $good == 0) { + $good++; + } elseif ($bt == '28-29' && $good == 0) { + $good++; + } elseif ($bt == '26-27' && $good == 0) { + $good++; + } elseif ($bt == '25-26' && $good == 0) { + $good++; + } elseif ($bt == '23-24' && $good == 0) { + $good++; + } elseif ($bt == '22-23' && $good == 0) { + $good++; + } elseif ($bt == '20-21' && $good == 0) { + $good++; + } elseif ($bt == '19-20' && $good == 0) { + $good++; + } elseif ($bt == '17-18' && $good == 0) { + $good++; + } elseif ($bt == '16-17' && $good == 0) { + $good++; + } elseif ($bt == '14-15' && $good == 0) { + $good++; + } elseif ($bt == '13-14' && $good == 0) { + $good++; + } elseif ($bt == '11-12' && $good == 0) { + $good++; + } elseif ($bt == '10-11' && $good == 0) { + $good++; + } elseif ($bt == '8-9' && $good == 0) { + $good++; + } elseif ($bt == '7-8' && $good == 0) { + $good++; + } elseif ($bt == '5-6' && $good == 0) { + $good++; + } elseif ($bt == '4-5' && $good == 0) { + $good++; + } elseif ($bt == '2-3' && $good == 0) { + $good++; + } elseif ($bt == '1-2' && $good == 0) { + $good++; + } elseif ($bt == '32-33-35-36' && $good == 0) { + $good++; + } elseif ($bt == '31-32-34-35' && $good == 0) { + $good++; + } elseif ($bt == '29-30-32-33' && $good == 0) { + $good++; + } elseif ($bt == '28-29-31-32' && $good == 0) { + $good++; + } elseif ($bt == '26-27-29-30' && $good == 0) { + $good++; + } elseif ($bt == '25-26-28-29' && $good == 0) { + $good++; + } elseif ($bt == '23-24-26-27' && $good == 0) { + $good++; + } elseif ($bt == '22-23-25-26' && $good == 0) { + $good++; + } elseif ($bt == '20-21-23-24' && $good == 0) { + $good++; + } elseif ($bt == '19-20-22-23' && $good == 0) { + $good++; + } elseif ($bt == '17-18-20-21' && $good == 0) { + $good++; + } elseif ($bt == '16-17-19-20' && $good == 0) { + $good++; + } elseif ($bt == '14-15-17-18' && $good == 0) { + $good++; + } elseif ($bt == '13-14-16-17' && $good == 0) { + $good++; + } elseif ($bt == '11-12-14-15' && $good == 0) { + $good++; + } elseif ($bt == '10-11-13-14' && $good == 0) { + $good++; + } elseif ($bt == '8-9-11-12' && $good == 0) { + $good++; + } elseif ($bt == '7-8-10-11' && $good == 0) { + $good++; + } elseif ($bt == '5-6-8-9' && $good == 0) { + $good++; + } elseif ($bt == '4-5-7-8' && $good == 0) { + $good++; + } elseif ($bt == '2-3-5-6' && $good == 0) { + $good++; + } elseif ($bt == '1-2-4-5' && $good == 0) { + $good++; + } elseif ($bt == '2-3-37' && $good == 0) { + $good++; + } elseif ($bt == '1-2-38' && $good == 0) { + $good++; + } elseif ($bt == '38-1' && $good == 0) { + $good++; + } elseif ($bt == '2-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36' && $good == 0) { + $good++; + } elseif ($bt == '1-3-5-7-9-11-13-15-17-19-21-23-25-27-29-31-33-35' && $good == 0) { + $good++; + } elseif ($bt == '19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18' && $good == 0) { + $good++; + } elseif ($bt == '28-29-30-31-32-33' && $good == 0) { + $good++; + } elseif ($bt == '22-23-24-25-26-27' && $good == 0) { + $good++; + } elseif ($bt == '16-17-18-19-20-21' && $good == 0) { + $good++; + } elseif ($bt == '10-11-12-13-14-15' && $good == 0) { + $good++; + } elseif ($bt == '4-5-6-7-8-9' && $good == 0) { + $good++; + } elseif ($bt == '31-32-33-34-35-36' && $good == 0) { + $good++; + } elseif ($bt == '25-26-27-28-29-30' && $good == 0) { + $good++; + } elseif ($bt == '19-20-21-22-23-24' && $good == 0) { + $good++; + } elseif ($bt == '13-14-15-16-17-18' && $good == 0) { + $good++; + } elseif ($bt == '7-8-9-10-11-12' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3-4-5-6' && $good == 0) { + $good++; + } elseif ($bt == '34-35-36' && $good == 0) { + $good++; + } elseif ($bt == '31-32-33' && $good == 0) { + $good++; + } elseif ($bt == '28-29-30' && $good == 0) { + $good++; + } elseif ($bt == '25-26-27' && $good == 0) { + $good++; + } elseif ($bt == '22-23-24' && $good == 0) { + $good++; + } elseif ($bt == '19-20-21' && $good == 0) { + $good++; + } elseif ($bt == '16-17-18' && $good == 0) { + $good++; + } elseif ($bt == '13-14-15' && $good == 0) { + $good++; + } elseif ($bt == '10-11-12' && $good == 0) { + $good++; + } elseif ($bt == '7-8-9' && $good == 0) { + $good++; + } elseif ($bt == '6-5-4' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3' && $good == 0) { + $good++; + } elseif ($bt == '3-6-9-12-15-18-21-24-27-30-33-36' && $good == 0) { + $good++; + } elseif ($bt == '2-5-8-11-14-17-20-23-26-29-32-35' && $good == 0) { + $good++; + } elseif ($bt == '1-4-7-10-13-16-19-22-25-28-31-34' && $good == 0) { + $good++; + } elseif ($bt == '2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35' && $good == 0) { + $good++; + } elseif ($bt == '1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3-37-38' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3-4-5-6-7-8-9-10-11-12' && $good == 0) { + $good++; + } elseif ($bt == '13-14-15-16-17-18-19-20-21-22-23-24' && $good == 0) { + $good++; + } elseif ($bt == '25-26-27-28-29-30-31-32-33-34-35-36' && $good == 0) { + $good++; + } elseif ($bt == '1-2-4-5' && $good == 0) { + $good++; + } + $_GET['coin'] = (int)$_GET['coin']; + if ($_GET['coin'] < 1) { + $good = 0; + } + if ($_GET['coin'] > $u->bank['money2']) { + $good = 0; + } + if ($good == 1) { + $u->bank['money2'] -= ((int)$_GET['coin']); + + $stvka = ''; + + if ($stvka == '') { + $stvka = ' '; + } + + + mysql_query( + "INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','','[] " . mysql_real_escape_string( + $u->info['login'] + ) . " : " . (0 + ((int)$_GET['coin'])) . ".00 . " . $stvka . ", " . $gid['id'] . "','" . time( + ) . "','6','0')" + ); + + + mysql_query( + 'UPDATE `bank` SET `money2` = ' . $u->bank['money2'] . ' WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1' + ); + mysql_query( + 'INSERT INTO `ruletka_coin` (`uid`,`login`,`money`,`time`,`game_id`,`win2`) VALUES ("' . $u->info['id'] . '","' . $u->info['login'] . '","' . $_GET['coin'] . '","' . time( + ) . '","' . $gid['id'] . '","' . $bt . '")' + ); + } + } + } + } else { + $add = true; + } + + // + $pos = [ + 0 => '2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35', + 1 => '1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36', + 2 => '1-2-3-37-38', + 3 => '1-2-3-4-5-6-7-8-9-10-11-12', + 4 => '13-14-15-16-17-18-19-20-21-22-23-24', + 5 => '25-26-27-28-29-30-31-32-33-34-35-36', + 6 => '1-4-7-10-13-16-19-22-25-28-31-34', + 7 => '2-5-8-11-14-17-20-23-26-29-32-35', + 8 => '3-6-9-12-15-18-21-24-27-30-33-36', + 9 => '1-2-3', + 10 => '6-5-4', + 11 => '7-8-9', + 12 => '10-11-12', + 13 => '13-14-15', + 14 => '16-17-18', + 15 => '19-20-21', + 16 => '22-23-24', + 17 => '25-26-27', + 18 => '28-29-30', + 19 => '31-32-33', + 20 => '34-35-36', + 21 => '1-2-3-4-5-6', + 22 => '7-8-9-10-11-12', + 23 => '13-14-15-16-17-18', + 24 => '19-20-21-22-23-24', + 25 => '25-26-27-28-29-30', + 26 => '31-32-33-34-35-36', + 27 => '4-5-6-7-8-9', + 28 => '10-11-12-13-14-15', + 29 => '16-17-18-19-20-21', + 30 => '22-23-24-25-26-27', + 31 => '28-29-30-31-32-33', + 32 => '1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18', + 33 => '19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36', + 34 => '1-3-5-7-9-11-13-15-17-19-21-23-25-27-29-31-33-35', + 35 => '2-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36', + 36 => '38-1', + 37 => '1-2-38', + 38 => '2-3-37', + 39 => '32-33-35-36', + 40 => '31-32-34-35', + 41 => '29-30-32-33', + 42 => '28-29-31-32', + 43 => '26-27-29-30', + 44 => '25-26-28-29', + 45 => '23-24-26-27', + 46 => '22-23-25-26', + 47 => '20-21-23-24', + 48 => '19-20-22-23', + 49 => '17-18-20-21', + 50 => '16-17-19-20', + 51 => '14-15-17-18', + 52 => '13-14-16-17', + 53 => '11-12-14-15', + 54 => '10-11-13-14', + 55 => '8-9-11-12', + 56 => '7-8-10-11', + 57 => '5-6-8-9', + 58 => '4-5-7-8', + 59 => '2-3-5-6', + 60 => '1-2-4-5', + 61 => '1-2', + 62 => '2-3', + 63 => '4-5', + 64 => '5-6', + 65 => '7-8', + 66 => '8-9', + 67 => '10-11', + 68 => '11-12', + 69 => '13-14', + 70 => '14-15', + 71 => '16-17', + 72 => '17-18', + 73 => '19-20', + 74 => '20-21', + 75 => '22-23', + 76 => '23-24', + 77 => '25-26', + 78 => '26-27', + 79 => '28-29', + 80 => '29-30', + 81 => '31-32', + 82 => '32-33', + 83 => '34-35', + 84 => '35-36', + ]; + + function testCoin($s, $stt) + { + global $u, $win; + $sp = mysql_query( + 'SELECT * FROM `ruletka_coin` WHERE `game_id` = "' . $s . '" AND `money` > 0 AND `win2` = "' . $stt . '" AND `uid` != "' . $u->info['id'] . '"' + ); + $cr = 0; + $am = 0; + $usr = ''; + $lu = []; + while ($pl = mysql_fetch_array($sp)) { + $cr = $pl['money']; + if (!isset($lu[$pl['uid']]) && count($lu) < 4) { + $usr .= '-' . $pl['money']; + $lu[$pl['uid']] = true; + } + $am++; + } + $us = 0; // + $sp = mysql_query( + 'SELECT * FROM `ruletka_coin` WHERE `game_id` = "' . $s . '" AND `money` > 0 AND `win2` = "' . $stt . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 100' + ); + while ($pl = mysql_fetch_array($sp)) { + $cr = $pl['money']; + $us += $pl['money']; + $am++; + } + $i = 0; + while ($i < 4) { + if ($i > count($lu)) { + $usr .= '-0'; + } + $i++; + } + if ($am > 0) { + $win[4] .= $stt . '|' . $cr . '-' . $us . '' . $usr . ','; + } + } + + // + $i = 1; + while ($i <= 38) { + testCoin($gid['id'], $i); + $i++; + } + // + $i = 0; + while ($i < count($pos)) { + testCoin($gid['id'], $pos[$i]); + $i++; + } + + if ($add) { + // + $gid2 = ['id' => 0, 'room' => $u->info['room'], 'time' => time(), 'time_start' => time() + 74, 'win' => floor( + rand(100, 3800) / 100 + ), 'win_line' => '', 'end' => 0]; + $s37 = mysql_fetch_array( + mysql_query( + 'SELECT `id` FROM `ruletka` WHERE `win` = "37" OR `win` = "38" AND `time` > "' . (time() - round( + 3600 / 10000 * rand(5000, 10000) + )) . '" LIMIT 1' + ) + ); + if (isset($s37['id'])) { + $gid2['win'] = floor(rand(100, 3600) / 100); + } + $ins = mysql_query( + 'INSERT INTO `ruletka` (`room`,`time`,`time_start`,`win`,`win_line`) VALUES ("' . $gid2['room'] . '","' . $gid2['time'] . '","' . $gid2['time_start'] . '","' . $gid2['win'] . '","' . $gid2['win_line'] . '")' + ); + $gid2['id'] = mysql_insert_id(); + if ($ins) { + $gid = $gid2; + } + unset($gid2); + } + + $u_w = [0 => [], 1 => [], 2 => [], 3 => []]; + + $sm = $u->testAction('`city` = "' . $u->info['city'] . '" AND `vars` = "casino_balance" LIMIT 1', 1); + if (!isset($sm['id'])) { + $u->addAction(time(), 'casino_balance', 0); + } + + // + $sp = mysql_query('SELECT * FROM `ruletka` WHERE `end` = "0" AND `time_start` <= ' . time() . ''); + while ($pl = mysql_fetch_array($sp)) { + $end = mysql_query('UPDATE `ruletka` SET `end` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + if ($end) { + // + $sp2 = mysql_query('SELECT * FROM `ruletka_coin` WHERE `end` = "0" AND `game_id` = "' . $pl['id'] . '"'); + while ($pl2 = mysql_fetch_array($sp2)) { + $upd = mysql_query( + 'UPDATE `ruletka_coin` SET `end` = "' . time() . '" WHERE `id` = "' . $pl2['id'] . '" LIMIT 1' + ); + if ($upd) { + $wn = 0; + $wn2 = 0; + $xv = 2; + if ($pl2['win2'] == $pl['win']) { + $wn++; + } else { + $i = 0; + $j = explode('-', $pl2['win2']); + $xv = floor(1 + 34 / count($j)); + while ($i < count($j)) { + if ($j[$i] == $pl['win']) { + $wn2++; + } + $i++; + } + } + + if ($wn > 0) { + // [x8], [x36] + if ($pl['win'] > 36) { + $nmn = ((int)$pl2['money'] * 35); + } else { + $nmn = ((int)$pl2['money'] * 35); + } + mysql_query( + 'UPDATE `bank` SET `money2` = `money2` + "' . $nmn . '" WHERE `uid` = "' . $pl2['uid'] . '" ORDER BY `useNow` DESC LIMIT 1' + ); + } elseif ($wn2 > 0) { + // + $nmn = ((int)$pl2['money'] * $xv); + mysql_query( + 'UPDATE `bank` SET `money2` = `money2` + "' . $nmn . '" WHERE `uid` = "' . $pl2['uid'] . '" ORDER BY `useNow` DESC LIMIT 1' + ); + } else { + // + mysql_query('UPDATE `ruletka_coin` SET `end` = "1" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `actions` SET `vals` = `vals` + "' . mysql_real_escape_string( + 0 + $pl2['money'] + ) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1' + ); + } + + if ($wn > 0 || $wn2 > 0) { + $u->addDelo( + 1, $pl2['uid'], + '"Casino.' . $u->info['city'] . '": ' . $nmn . ' .', + time(), $u->info['city'], 'Casino.' . $u->info['city'] . '', 0, 0 + ); + if (!isset($u_w[1][$pl2['uid']])) { + $u_w[0][count($u_w[0])] = $pl2['uid']; + $u_w[2][count($u_w[0]) - 1] = $pl2['game_id']; + } + $u_w[1][$pl2['uid']] += (int)$nmn; + } + $u_w[3][$pl2['uid']] += (int)$pl2['money']; + + } + } + } + } + + if (count($u_w[0]) > 0) { + $i = 0; + while ($i < count($u_w[0])) { + if ($u_w[1][$u_w[0][$i]] > 0) { + $infu = mysql_fetch_array( + mysql_query( + 'SELECT `u`.`id`, `u`.`align`, `u`.`login`, @@ -668,56 +632,63 @@ if($u->room['name']!=' `u`.`online`, `u`.`sex`, `u`.`cityreg` - FROM `users` AS `u` WHERE `u`.`id`="'.mysql_real_escape_string($u_w[0][$i]).'" LIMIT 1')); - - mysql_query('UPDATE `actions` SET `vals` = `vals` + "'.mysql_real_escape_string((0+$u_w[3][$u_w[0][$i]])-$u_w[1][$u_w[0][$i]]).'" WHERE `id` = "'.$sm['id'].'" LIMIT 1'); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','389','','','[] ".mysql_real_escape_string($infu['login'])." ".$u_w[1][$u_w[0][$i]].".00 ., : ".(0+$u_w[3][$u_w[0][$i]]).".00 ., ".$u_w[2][$i]."','".time()."','6','0')"); - } - $i++; - } - } - - if(isset($gid['id'])) - { - if($time<0) - { - $time = 0; - } - // - if($time>0) - { - // - $status = 1; - $sp = mysql_query('SELECT * FROM `ruletka_coin` WHERE `end` = "0" AND `uid` = "'.$u->info['id'].'" AND `game_id` = "'.$gid['id'].'"'); - $win[3] = 0; - while($pl = mysql_fetch_array($sp)) - { - $win[3] += $pl['money']; - } - }else{ - // - $status = 2; - // + - $sp = mysql_query('SELECT * FROM `ruletka_coin` WHERE `end` > "0" AND `uid` = "'.$u->info['id'].'" AND `game_id` = "'.$gid['id'].'"'); - $win[2] = 0; - while($pl = mysql_fetch_array($sp)) - { - $win[2] += $pl['money']; - $win[3] += $pl['money']; - $win[1] += $pl['money']; - } - } - if($win[0]>0) - { - unset($mnr); - } - if(isset($mnr)) - { - $mnr = '&cash='.floor(0+$u->bank['money2']); - } - $r = 'time='.$time.'&game='.$gid['id'].''.$mnr.'&betsum='.$win[3].'&status='.$status.'&players='.$win[5].'&bets='.$win[4].'&win='.$win[0].'&wbets='.$win[1].'&wmoney='.$win[2].''; - echo $r; - } + FROM `users` AS `u` WHERE `u`.`id`="' . mysql_real_escape_string($u_w[0][$i]) . '" LIMIT 1' + ) + ); + + mysql_query( + 'UPDATE `actions` SET `vals` = `vals` + "' . mysql_real_escape_string( + (0 + $u_w[3][$u_w[0][$i]]) - $u_w[1][$u_w[0][$i]] + ) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1' + ); + mysql_query( + "INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','389','','','[] " . mysql_real_escape_string( + $infu['login'] + ) . " " . $u_w[1][$u_w[0][$i]] . ".00 ., : " . (0 + $u_w[3][$u_w[0][$i]]) . ".00 ., " . $u_w[2][$i] . "','" . time( + ) . "','6','0')" + ); + } + $i++; + } + } + + if (isset($gid['id'])) { + if ($time < 0) { + $time = 0; + } + // + if ($time > 0) { + // + $status = 1; + $sp = mysql_query( + 'SELECT * FROM `ruletka_coin` WHERE `end` = "0" AND `uid` = "' . $u->info['id'] . '" AND `game_id` = "' . $gid['id'] . '"' + ); + $win[3] = 0; + while ($pl = mysql_fetch_array($sp)) { + $win[3] += $pl['money']; + } + } else { + // + $status = 2; + // + + $sp = mysql_query( + 'SELECT * FROM `ruletka_coin` WHERE `end` > "0" AND `uid` = "' . $u->info['id'] . '" AND `game_id` = "' . $gid['id'] . '"' + ); + $win[2] = 0; + while ($pl = mysql_fetch_array($sp)) { + $win[2] += $pl['money']; + $win[3] += $pl['money']; + $win[1] += $pl['money']; + } + } + if ($win[0] > 0) { + unset($mnr); + } + if (isset($mnr)) { + $mnr = '&cash=' . floor(0 + $u->bank['money2']); + } + $r = 'time=' . $time . '&game=' . $gid['id'] . '' . $mnr . '&betsum=' . $win[3] . '&status=' . $status . '&players=' . $win[5] . '&bets=' . $win[4] . '&win=' . $win[0] . '&wbets=' . $win[1] . '&wmoney=' . $win[2] . ''; + echo $r; + } } -//mysql_query('UNLOCK TABLES'); -?> \ No newline at end of file + diff --git a/ruletka2.php b/ruletka2.php index 19e23b4e..f7aff6d1 100644 --- a/ruletka2.php +++ b/ruletka2.php @@ -1,662 +1,646 @@ bank['id'])) { - //die(); +if ($u->info['level'] <= 7) { + die(''); } - if($u->info['level'] <= 7 ) { - die(''); - } - - mysql_query("LOCK TABLES +mysql_query( + "LOCK TABLES `actions` WRITE, `bank` WRITE, - `users` WRITE, `users_delo` WRITE, - `chat` WRITE, - `stats` WRITE, - `ruletka` WRITE, `ruletka_coin` WRITE, - - `bandit` WRITE;"); + `bandit` WRITE;" +); + +/* +33|2-0-0-0-2-0, +32|4-0-0-0-4-6, +11|4-0-0-42-4-0, +21|2-0-0-0-2-0, +2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35|8-0-8-0-0-0, +7|4-0-0-0-4-0, +2|4-0-0-0-4-0, +17|4-0-0-4-4-0, +1|6-0-0-0-0-6, +18|4-0-0-0-4-0, +30|4-0-0-6-4-6, +16|4-0-0-0-4-0, +13|4-0-0-0-4-0, +25|6-0-0-0-0-6, +27|2-0-0-0-2-0, +36|2-0-0-0-2-0, +3|4-0-0-0-4-0, +20|4-0-0-0-4-0, +8|8-0-0-16-4-0, +38|2-0-0-0-2-6, +4|8-0-0-16-0-0, +34|4-0-0-0-4-0, +37|1-0-0-0-4-7, +19|2-0-0-0-2-0, +10|4-0-0-10-2-0, +31|6-0-0-6-4-0 +*/ + +if ($u->room['name'] != '') { + die(); +} else { + + // - /* - 33|2-0-0-0-2-0, - 32|4-0-0-0-4-6, - 11|4-0-0-42-4-0, - 21|2-0-0-0-2-0, - 2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35|8-0-8-0-0-0, - 7|4-0-0-0-4-0, - 2|4-0-0-0-4-0, - 17|4-0-0-4-4-0, - 1|6-0-0-0-0-6, - 18|4-0-0-0-4-0, - 30|4-0-0-6-4-6, - 16|4-0-0-0-4-0, - 13|4-0-0-0-4-0, - 25|6-0-0-0-0-6, - 27|2-0-0-0-2-0, - 36|2-0-0-0-2-0, - 3|4-0-0-0-4-0, - 20|4-0-0-0-4-0, - 8|8-0-0-16-4-0, - 38|2-0-0-0-2-6, - 4|8-0-0-16-0-0, - 34|4-0-0-0-4-0, - 37|1-0-0-0-4-7, - 19|2-0-0-0-2-0, - 10|4-0-0-10-2-0, - 31|6-0-0-6-4-0 - */ + function get2str($key = '', $val = '') + { + $get = $_GET; + if (is_array($key)) { + if (count($key) > 0) { + foreach ($key as $k => $v) { + $get[$k] = $v; + } + } + } else { + $get[$key] = $val; + } + if (count($get) > 0) { + foreach ($get as $k => $v) { + if (empty($v)) { + unset($get[$k]); + } + } + } + if (count($get) > 0) { + foreach ($get as $k => $v) { + $get[$k] = $k . '=' . urlencode($v); + } + return '?' . implode('&', $get); + } + } -if($u->room['name']!='') -{ - die(); -}else{ - - // - - - function get2str($key='', $val='') { - $get = $_GET; - if ( is_array($key) ) { - if ( count($key)>0 ) foreach ( $key as $k=>$v ) $get[$k] = $v; - } else $get[$key] = $val; - if ( count($get)>0 ) { - foreach ( $get as $k=>$v ) if ( empty($v) ) unset($get[$k]); - } - if ( count($get)>0 ) { - foreach ( $get as $k=>$v ) $get[$k] = $k.'='.urlencode($v); - return '?'.implode('&', $get); - } - } + $r = ''; + $time = 74; // + $status = 0; // , 2 - + $win = [ + 0 => 0, // + 1 => '', // + 2 => 0, // + 3 => 0, // + // + 4 => '', + // + 5 => '', + ]; - $r = ''; - $time = 74; // - $status = 0; // , 2 - - $win = array( - 0 => 0, // - 1 => '', // - 2 => 0, // - 3 => 0, // - // - 4 => '', - // - 5 => '' - ); - - // , , - $gid = mysql_fetch_array(mysql_query('SELECT * FROM `ruletka` WHERE (`end` = 0 OR `id` = "'.((int)$_GET['id']).'") ORDER BY `id` DESC LIMIT 1')); - if($gid['time_start']+16>time() || isset($_GET['bet'])) - { - $mnr = true; - } - $gid3 = mysql_fetch_array(mysql_query('SELECT * FROM `ruletka` WHERE `end` >0 AND `id` = "'.((int)$_GET['id']).'" ORDER BY `id` DESC LIMIT 1')); - if(isset($gid3['id'])) - { - $gid = $gid3; - unset($gid3); - } - $add = false; - if(isset($gid['id'])) - { - // , - $time = $gid['time_start']-time(); - if($time<1) - { - // + - //mysql_query('UPDATE `ruletka` SET `end` = "'.time().'" WHERE `id` = "'.$gid['id'].'" LIMIT 1'); - // - $win[0] = $gid['win']; - $win[1] = $gid['win_line']; - $win[2] = 0; - $win[3] = 0; - if($gid['end']==0) - { - $add = true; - } - }else{ - // , - if(isset($_GET['bet'])) - { - $bt = $_GET['bet']; - $good = 0; - $i = 0; - while($i<=38) - { - if($i==$bt) - { - $good++; - } - $i++; - } - - /* - - - 1, ... ,36 - [x8] - - 2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35 - [x2] - 1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36 - [x2] - - 37 - [x36] - 38 - [x36] - - 1-2-3-37-38 - [x5] - - 1-2-3-4-5-6-7-8-9-10-11-12 - 1 [x3] - 13-14-15-16-17-18-19-20-21-22-23-24 - 2 [x3] - 25-26-27-28-29-30-31-32-33-34-35-36 - 3 [x3] - - */ - - if($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '' && $good == 0 ) { - $good++; - }elseif($bt == '35-36' && $good == 0 ) { - $good++; - }elseif($bt == '34-35' && $good == 0 ) { - $good++; - }elseif($bt == '32-33' && $good == 0 ) { - $good++; - }elseif($bt == '31-32' && $good == 0 ) { - $good++; - }elseif($bt == '29-30' && $good == 0 ) { - $good++; - }elseif($bt == '28-29' && $good == 0 ) { - $good++; - }elseif($bt == '26-27' && $good == 0 ) { - $good++; - }elseif($bt == '25-26' && $good == 0 ) { - $good++; - }elseif($bt == '23-24' && $good == 0 ) { - $good++; - }elseif($bt == '22-23' && $good == 0 ) { - $good++; - }elseif($bt == '20-21' && $good == 0 ) { - $good++; - }elseif($bt == '19-20' && $good == 0 ) { - $good++; - }elseif($bt == '17-18' && $good == 0 ) { - $good++; - }elseif($bt == '16-17' && $good == 0 ) { - $good++; - }elseif($bt == '14-15' && $good == 0 ) { - $good++; - }elseif($bt == '13-14' && $good == 0 ) { - $good++; - }elseif($bt == '11-12' && $good == 0 ) { - $good++; - }elseif($bt == '10-11' && $good == 0 ) { - $good++; - }elseif($bt == '8-9' && $good == 0 ) { - $good++; - }elseif($bt == '7-8' && $good == 0 ) { - $good++; - }elseif($bt == '5-6' && $good == 0 ) { - $good++; - }elseif($bt == '4-5' && $good == 0 ) { - $good++; - }elseif($bt == '2-3' && $good == 0 ) { - $good++; - }elseif($bt == '1-2' && $good == 0 ) { - $good++; - }elseif($bt == '32-33-35-36' && $good == 0 ) { - $good++; - }elseif($bt == '31-32-34-35' && $good == 0 ) { - $good++; - }elseif($bt == '29-30-32-33' && $good == 0 ) { - $good++; - }elseif($bt == '28-29-31-32' && $good == 0 ) { - $good++; - }elseif($bt == '26-27-29-30' && $good == 0 ) { - $good++; - }elseif($bt == '25-26-28-29' && $good == 0 ) { - $good++; - }elseif($bt == '23-24-26-27' && $good == 0 ) { - $good++; - }elseif($bt == '22-23-25-26' && $good == 0 ) { - $good++; - }elseif($bt == '20-21-23-24' && $good == 0 ) { - $good++; - }elseif($bt == '19-20-22-23' && $good == 0 ) { - $good++; - }elseif($bt == '17-18-20-21' && $good == 0 ) { - $good++; - }elseif($bt == '16-17-19-20' && $good == 0 ) { - $good++; - }elseif($bt == '14-15-17-18' && $good == 0 ) { - $good++; - }elseif($bt == '13-14-16-17' && $good == 0 ) { - $good++; - }elseif($bt == '11-12-14-15' && $good == 0 ) { - $good++; - }elseif($bt == '10-11-13-14' && $good == 0 ) { - $good++; - }elseif($bt == '8-9-11-12' && $good == 0 ) { - $good++; - }elseif($bt == '7-8-10-11' && $good == 0 ) { - $good++; - }elseif($bt == '5-6-8-9' && $good == 0 ) { - $good++; - }elseif($bt == '4-5-7-8' && $good == 0 ) { - $good++; - }elseif($bt == '2-3-5-6' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-4-5' && $good == 0 ) { - $good++; - }elseif($bt == '2-3-37' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-38' && $good == 0 ) { - $good++; - }elseif($bt == '38-1' && $good == 0 ) { - $good++; - }elseif($bt == '2-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36' && $good == 0 ) { - $good++; - }elseif($bt == '1-3-5-7-9-11-13-15-17-19-21-23-25-27-29-31-33-35' && $good == 0 ) { - $good++; - }elseif($bt == '19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18' && $good == 0 ) { - $good++; - }elseif($bt == '28-29-30-31-32-33' && $good == 0 ) { - $good++; - }elseif($bt == '22-23-24-25-26-27' && $good == 0 ) { - $good++; - }elseif($bt == '16-17-18-19-20-21' && $good == 0 ) { - $good++; - }elseif($bt == '10-11-12-13-14-15' && $good == 0 ) { - $good++; - }elseif($bt == '4-5-6-7-8-9' && $good == 0 ) { - $good++; - }elseif($bt == '31-32-33-34-35-36' && $good == 0 ) { - $good++; - }elseif($bt == '25-26-27-28-29-30' && $good == 0 ) { - $good++; - }elseif($bt == '19-20-21-22-23-24' && $good == 0 ) { - $good++; - }elseif($bt == '13-14-15-16-17-18' && $good == 0 ) { - $good++; - }elseif($bt == '7-8-9-10-11-12' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-3-4-5-6' && $good == 0 ) { - $good++; - }elseif($bt == '34-35-36' && $good == 0 ) { - $good++; - }elseif($bt == '31-32-33' && $good == 0 ) { - $good++; - }elseif($bt == '28-29-30' && $good == 0 ) { - $good++; - }elseif($bt == '25-26-27' && $good == 0 ) { - $good++; - }elseif($bt == '22-23-24' && $good == 0 ) { - $good++; - }elseif($bt == '19-20-21' && $good == 0 ) { - $good++; - }elseif($bt == '16-17-18' && $good == 0 ) { - $good++; - }elseif($bt == '13-14-15' && $good == 0 ) { - $good++; - }elseif($bt == '10-11-12' && $good == 0 ) { - $good++; - }elseif($bt == '7-8-9' && $good == 0 ) { - $good++; - }elseif($bt == '6-5-4' && $good == 0 ) { - $good++; - }elseif($bt == '1-2-3' && $good == 0 ) { - $good++; - }elseif($bt == '3-6-9-12-15-18-21-24-27-30-33-36' && $good == 0 ) { - $good++; - }elseif($bt == '2-5-8-11-14-17-20-23-26-29-32-35' && $good == 0 ) { - $good++; - }elseif($bt == '1-4-7-10-13-16-19-22-25-28-31-34' && $good == 0 ) { - $good++; - }elseif($bt == '2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35' && $good==0) - { - $good++; - }elseif($bt == '1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36' && $good==0) - { - $good++; - }elseif($bt == '1-2-3-37-38' && $good==0) - { - $good++; - }elseif($bt == '1-2-3-4-5-6-7-8-9-10-11-12' && $good==0) - { - $good++; - }elseif($bt == '13-14-15-16-17-18-19-20-21-22-23-24' && $good==0) - { - $good++; - }elseif($bt == '25-26-27-28-29-30-31-32-33-34-35-36' && $good==0) - { - $good++; - }elseif($bt == '1-2-4-5' && $good==0) - { - $good++; - } - $_GET['coin'] = (int)$_GET['coin']; - if($_GET['coin']<1) - { - $good = 0; - } - if($_GET['coin']>$u->bank['money1']) - { - $good = 0; - } - if($good==1) - { - $u->bank['money1'] -= ((int)$_GET['coin']); - - $stvka = ''; - - if($stvka == '') { - $stvka = ' '; - } - - - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','[] ".mysql_real_escape_string($u->info['login'])." : ".(0+((int)$_GET['coin'])).".00 . ".$stvka.", ".$gid['id']."','".time()."','6','0')"); - - - mysql_query('UPDATE `bank` SET `money1` = '.$u->bank['money1'].' WHERE `id` = "'.$u->bank['id'].'" LIMIT 1'); - mysql_query('INSERT INTO `ruletka_coin` (`uid`,`login`,`money`,`time`,`game_id`,`win2`) VALUES ("'.$u->info['id'].'","'.$u->info['login'].'","'.$_GET['coin'].'","'.time().'","'.$gid['id'].'","'.$bt.'")'); - } - } - } - }else{ - $add = true; - } - - // - $pos = array( - 0 => '2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35', - 1 => '1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36', - 2 => '1-2-3-37-38', - 3 => '1-2-3-4-5-6-7-8-9-10-11-12', - 4 => '13-14-15-16-17-18-19-20-21-22-23-24', - 5 => '25-26-27-28-29-30-31-32-33-34-35-36', - 6 => '1-4-7-10-13-16-19-22-25-28-31-34', - 7 => '2-5-8-11-14-17-20-23-26-29-32-35', - 8 => '3-6-9-12-15-18-21-24-27-30-33-36', - 9 => '1-2-3', - 10 => '6-5-4', - 11 => '7-8-9', - 12 => '10-11-12', - 13 => '13-14-15', - 14 => '16-17-18', - 15 => '19-20-21', - 16 => '22-23-24', - 17 => '25-26-27', - 18 => '28-29-30', - 19 => '31-32-33', - 20 => '34-35-36', - 21 => '1-2-3-4-5-6', - 22 => '7-8-9-10-11-12', - 23 => '13-14-15-16-17-18', - 24 => '19-20-21-22-23-24', - 25 => '25-26-27-28-29-30', - 26 => '31-32-33-34-35-36', - 27 => '4-5-6-7-8-9', - 28 => '10-11-12-13-14-15', - 29 => '16-17-18-19-20-21', - 30 => '22-23-24-25-26-27', - 31 => '28-29-30-31-32-33', - 32 => '1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18', - 33 => '19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36', - 34 => '1-3-5-7-9-11-13-15-17-19-21-23-25-27-29-31-33-35', - 35 => '2-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36', - 36 => '38-1', - 37 => '1-2-38', - 38 => '2-3-37', - 39 => '32-33-35-36', - 40 => '31-32-34-35', - 41 => '29-30-32-33', - 42 => '28-29-31-32', - 43 => '26-27-29-30', - 44 => '25-26-28-29', - 45 => '23-24-26-27', - 46 => '22-23-25-26', - 47 => '20-21-23-24', - 48 => '19-20-22-23', - 49 => '17-18-20-21', - 50 => '16-17-19-20', - 51 => '14-15-17-18', - 52 => '13-14-16-17', - 53 => '11-12-14-15', - 54 => '10-11-13-14', - 55 => '8-9-11-12', - 56 => '7-8-10-11', - 57 => '5-6-8-9', - 58 => '4-5-7-8', - 59 => '2-3-5-6', - 60 => '1-2-4-5', - 61 => '1-2', - 62 => '2-3', - 63 => '4-5', - 64 => '5-6', - 65 => '7-8', - 66 => '8-9', - 67 => '10-11', - 68 => '11-12', - 69 => '13-14', - 70 => '14-15', - 71 => '16-17', - 72 => '17-18', - 73 => '19-20', - 74 => '20-21', - 75 => '22-23', - 76 => '23-24', - 77 => '25-26', - 78 => '26-27', - 79 => '28-29', - 80 => '29-30', - 81 => '31-32', - 82 => '32-33', - 83 => '34-35', - 84 => '35-36' - ); - - function testCoin($s,$stt) - { - global $u,$win; - $sp = mysql_query('SELECT * FROM `ruletka_coin` WHERE `game_id` = "'.$s.'" AND `money` > 0 AND `win2` = "'.$stt.'" AND `uid` != "'.$u->info['id'].'"'); - $cr = 0; $am = 0; - $usr = ''; $lu = array(); - while($pl = mysql_fetch_array($sp)) - { - $cr = $pl['money']; - if(!isset($lu[$pl['uid']]) && count($lu)<4) - { - $usr .= '-'.$pl['money']; - $lu[$pl['uid']] = true; - } - $am++; - } - $us = 0; // - $sp = mysql_query('SELECT * FROM `ruletka_coin` WHERE `game_id` = "'.$s.'" AND `money` > 0 AND `win2` = "'.$stt.'" AND `uid` = "'.$u->info['id'].'" LIMIT 100'); - while($pl = mysql_fetch_array($sp)) - { - $cr = $pl['money']; - $us += $pl['money']; - $am++; - } - $i = 0; - while($i<4) - { - if($i > count($lu)) - { - $usr .= '-0'; - } - $i++; - } - if($am>0) - { - $win[4] .= $stt.'|'.$cr.'-'.$us.''.$usr.','; - } - } - - // - $i = 1; - while($i<=38) - { - testCoin($gid['id'],$i); - $i++; - } - // - $i = 0; - while($i0,'room'=>$u->info['room'],'time'=>time(),'time_start'=>time()+74,'win'=>floor(rand(100,3800)/100),'win_line'=>'','end'=>0); - $s37 = mysql_fetch_array(mysql_query('SELECT `id` FROM `ruletka` WHERE `win` = "37" OR `win` = "38" AND `time` > "'.(time()-round(3600/10000*rand(5000,10000))).'" LIMIT 1')); - if(isset($s37['id'])) { - $gid2['win'] = floor(rand(100,3600)/100); - } - $ins = mysql_query('INSERT INTO `ruletka` (`room`,`time`,`time_start`,`win`,`win_line`) VALUES ("'.$gid2['room'].'","'.$gid2['time'].'","'.$gid2['time_start'].'","'.$gid2['win'].'","'.$gid2['win_line'].'")'); - $gid2['id'] = mysql_insert_id(); - if($ins) - { - $gid = $gid2; - } - unset($gid2); - } - - $u_w = array(0=>array(),1=>array(),2=>array(),3=>array()); - - $sm = $u->testAction('`city` = "'.$u->info['city'].'" AND `vars` = "casino_balance" LIMIT 1',1); - if(!isset($sm['id'])) { - $u->addAction(time(),'casino_balance',0); - } - - // - $sp = mysql_query('SELECT * FROM `ruletka` WHERE `end` = "0" AND `time_start` <= '.time().''); - while($pl = mysql_fetch_array($sp)) - { - /*$pl['win'] = floor(rand(10000000,360000000)/10000000); - if( rand(0,1) == 1 ) { - $pl['win'] = floor(rand(10000000,360000000)/10000000); - } - if( rand(0,1) == 1 ) { - $pl['win'] = floor(rand(10000000,360000000)/10000000); - }*/ - $end = mysql_query('UPDATE `ruletka` SET `end` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - if($end) - { - // - $sp2 = mysql_query('SELECT * FROM `ruletka_coin` WHERE `end` = "0" AND `game_id` = "'.$pl['id'].'"'); - while($pl2 = mysql_fetch_array($sp2)) - { - $upd = mysql_query('UPDATE `ruletka_coin` SET `end` = "'.time().'" WHERE `id` = "'.$pl2['id'].'" LIMIT 1'); - if($upd) - { - $wn = 0; $wn2 = 0; - $xv = 2; - if($pl2['win2']==$pl['win']) - { - $wn++; - }else{ - $i = 0; $j = explode('-',$pl2['win2']); - $xv = floor(1+34/count($j)); - while($i0) - { - // [x8], [x36] - if($pl['win']>36) - { - $nmn = ((int)$pl2['money']*35); - }else{ - $nmn = ((int)$pl2['money']*35); - } - mysql_query('UPDATE `bank` SET `money1` = `money1` + "'.$nmn.'" WHERE `uid` = "'.$pl2['uid'].'" ORDER BY `useNow` DESC LIMIT 1'); - }elseif($wn2>0) - { - // - $nmn = ((int)$pl2['money']*$xv); - mysql_query('UPDATE `bank` SET `money1` = `money1` + "'.$nmn.'" WHERE `uid` = "'.$pl2['uid'].'" ORDER BY `useNow` DESC LIMIT 1'); - }else{ - // - mysql_query('UPDATE `ruletka_coin` SET `end` = "1" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `actions` SET `vals` = `vals` + "'.mysql_real_escape_string(0+$pl2['money']).'" WHERE `id` = "'.$sm['id'].'" LIMIT 1'); - } - - if($wn > 0 || $wn2 > 0) { - $u->addDelo(1,$pl2['uid'],'"Casino.'.$u->info['city'].'": '.$nmn.' .',time(),$u->info['city'],'Casino.'.$u->info['city'].'',0,0); - if(!isset($u_w[1][$pl2['uid']])) { - $u_w[0][count($u_w[0])] = $pl2['uid']; - $u_w[2][count($u_w[0])-1] = $pl2['game_id']; - } - $u_w[1][$pl2['uid']] += (int)$nmn; - } - $u_w[3][$pl2['uid']] += (int)$pl2['money']; - - } - } - } - } - - if(count($u_w[0]) > 0) { - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','225','','',' ".$pl['login']." ".$nmn.".00 .','".time()."','6','0')"); - $i = 0; - while($i < count($u_w[0])) { - if($u_w[1][$u_w[0][$i]] > 0) { - $infu = mysql_fetch_array(mysql_query('SELECT + // , , + $gid = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `ruletka` WHERE (`end` = 0 OR `id` = "' . ((int)$_GET['id']) . '") ORDER BY `id` DESC LIMIT 1' + ) + ); + if ($gid['time_start'] + 16 > time() || isset($_GET['bet'])) { + $mnr = true; + } + $gid3 = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `ruletka` WHERE `end` >0 AND `id` = "' . ((int)$_GET['id']) . '" ORDER BY `id` DESC LIMIT 1' + ) + ); + if (isset($gid3['id'])) { + $gid = $gid3; + unset($gid3); + } + $add = false; + if (isset($gid['id'])) { + // , + $time = $gid['time_start'] - time(); + if ($time < 1) { + // + + //mysql_query('UPDATE `ruletka` SET `end` = "'.time().'" WHERE `id` = "'.$gid['id'].'" LIMIT 1'); + // + $win[0] = $gid['win']; + $win[1] = $gid['win_line']; + $win[2] = 0; + $win[3] = 0; + if ($gid['end'] == 0) { + $add = true; + } + } else { + // , + if (isset($_GET['bet'])) { + $bt = $_GET['bet']; + $good = 0; + $i = 0; + while ($i <= 38) { + if ($i == $bt) { + $good++; + } + $i++; + } + + /* + + + 1, ... ,36 - [x8] + + 2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35 - [x2] + 1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36 - [x2] + + 37 - [x36] + 38 - [x36] + + 1-2-3-37-38 - [x5] + + 1-2-3-4-5-6-7-8-9-10-11-12 - 1 [x3] + 13-14-15-16-17-18-19-20-21-22-23-24 - 2 [x3] + 25-26-27-28-29-30-31-32-33-34-35-36 - 3 [x3] + + */ + + if ($bt == '' && $good == 0) { + $good++; + } elseif ($bt == '35-36' && $good == 0) { + $good++; + } elseif ($bt == '34-35' && $good == 0) { + $good++; + } elseif ($bt == '32-33' && $good == 0) { + $good++; + } elseif ($bt == '31-32' && $good == 0) { + $good++; + } elseif ($bt == '29-30' && $good == 0) { + $good++; + } elseif ($bt == '28-29' && $good == 0) { + $good++; + } elseif ($bt == '26-27' && $good == 0) { + $good++; + } elseif ($bt == '25-26' && $good == 0) { + $good++; + } elseif ($bt == '23-24' && $good == 0) { + $good++; + } elseif ($bt == '22-23' && $good == 0) { + $good++; + } elseif ($bt == '20-21' && $good == 0) { + $good++; + } elseif ($bt == '19-20' && $good == 0) { + $good++; + } elseif ($bt == '17-18' && $good == 0) { + $good++; + } elseif ($bt == '16-17' && $good == 0) { + $good++; + } elseif ($bt == '14-15' && $good == 0) { + $good++; + } elseif ($bt == '13-14' && $good == 0) { + $good++; + } elseif ($bt == '11-12' && $good == 0) { + $good++; + } elseif ($bt == '10-11' && $good == 0) { + $good++; + } elseif ($bt == '8-9' && $good == 0) { + $good++; + } elseif ($bt == '7-8' && $good == 0) { + $good++; + } elseif ($bt == '5-6' && $good == 0) { + $good++; + } elseif ($bt == '4-5' && $good == 0) { + $good++; + } elseif ($bt == '2-3' && $good == 0) { + $good++; + } elseif ($bt == '1-2' && $good == 0) { + $good++; + } elseif ($bt == '32-33-35-36' && $good == 0) { + $good++; + } elseif ($bt == '31-32-34-35' && $good == 0) { + $good++; + } elseif ($bt == '29-30-32-33' && $good == 0) { + $good++; + } elseif ($bt == '28-29-31-32' && $good == 0) { + $good++; + } elseif ($bt == '26-27-29-30' && $good == 0) { + $good++; + } elseif ($bt == '25-26-28-29' && $good == 0) { + $good++; + } elseif ($bt == '23-24-26-27' && $good == 0) { + $good++; + } elseif ($bt == '22-23-25-26' && $good == 0) { + $good++; + } elseif ($bt == '20-21-23-24' && $good == 0) { + $good++; + } elseif ($bt == '19-20-22-23' && $good == 0) { + $good++; + } elseif ($bt == '17-18-20-21' && $good == 0) { + $good++; + } elseif ($bt == '16-17-19-20' && $good == 0) { + $good++; + } elseif ($bt == '14-15-17-18' && $good == 0) { + $good++; + } elseif ($bt == '13-14-16-17' && $good == 0) { + $good++; + } elseif ($bt == '11-12-14-15' && $good == 0) { + $good++; + } elseif ($bt == '10-11-13-14' && $good == 0) { + $good++; + } elseif ($bt == '8-9-11-12' && $good == 0) { + $good++; + } elseif ($bt == '7-8-10-11' && $good == 0) { + $good++; + } elseif ($bt == '5-6-8-9' && $good == 0) { + $good++; + } elseif ($bt == '4-5-7-8' && $good == 0) { + $good++; + } elseif ($bt == '2-3-5-6' && $good == 0) { + $good++; + } elseif ($bt == '1-2-4-5' && $good == 0) { + $good++; + } elseif ($bt == '2-3-37' && $good == 0) { + $good++; + } elseif ($bt == '1-2-38' && $good == 0) { + $good++; + } elseif ($bt == '38-1' && $good == 0) { + $good++; + } elseif ($bt == '2-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36' && $good == 0) { + $good++; + } elseif ($bt == '1-3-5-7-9-11-13-15-17-19-21-23-25-27-29-31-33-35' && $good == 0) { + $good++; + } elseif ($bt == '19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18' && $good == 0) { + $good++; + } elseif ($bt == '28-29-30-31-32-33' && $good == 0) { + $good++; + } elseif ($bt == '22-23-24-25-26-27' && $good == 0) { + $good++; + } elseif ($bt == '16-17-18-19-20-21' && $good == 0) { + $good++; + } elseif ($bt == '10-11-12-13-14-15' && $good == 0) { + $good++; + } elseif ($bt == '4-5-6-7-8-9' && $good == 0) { + $good++; + } elseif ($bt == '31-32-33-34-35-36' && $good == 0) { + $good++; + } elseif ($bt == '25-26-27-28-29-30' && $good == 0) { + $good++; + } elseif ($bt == '19-20-21-22-23-24' && $good == 0) { + $good++; + } elseif ($bt == '13-14-15-16-17-18' && $good == 0) { + $good++; + } elseif ($bt == '7-8-9-10-11-12' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3-4-5-6' && $good == 0) { + $good++; + } elseif ($bt == '34-35-36' && $good == 0) { + $good++; + } elseif ($bt == '31-32-33' && $good == 0) { + $good++; + } elseif ($bt == '28-29-30' && $good == 0) { + $good++; + } elseif ($bt == '25-26-27' && $good == 0) { + $good++; + } elseif ($bt == '22-23-24' && $good == 0) { + $good++; + } elseif ($bt == '19-20-21' && $good == 0) { + $good++; + } elseif ($bt == '16-17-18' && $good == 0) { + $good++; + } elseif ($bt == '13-14-15' && $good == 0) { + $good++; + } elseif ($bt == '10-11-12' && $good == 0) { + $good++; + } elseif ($bt == '7-8-9' && $good == 0) { + $good++; + } elseif ($bt == '6-5-4' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3' && $good == 0) { + $good++; + } elseif ($bt == '3-6-9-12-15-18-21-24-27-30-33-36' && $good == 0) { + $good++; + } elseif ($bt == '2-5-8-11-14-17-20-23-26-29-32-35' && $good == 0) { + $good++; + } elseif ($bt == '1-4-7-10-13-16-19-22-25-28-31-34' && $good == 0) { + $good++; + } elseif ($bt == '2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35' && $good == 0) { + $good++; + } elseif ($bt == '1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3-37-38' && $good == 0) { + $good++; + } elseif ($bt == '1-2-3-4-5-6-7-8-9-10-11-12' && $good == 0) { + $good++; + } elseif ($bt == '13-14-15-16-17-18-19-20-21-22-23-24' && $good == 0) { + $good++; + } elseif ($bt == '25-26-27-28-29-30-31-32-33-34-35-36' && $good == 0) { + $good++; + } elseif ($bt == '1-2-4-5' && $good == 0) { + $good++; + } + $_GET['coin'] = (int)$_GET['coin']; + if ($_GET['coin'] < 1) { + $good = 0; + } + if ($_GET['coin'] > $u->bank['money1']) { + $good = 0; + } + if ($good == 1) { + $u->bank['money1'] -= ((int)$_GET['coin']); + + $stvka = ''; + + if ($stvka == '') { + $stvka = ' '; + } + + + mysql_query( + "INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','','[] " . mysql_real_escape_string( + $u->info['login'] + ) . " : " . (0 + ((int)$_GET['coin'])) . ".00 . " . $stvka . ", " . $gid['id'] . "','" . time( + ) . "','6','0')" + ); + + + mysql_query( + 'UPDATE `bank` SET `money1` = ' . $u->bank['money1'] . ' WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1' + ); + mysql_query( + 'INSERT INTO `ruletka_coin` (`uid`,`login`,`money`,`time`,`game_id`,`win2`) VALUES ("' . $u->info['id'] . '","' . $u->info['login'] . '","' . $_GET['coin'] . '","' . time( + ) . '","' . $gid['id'] . '","' . $bt . '")' + ); + } + } + } + } else { + $add = true; + } + + // + $pos = [ + 0 => '2-4-6-8-10-11-13-15-17-20-22-24-26-28-29-31-33-35', + 1 => '1-3-5-7-9-12-14-16-18-19-21-23-25-27-30-32-34-36', + 2 => '1-2-3-37-38', + 3 => '1-2-3-4-5-6-7-8-9-10-11-12', + 4 => '13-14-15-16-17-18-19-20-21-22-23-24', + 5 => '25-26-27-28-29-30-31-32-33-34-35-36', + 6 => '1-4-7-10-13-16-19-22-25-28-31-34', + 7 => '2-5-8-11-14-17-20-23-26-29-32-35', + 8 => '3-6-9-12-15-18-21-24-27-30-33-36', + 9 => '1-2-3', + 10 => '6-5-4', + 11 => '7-8-9', + 12 => '10-11-12', + 13 => '13-14-15', + 14 => '16-17-18', + 15 => '19-20-21', + 16 => '22-23-24', + 17 => '25-26-27', + 18 => '28-29-30', + 19 => '31-32-33', + 20 => '34-35-36', + 21 => '1-2-3-4-5-6', + 22 => '7-8-9-10-11-12', + 23 => '13-14-15-16-17-18', + 24 => '19-20-21-22-23-24', + 25 => '25-26-27-28-29-30', + 26 => '31-32-33-34-35-36', + 27 => '4-5-6-7-8-9', + 28 => '10-11-12-13-14-15', + 29 => '16-17-18-19-20-21', + 30 => '22-23-24-25-26-27', + 31 => '28-29-30-31-32-33', + 32 => '1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18', + 33 => '19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36', + 34 => '1-3-5-7-9-11-13-15-17-19-21-23-25-27-29-31-33-35', + 35 => '2-4-6-8-10-12-14-16-18-20-22-24-26-28-30-32-34-36', + 36 => '38-1', + 37 => '1-2-38', + 38 => '2-3-37', + 39 => '32-33-35-36', + 40 => '31-32-34-35', + 41 => '29-30-32-33', + 42 => '28-29-31-32', + 43 => '26-27-29-30', + 44 => '25-26-28-29', + 45 => '23-24-26-27', + 46 => '22-23-25-26', + 47 => '20-21-23-24', + 48 => '19-20-22-23', + 49 => '17-18-20-21', + 50 => '16-17-19-20', + 51 => '14-15-17-18', + 52 => '13-14-16-17', + 53 => '11-12-14-15', + 54 => '10-11-13-14', + 55 => '8-9-11-12', + 56 => '7-8-10-11', + 57 => '5-6-8-9', + 58 => '4-5-7-8', + 59 => '2-3-5-6', + 60 => '1-2-4-5', + 61 => '1-2', + 62 => '2-3', + 63 => '4-5', + 64 => '5-6', + 65 => '7-8', + 66 => '8-9', + 67 => '10-11', + 68 => '11-12', + 69 => '13-14', + 70 => '14-15', + 71 => '16-17', + 72 => '17-18', + 73 => '19-20', + 74 => '20-21', + 75 => '22-23', + 76 => '23-24', + 77 => '25-26', + 78 => '26-27', + 79 => '28-29', + 80 => '29-30', + 81 => '31-32', + 82 => '32-33', + 83 => '34-35', + 84 => '35-36', + ]; + + function testCoin($s, $stt) + { + global $u, $win; + $sp = mysql_query( + 'SELECT * FROM `ruletka_coin` WHERE `game_id` = "' . $s . '" AND `money` > 0 AND `win2` = "' . $stt . '" AND `uid` != "' . $u->info['id'] . '"' + ); + $cr = 0; + $am = 0; + $usr = ''; + $lu = []; + while ($pl = mysql_fetch_array($sp)) { + $cr = $pl['money']; + if (!isset($lu[$pl['uid']]) && count($lu) < 4) { + $usr .= '-' . $pl['money']; + $lu[$pl['uid']] = true; + } + $am++; + } + $us = 0; // + $sp = mysql_query( + 'SELECT * FROM `ruletka_coin` WHERE `game_id` = "' . $s . '" AND `money` > 0 AND `win2` = "' . $stt . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 100' + ); + while ($pl = mysql_fetch_array($sp)) { + $cr = $pl['money']; + $us += $pl['money']; + $am++; + } + $i = 0; + while ($i < 4) { + if ($i > count($lu)) { + $usr .= '-0'; + } + $i++; + } + if ($am > 0) { + $win[4] .= $stt . '|' . $cr . '-' . $us . '' . $usr . ','; + } + } + + // + $i = 1; + while ($i <= 38) { + testCoin($gid['id'], $i); + $i++; + } + // + $i = 0; + while ($i < count($pos)) { + testCoin($gid['id'], $pos[$i]); + $i++; + } + + if ($add == true) { + // + $gid2 = ['id' => 0, 'room' => $u->info['room'], 'time' => time(), 'time_start' => time() + 74, 'win' => floor( + rand(100, 3800) / 100 + ), 'win_line' => '', 'end' => 0]; + $s37 = mysql_fetch_array( + mysql_query( + 'SELECT `id` FROM `ruletka` WHERE `win` = "37" OR `win` = "38" AND `time` > "' . (time() - round( + 3600 / 10000 * rand(5000, 10000) + )) . '" LIMIT 1' + ) + ); + if (isset($s37['id'])) { + $gid2['win'] = floor(rand(100, 3600) / 100); + } + $ins = mysql_query( + 'INSERT INTO `ruletka` (`room`,`time`,`time_start`,`win`,`win_line`) VALUES ("' . $gid2['room'] . '","' . $gid2['time'] . '","' . $gid2['time_start'] . '","' . $gid2['win'] . '","' . $gid2['win_line'] . '")' + ); + $gid2['id'] = mysql_insert_id(); + if ($ins) { + $gid = $gid2; + } + unset($gid2); + } + + $u_w = [0 => [], 1 => [], 2 => [], 3 => []]; + + $sm = $u->testAction('`city` = "' . $u->info['city'] . '" AND `vars` = "casino_balance" LIMIT 1', 1); + if (!isset($sm['id'])) { + $u->addAction(time(), 'casino_balance', 0); + } + + // + $sp = mysql_query('SELECT * FROM `ruletka` WHERE `end` = "0" AND `time_start` <= ' . time() . ''); + while ($pl = mysql_fetch_array($sp)) { + /*$pl['win'] = floor(rand(10000000,360000000)/10000000); + if( rand(0,1) == 1 ) { + $pl['win'] = floor(rand(10000000,360000000)/10000000); + } + if( rand(0,1) == 1 ) { + $pl['win'] = floor(rand(10000000,360000000)/10000000); + }*/ + $end = mysql_query('UPDATE `ruletka` SET `end` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + if ($end) { + // + $sp2 = mysql_query('SELECT * FROM `ruletka_coin` WHERE `end` = "0" AND `game_id` = "' . $pl['id'] . '"'); + while ($pl2 = mysql_fetch_array($sp2)) { + $upd = mysql_query( + 'UPDATE `ruletka_coin` SET `end` = "' . time() . '" WHERE `id` = "' . $pl2['id'] . '" LIMIT 1' + ); + if ($upd) { + $wn = 0; + $wn2 = 0; + $xv = 2; + if ($pl2['win2'] == $pl['win']) { + $wn++; + } else { + $i = 0; + $j = explode('-', $pl2['win2']); + $xv = floor(1 + 34 / count($j)); + while ($i < count($j)) { + if ($j[$i] == $pl['win']) { + $wn2++; + } + $i++; + } + } + + if ($wn > 0) { + // [x8], [x36] + if ($pl['win'] > 36) { + $nmn = ((int)$pl2['money'] * 35); + } else { + $nmn = ((int)$pl2['money'] * 35); + } + mysql_query( + 'UPDATE `bank` SET `money1` = `money1` + "' . $nmn . '" WHERE `uid` = "' . $pl2['uid'] . '" ORDER BY `useNow` DESC LIMIT 1' + ); + } elseif ($wn2 > 0) { + // + $nmn = ((int)$pl2['money'] * $xv); + mysql_query( + 'UPDATE `bank` SET `money1` = `money1` + "' . $nmn . '" WHERE `uid` = "' . $pl2['uid'] . '" ORDER BY `useNow` DESC LIMIT 1' + ); + } else { + // + mysql_query('UPDATE `ruletka_coin` SET `end` = "1" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); + mysql_query( + 'UPDATE `actions` SET `vals` = `vals` + "' . mysql_real_escape_string( + 0 + $pl2['money'] + ) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1' + ); + } + + if ($wn > 0 || $wn2 > 0) { + $u->addDelo( + 1, $pl2['uid'], + '"Casino.' . $u->info['city'] . '": ' . $nmn . ' .', + time(), $u->info['city'], 'Casino.' . $u->info['city'] . '', 0, 0 + ); + if (!isset($u_w[1][$pl2['uid']])) { + $u_w[0][count($u_w[0])] = $pl2['uid']; + $u_w[2][count($u_w[0]) - 1] = $pl2['game_id']; + } + $u_w[1][$pl2['uid']] += (int)$nmn; + } + $u_w[3][$pl2['uid']] += (int)$pl2['money']; + + } + } + } + } + + if (count($u_w[0]) > 0) { + //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','225','','',' ".$pl['login']." ".$nmn.".00 .','".time()."','6','0')"); + $i = 0; + while ($i < count($u_w[0])) { + if ($u_w[1][$u_w[0][$i]] > 0) { + $infu = mysql_fetch_array( + mysql_query( + 'SELECT `u`.`id`, `u`.`align`, `u`.`login`, @@ -666,56 +650,63 @@ if($u->room['name']!=' `u`.`online`, `u`.`sex`, `u`.`cityreg` - FROM `users` AS `u` WHERE `u`.`id`="'.mysql_real_escape_string($u_w[0][$i]).'" LIMIT 1')); - - mysql_query('UPDATE `actions` SET `vals` = `vals` + "'.mysql_real_escape_string((0+$u_w[3][$u_w[0][$i]])-$u_w[1][$u_w[0][$i]]).'" WHERE `id` = "'.$sm['id'].'" LIMIT 1'); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','389','','','[] ".mysql_real_escape_string($infu['login'])." ".$u_w[1][$u_w[0][$i]].".00 ., : ".(0+$u_w[3][$u_w[0][$i]]).".00 ., ".$u_w[2][$i]."','".time()."','6','0')"); - } - $i++; - } - } - - if(isset($gid['id'])) - { - if($time<0) - { - $time = 0; - } - // - if($time>0) - { - // - $status = 1; - $sp = mysql_query('SELECT * FROM `ruletka_coin` WHERE `end` = "0" AND `uid` = "'.$u->info['id'].'" AND `game_id` = "'.$gid['id'].'"'); - $win[3] = 0; - while($pl = mysql_fetch_array($sp)) - { - $win[3] += $pl['money']; - } - }else{ - // - $status = 2; - // + - $sp = mysql_query('SELECT * FROM `ruletka_coin` WHERE `end` > "0" AND `uid` = "'.$u->info['id'].'" AND `game_id` = "'.$gid['id'].'"'); - $win[2] = 0; - while($pl = mysql_fetch_array($sp)) - { - $win[2] += $pl['money']; - $win[3] += $pl['money']; - $win[1] += $pl['money']; - } - } - if($win[0]>0) - { - unset($mnr); - } - if(isset($mnr)) - { - $mnr = '&cash='.floor(0+$u->bank['money1']); - } - $r = 'time='.$time.'&game='.$gid['id'].''.$mnr.'&betsum='.$win[3].'&status='.$status.'&players='.$win[5].'&bets='.$win[4].'&win='.$win[0].'&wbets='.$win[1].'&wmoney='.$win[2].''; - echo $r; - } + FROM `users` AS `u` WHERE `u`.`id`="' . mysql_real_escape_string($u_w[0][$i]) . '" LIMIT 1' + ) + ); + + mysql_query( + 'UPDATE `actions` SET `vals` = `vals` + "' . mysql_real_escape_string( + (0 + $u_w[3][$u_w[0][$i]]) - $u_w[1][$u_w[0][$i]] + ) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1' + ); + mysql_query( + "INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','389','','','[] " . mysql_real_escape_string( + $infu['login'] + ) . " " . $u_w[1][$u_w[0][$i]] . ".00 ., : " . (0 + $u_w[3][$u_w[0][$i]]) . ".00 ., " . $u_w[2][$i] . "','" . time( + ) . "','6','0')" + ); + } + $i++; + } + } + + if (isset($gid['id'])) { + if ($time < 0) { + $time = 0; + } + // + if ($time > 0) { + // + $status = 1; + $sp = mysql_query( + 'SELECT * FROM `ruletka_coin` WHERE `end` = "0" AND `uid` = "' . $u->info['id'] . '" AND `game_id` = "' . $gid['id'] . '"' + ); + $win[3] = 0; + while ($pl = mysql_fetch_array($sp)) { + $win[3] += $pl['money']; + } + } else { + // + $status = 2; + // + + $sp = mysql_query( + 'SELECT * FROM `ruletka_coin` WHERE `end` > "0" AND `uid` = "' . $u->info['id'] . '" AND `game_id` = "' . $gid['id'] . '"' + ); + $win[2] = 0; + while ($pl = mysql_fetch_array($sp)) { + $win[2] += $pl['money']; + $win[3] += $pl['money']; + $win[1] += $pl['money']; + } + } + if ($win[0] > 0) { + unset($mnr); + } + if (isset($mnr)) { + $mnr = '&cash=' . floor(0 + $u->bank['money1']); + } + $r = 'time=' . $time . '&game=' . $gid['id'] . '' . $mnr . '&betsum=' . $win[3] . '&status=' . $status . '&players=' . $win[5] . '&bets=' . $win[4] . '&win=' . $win[0] . '&wbets=' . $win[1] . '&wmoney=' . $win[2] . ''; + echo $r; + } } mysql_query('UNLOCK TABLES'); -?> \ No newline at end of file diff --git a/seasons.php b/seasons.php index c8883a09..e9d24802 100644 --- a/seasons.php +++ b/seasons.php @@ -1,260 +1,303 @@ \n"; var_dump($vars); echo "\n"; - if ($d) exit(); + if ($d) { + exit(); + } } -define('IP',GetRealIp()); -die(); +define('IP', GetRealIp()); + +die('off'); include('_incl_data/__config.php'); -define('GAME',true); +const GAME = true; include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__magic.php'); -include('_incl_data/class/__user.php'); -include('_incl_data/class/__filter_class.php'); -include('_incl_data/class/__quest.php'); -include('_incl_data/class/__seasons.php'); +$u = User::start(); +$filter = new Filter(); -if(isset($_GET['upi'])) { - $k = explode(',',$_GET['upi']); - $i = 0; - while( $i < count($k) ) { - // - $i1 = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($k[$i-1]).'" LIMIT 1')); - $i2 = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($k[$i]).'" LIMIT 1')); - $i3 = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($k[$i+1]).'" LIMIT 1')); - if(isset($i2['id'])) { - // - if(isset($i3['id'])) { - // i2 -> i3 - $test = mysql_fetch_array(mysql_query('SELECT * FROM `items_upgrade` WHERE `iid` = "'.$i2['id'].'" AND `iup` = "'.$i3['id'].'" LIMIT 1')); - if(!isset($test['id'])) { - mysql_query('INSERT INTO `items_upgrade` (`iid`,`iup`,`price1`,`price2`) VALUES ( - "'.$i2['id'].'","'.$i3['id'].'","0","'.($i3['price2']-$i2['price2']).'" - )'); - echo '['.$i2['id'].']->['.$i3['id'].'] '.($i3['price2']-$i2['price2']).'.
    '; - } - } - if(isset($i1['id']) || !isset($i3['id'])) { - // i2 - echo '[ '.$i2['id'].' ]
    '; - mysql_query('UPDATE `items_shop` SET `kolvo` = 0 WHERE `item_id` = "'.$i2['id'].'"'); - } - } - // - $i++; - } -}else{ - die(); +if (isset($_GET['upi'])) { + $k = explode(',', $_GET['upi']); + $i = 0; + while ($i < count($k)) { + // + $i1 = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($k[$i - 1]) . '" LIMIT 1' + ) + ); + $i2 = mysql_fetch_array( + mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($k[$i]) . '" LIMIT 1') + ); + $i3 = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($k[$i + 1]) . '" LIMIT 1' + ) + ); + if (isset($i2['id'])) { + // + if (isset($i3['id'])) { + // i2 -> i3 + $test = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `items_upgrade` WHERE `iid` = "' . $i2['id'] . '" AND `iup` = "' . $i3['id'] . '" LIMIT 1' + ) + ); + if (!isset($test['id'])) { + mysql_query( + 'INSERT INTO `items_upgrade` (`iid`,`iup`,`price1`,`price2`) VALUES ( + "' . $i2['id'] . '","' . $i3['id'] . '","0","' . ($i3['price2'] - $i2['price2']) . '" + )' + ); + echo '[' . $i2['id'] . ']->[' . $i3['id'] . '] ' . ($i3['price2'] - $i2['price2']) . '.
    '; + } + } + if (isset($i1['id']) || !isset($i3['id'])) { + // i2 + echo '[ ' . $i2['id'] . ' ]
    '; + mysql_query('UPDATE `items_shop` SET `kolvo` = 0 WHERE `item_id` = "' . $i2['id'] . '"'); + } + } + // + $i++; + } +} else { + die(); } $tjs = ''; -//if( $u->info['admin'] == 0 ) { -// header('location: main.php'); -// die(); -//} - -if($u->info['bithday'] == '01.01.1800' && $u->info['inTurnirnew'] == 0) { - header('location: main.php'); - die(); +if ($u->info['bithday'] == '01.01.1800' && $u->info['inTurnirnew'] == 0) { + header('location: main.php'); + die(); } -/*if( !eregi("new-combats\.com", $_SERVER['HTTP_REFERER']) ) { - //die(' , .
    last_page:%'.$_SERVER['HTTP_REFERER'].''); -}*/ - -if( $u->info['id'] == 1000001 ) { - $u->info['admin'] = 0; +if ($u->info['id'] == 1000001) { + $u->info['admin'] = 0; } #-------- , -if($u->info['online'] < time()-60) -{ - $filter->setOnline($u->info['online'],$u->info['id'],0); - $u->onlineBonus(); - mysql_query("UPDATE `users` SET `online`='".time()."',`timeMain`='".time()."' WHERE `id`='".$u->info['id']."' LIMIT 1"); -}elseif($u->info['timeMain'] < time()-60) -{ - 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']); + $u->onlineBonus(); + mysql_query( + "UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time( + ) . "' WHERE `id`='" . $u->info['id'] . "' LIMIT 1" + ); +} elseif ($u->info['timeMain'] < time() - 60) { + mysql_query( + "UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time( + ) . "' 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']); } /* */ $rz = 1; -if( isset($_GET['rz']) ) { - if( $_GET['rz'] == 2 ) { - $rz = 2; - } +if (isset($_GET['rz'])) { + if ($_GET['rz'] == 2) { + $rz = 2; + } } /* */ -season::$date['Y'] = date('Y'); -season::$date['m'] = date('m'); -season::$date['d'] = date('d'); -season::$yy = season::$yy[season::$date['m']]; +Season::$date['Y'] = date('Y'); +Season::$date['m'] = date('m'); +Season::$date['d'] = date('d'); +Season::$yy = Season::$yy[Season::$date['m']]; ?> - - - - - - - + + + + + + + - -

    ,

    - - - - + + +

    ,

    +
    - - season::$date['d'] ) { - // - $html .= '
    '. - '

    '.$pl['dd'].'.'.season::$date['m'].'.'.season::$date['Y'].'
    '. - '
    '; - }else{ - // - $html .= '
    '. - '
    !
    '. - '
    '; - } - } - if( $html == '' ) { - $html = ' '; - } - echo '
    ' . $html . '
    '; - }elseif( $rz == 2 ) { - // - $html = ''; - season::data( $_GET['mis'] ); - if( !isset(season::$m['id']) ) { - $html = ' '; - }else{ - if( season::$m['dd'] > season::$date['d'] ) { - // - $html .= '
    '. - '

    '.season::$m['dd'].'.'.season::$date['m'].'.'.season::$date['Y'].'
    '. - '
    '; - }else{ - // - $html .= '
    '. - '
      :
    0 / ??
    '. - '
    '; - // - $sp = mysql_query('SELECT * FROM `sss_q` WHERE `m` = "'.season::$m['id'].'"'); - $ends = array(); - $i = 0; - $lstms = mysql_fetch_array(mysql_query('SELECT * FROM `sss_f` WHERE `uid` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1')); - while( $pl = mysql_fetch_array($sp) ) { - - $qe = 0; - $tss = strtotime('01-'.season::$m['s'].'-'.season::$date['Y'].''); - if(isset($lstms['id'])) { - $tss = strtotime(''.date('d',$lstms['time']).'-'.date('m',$lstms['time']).'-'.date('Y',$lstms['time']).''); - } - // - if( $pl['type'] == 1 ) { - // - $c1 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `time_create` > "'.$tss.'" AND `uid` = "'.$u->info['id'].'" AND `delete` < 1001 AND `item_id` = "'.$pl['value'].'" LIMIT 1')); - $qe = $c1[0]; - }elseif( $pl['type'] == 2 || $pl['type'] == 3 ) { - $c1 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `actions` WHERE `time` > "'.$tss.'" AND `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%win_bot_'.$pl['value'].'" LIMIT 1')); - $qe = $c1[0]; - } - // - if( $qe > $pl['var'] ) { - $qe = $pl['var']; - } - $f = 0; - // - $nogo = false; - if( !isset($ends[$i-1]) && $i != 0 ) { - $nogo = true; - } - // - $plf = mysql_fetch_array(mysql_query('SELECT * FROM `sss_f` WHERE `uid` = "'.$u->info['id'].'" AND `m` = "'.$pl['id'].'" AND `y` = "'.season::$date['Y'].'" LIMIT 1')); - if(isset($plf['id'])) { - $f = 1; - } - // - $html .= '
    '; - $html .= '
    '; - - $html .= '
    ' . $pl['info'] . '
    '; - - if( $nogo == true ) { - // - }elseif( $f == 1 ) { - // - }elseif( $nogo == false && $f == 0 && isset($_GET['endq']) && $_GET['endq'] == $pl['id'] && $qe == $pl['var'] ) { - $f = 1; - mysql_query('INSERT INTO `sss_f` (`m`,`y`,`uid`,`time`) VALUES ( - "'.$pl['id'].'", - "'.season::$date['Y'].'", - "'.$u->info['id'].'", - "'.time().'" - )'); - }else{ - $html .= '
    '; - if( $qe == $pl['var'] ) { - $html .= ' '; - } - $html .= '   '.$qe.' / '.$pl['var'].''; - } - - if( $f == 1 ) { - $ends[$i] = true; - $html .= ' .'; - }elseif( $nogo == true ) { - $html .= ' .'; - } - - $html .= '
    '; - $html .= '
    '; - // - $html .= ''; - $i++; - } - } - } - echo '
    ' . $html . '
    '; - } - ?> - -
    + + +
    + + Season::$date['d']) { + // + $html .= '
    ' . + '

    ' . $pl['dd'] . '.' . Season::$date['m'] . '.' . Season::$date['Y'] . '
    ' . + '
    '; + } else { + // + $html .= '
    ' . + '
    !
    ' . + '
    '; + } + } + if ($html == '') { + $html = ' '; + } + echo '
    ' . $html . '
    '; + } elseif ($rz == 2) { + // + $html = ''; + Season::data($_GET['mis']); + if (!isset(Season::$m['id'])) { + $html = ' '; + } else { + if (Season::$m['dd'] > Season::$date['d']) { + // + $html .= '
    ' . + '

    ' . Season::$m['dd'] . '.' . Season::$date['m'] . '.' . Season::$date['Y'] . '
    ' . + '
    '; + } else { + // + $html .= '
    ' . + '
      :
    0 / ??
    ' . + '
    '; + // + $sp = mysql_query('SELECT * FROM `sss_q` WHERE `m` = "' . Season::$m['id'] . '"'); + $ends = []; + $i = 0; + $lstms = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `sss_f` WHERE `uid` = "' . $u->info['id'] . '" ORDER BY `id` DESC LIMIT 1' + ) + ); + while ($pl = mysql_fetch_array($sp)) { + + $qe = 0; + $tss = strtotime('01-' . Season::$m['s'] . '-' . Season::$date['Y'] . ''); + if (isset($lstms['id'])) { + $tss = strtotime( + '' . date('d', $lstms['time']) . '-' . date('m', $lstms['time']) . '-' . date( + 'Y', $lstms['time'] + ) . '' + ); + } + // + if ($pl['type'] == 1) { + // + $c1 = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(*) FROM `items_users` WHERE `time_create` > "' . $tss . '" AND `uid` = "' . $u->info['id'] . '" AND `delete` < 1001 AND `item_id` = "' . $pl['value'] . '" LIMIT 1' + ) + ); + $qe = $c1[0]; + } elseif ($pl['type'] == 2 || $pl['type'] == 3) { + $c1 = mysql_fetch_array( + mysql_query( + 'SELECT COUNT(*) FROM `actions` WHERE `time` > "' . $tss . '" AND `uid` = "' . $u->info['id'] . '" AND `vars` LIKE "%win_bot_' . $pl['value'] . '" LIMIT 1' + ) + ); + $qe = $c1[0]; + } + // + if ($qe > $pl['var']) { + $qe = $pl['var']; + } + $f = 0; + // + $nogo = false; + if (!isset($ends[$i - 1]) && $i != 0) { + $nogo = true; + } + // + $plf = mysql_fetch_array( + mysql_query( + 'SELECT * FROM `sss_f` WHERE `uid` = "' . $u->info['id'] . '" AND `m` = "' . $pl['id'] . '" AND `y` = "' . Season::$date['Y'] . '" LIMIT 1' + ) + ); + if (isset($plf['id'])) { + $f = 1; + } + // + $html .= '
    '; + $html .= '
    '; + + $html .= '
    ' . $pl['info'] . '
    '; + + if ($nogo == true) { + // + } elseif ($f == 1) { + // + } elseif ($nogo == false && $f == 0 && isset($_GET['endq']) && $_GET['endq'] == $pl['id'] && $qe == $pl['var']) { + $f = 1; + mysql_query( + 'INSERT INTO `sss_f` (`m`,`y`,`uid`,`time`) VALUES ( + "' . $pl['id'] . '", + "' . Season::$date['Y'] . '", + "' . $u->info['id'] . '", + "' . time() . '" + )' + ); + } else { + $html .= '
    '; + if ($qe == $pl['var']) { + $html .= ' '; + } + $html .= '   ' . $qe . ' / ' . $pl['var'] . ''; + } + + if ($f == 1) { + $ends[$i] = true; + $html .= ' .'; + } elseif ($nogo == true) { + $html .= ' .'; + } + + $html .= '
    '; + $html .= '
    '; + // + $html .= ''; + $i++; + } + } + } + echo '
    ' . $html . '
    '; + } + ?> + +
    diff --git a/settings.php b/settings.php index f3ea2c39..f7bf275c 100644 --- a/settings.php +++ b/settings.php @@ -1,271 +1,376 @@ - - + - - - - - - - - - - - - + body { + background-color: #000000; + margin: 0; + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 12pt; + color: #000000; + } + + .nicname { + color: #bfa178; + font-size: 9pt; + font-weight: bold; + } + + td.text { + background-position: right top; + background-repeat: no-repeat; + } + + .place { + color: #cc8e43; + font-size: 8pt; + font-weight: bold; + } + + .nomber { + color: #7c3e00; + font-size: 8pt; + font-weight: bold; + } + + .green { + color: #526700; + font-size: 8pt; + font-weight: bold; + } + + .about { + font-size: 9pt; + } + + .levels { + color: #bfa178; + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 7pt; + } + + TD.topbgl { + background-image: url(https://new-combats.com/new/register/topbgl.jpg); + background-position: right top + } + + .style1 { + color: #4b2500; + font-weight: bold; + font-size: 9pt; + } + + a.lnkstyle1, a.lnkstyle1:link, a.lnkstyle1:visited, a.lnkstyle1:hover, a.lnkstyle1:active { + color: #4b2500; + font-weight: bold; + font-size: 9pt; + } + + a.lnkstyle2 { + font-size: 9pt; + font-weight: bold; + color: #4b2500; + } + + a.lnkstyle2:link { + font-weight: bold; + color: #4b2500; + text-decoration: none + } + + a.lnkstyle2:visited { + font-weight: bold; + color: #4b2500; + text-decoration: none + } + + a.lnkstyle2:hover, a.lnkstyle2:active { + font-weight: bold; + color: #84643e; + text-decoration: none; + } + + input { + font-size: 12px; + } + + --> + + + -spamFiltr($_POST['name'])!='0' || $filter->spamFiltr($_POST['city'])!='0' || $filter->spamFiltr($_POST['city2'])!='0' || $filter->spamFiltr($_POST['homepage'])!='0' || $filter->spamFiltr($_POST['about'])!='0' || $filter->spamFiltr($_POST['hobby'])!='0') - { - if ($u->info['level']<9) - { - mysql_query('UPDATE `users` SET `info_delete` = "'.(time()+86400).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); - } - } - $_POST['city'] = htmlspecialchars($_POST['city'],NULL,'cp1251'); - $_POST['city2'] = htmlspecialchars($_POST['city2'],NULL,'cp1251'); - $_POST['icq'] = htmlspecialchars($_POST['icq'],NULL,'cp1251'); - if(!isset($_POST['mat'])) { $_POST['mat'] == NULL; } - if(!isset($_POST['hide_icq'])){ $_POST['hide_icq'] = NULL; } - $_POST['skype'] = htmlspecialchars($_POST['skype'],NULL,'cp1251'); - if(!isset($_POST['hide_skype'])){ $_POST['hide_skype'] = NULL; }else{ $_POST['hide_skype'] = 1; } - $_POST['hide_icq'] = htmlspecialchars($_POST['hide_icq'],NULL,'cp1251'); - $_POST['homepage'] = htmlspecialchars($_POST['homepage'],NULL,'cp1251'); - $_POST['about'] = htmlspecialchars($_POST['about'],NULL,'cp1251'); - if( $u->info['admin'] == 0 ) { - $_POST['hobby'] = htmlspecialchars($_POST['hobby'],NULL,'cp1251'); - } - $_POST['ChatColor'] = htmlspecialchars($_POST['ChatColor'],NULL,'cp1251'); - - $_POST['hobby']= str_replace("\\n","
    ",$_POST['hobby']); - $_POST['hobby']= str_replace("\\r","",$_POST['hobby']); - $_POST['hobby']= str_replace("<BR>","
    ",$_POST['hobby']); - $simbolcount = strlen($_POST['hobby']); - if (isset($_POST['ChatColor']) && $u->info['admin']=='0' && !($_POST['ChatColor'] == "Black" || $_POST['ChatColor'] == "Blue" || $_POST['ChatColor'] == "Lilac" || $_POST['ChatColor'] == "Fuchsia" || $_POST['ChatColor'] == "Gray" || $_POST['ChatColor'] == "Green" || $_POST['ChatColor'] == "Maroon" || $_POST['ChatColor'] == "Navy" || $_POST['ChatColor'] == "Olive" || $_POST['ChatColor'] == "Purple" || $_POST['ChatColor'] == "Teal" || $_POST['ChatColor'] == "Orange" || $_POST['ChatColor'] == "Chocolate" || $_POST['ChatColor'] == "DarkKhaki" || $_POST['ChatColor'] == "SandyBrown")) { - echo "
    !
    "; - $_POST['ChatColor'] = "Black"; - } - if(!$_POST['city']){$city=$_POST['city2'];} - elseif($_POST['city'] && $_POST['city2']){$city=$_POST['city2'];} - else{$city=$_POST['city'];} +spamFiltr($_POST['name']) != '0' || + $filter->spamFiltr($_POST['city']) != '0' || + $filter->spamFiltr($_POST['city2']) != '0' || + $filter->spamFiltr($_POST['homepage']) != '0' || + $filter->spamFiltr($_POST['about']) != '0' || + $filter->spamFiltr($_POST['hobby']) != '0' + ) && + $u->info['level'] < 9 + ) { + mysql_query( + 'UPDATE `users` SET `info_delete` = "' . (time( + ) + 86400) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' + ); + } + $_POST['city'] = htmlspecialchars($_POST['city'], null, 'cp1251'); + $_POST['city2'] = htmlspecialchars($_POST['city2'], null, 'cp1251'); + $_POST['icq'] = htmlspecialchars($_POST['icq'], null, 'cp1251'); + if (!isset($_POST['mat'])) { + $_POST['mat'] = null; + } + if (!isset($_POST['hide_icq'])) { + $_POST['hide_icq'] = null; + } + $_POST['skype'] = htmlspecialchars($_POST['skype'], null, 'cp1251'); + if (!isset($_POST['hide_skype'])) { + $_POST['hide_skype'] = null; + } else { + $_POST['hide_skype'] = 1; + } + $_POST['hide_icq'] = htmlspecialchars($_POST['hide_icq'], null, 'cp1251'); + $_POST['homepage'] = htmlspecialchars($_POST['homepage'], null, 'cp1251'); + $_POST['about'] = htmlspecialchars($_POST['about'], null, 'cp1251'); + if ($u->info['admin'] == 0) { + $_POST['hobby'] = htmlspecialchars($_POST['hobby'], null, 'cp1251'); + } + $_POST['ChatColor'] = htmlspecialchars($_POST['ChatColor'], null, 'cp1251'); + + $_POST['hobby'] = str_replace("\\n", "
    ", $_POST['hobby']); + $_POST['hobby'] = str_replace("\\r", "", $_POST['hobby']); + $_POST['hobby'] = str_replace("<BR>", "
    ", $_POST['hobby']); + $simbolcount = strlen($_POST['hobby']); + if (isset($_POST['ChatColor']) && $u->info['admin'] == '0' && !($_POST['ChatColor'] == "Black" || $_POST['ChatColor'] == "Blue" || $_POST['ChatColor'] == "Lilac" || $_POST['ChatColor'] == "Fuchsia" || $_POST['ChatColor'] == "Gray" || $_POST['ChatColor'] == "Green" || $_POST['ChatColor'] == "Maroon" || $_POST['ChatColor'] == "Navy" || $_POST['ChatColor'] == "Olive" || $_POST['ChatColor'] == "Purple" || $_POST['ChatColor'] == "Teal" || $_POST['ChatColor'] == "Orange" || $_POST['ChatColor'] == "Chocolate" || $_POST['ChatColor'] == "DarkKhaki" || $_POST['ChatColor'] == "SandyBrown")) { + echo "
    !
    "; + $_POST['ChatColor'] = "Black"; + } + if (!$_POST['city']) { + $city = $_POST['city2']; + } elseif ($_POST['city'] && $_POST['city2']) { + $city = $_POST['city2']; + } else { + $city = $_POST['city']; + } } -if(isset($_POST['saveanketa'])) { -if( $u->info['level'] <= 1 ) { - $dt = explode('.',$_POST['0day']); - if(isset($dt[0],$dt[1],$dt[2])) - { - $erd = 0; - $dt[0] = round($dt[0]); - $dt[1] = round($dt[1]); - $dt[2] = round($dt[2]); - if($dt[0]<1 || $dt[0]>31) - { - $erd = 1; - } - if($dt[1]<1 || $dt[1]>12) - { - $erd = 2; - } - if($dt[2]<1920 || $dt[2]>2006) - { - $erd = 3; - } - if($erd==0) - { - $_POST['0day'] = $dt[0].'.'.$dt[1].'.'.$dt[2]; - $dateofbirth = "`bithday` = '".mysql_real_escape_string($_POST['0day'])."',"; - }else{ - // - - } - } - - $u->info['bithday'] = $_POST['0day']; -} -$st = $u->lookStats($u->info['stats']); -$maxsimbols = 2000+($st['os6']*200); - if($_POST['mat'] == 1 ) { - $_POST['mat'] = 1; - }else{ - $_POST['mat'] = 0; - } - if($simbolcount>$maxsimbols && $u->info['admin'] == 0) { - }else{ - $lastdes = $u->info['design']; - if($_POST['design'] == 1) { - $u->info['design'] = 1; - }else{ - $u->info['design'] = 0; - } - } - if($simbolcount>$maxsimbols && $u->info['admin'] == 0) { - echo '
    " / " - '.$maxsimbols.' .
    '; - }elseif(mysql_query("UPDATE +if (isset($_POST['saveanketa'])) { + if ($u->info['level'] <= 1) { + $dt = explode('.', $_POST['0day']); + if (isset($dt[0], $dt[1], $dt[2])) { + $erd = 0; + $dt[0] = round($dt[0]); + $dt[1] = round($dt[1]); + $dt[2] = round($dt[2]); + if ($dt[0] < 1 || $dt[0] > 31) { + $erd = 1; + } + if ($dt[1] < 1 || $dt[1] > 12) { + $erd = 2; + } + if ($dt[2] < 1920 || $dt[2] > 2006) { + $erd = 3; + } + if ($erd == 0) { + $_POST['0day'] = $dt[0] . '.' . $dt[1] . '.' . $dt[2]; + $dateofbirth = "`bithday` = '" . mysql_real_escape_string($_POST['0day']) . "',"; + } + } + + $u->info['bithday'] = $_POST['0day']; + } + $st = $u->lookStats($u->info['stats']); + $maxsimbols = 2000 + ($st['os6'] * 200); + if ($_POST['mat'] == 1) { + $_POST['mat'] = 1; + } else { + $_POST['mat'] = 0; + } + if ($simbolcount <= $maxsimbols || $u->info['admin'] != 0) { + $lastdes = $u->info['design']; + if ($_POST['design'] == 1) { + $u->info['design'] = 1; + } else { + $u->info['design'] = 0; + } + } + if ($simbolcount > $maxsimbols && $u->info['admin'] == 0) { + echo '
    " / " - ' . $maxsimbols . ' .
    '; + } elseif (mysql_query( + "UPDATE `users` SET - `design` = '".$u->info['design']."', - `name` = '".mysql_real_escape_string($_POST['name'])."', - `city_real` = '".mysql_real_escape_string($_POST['city2'])."', - `icq` = '".mysql_real_escape_string((int)$_POST['icq'])."', - `icq_hide` = '".mysql_real_escape_string($_POST['hide_icq'])."', - `skype` = '".mysql_real_escape_string($_POST['skype'])."', - `skype_hide` = '".mysql_real_escape_string($_POST['hide_skype'])."', - `homepage` = '".mysql_real_escape_string($_POST['homepage'])."', - ".$dateofbirth." - `deviz` = '".mysql_real_escape_string($_POST['about'])."', - `hobby` = '".mysql_real_escape_string($_POST['hobby'])."', - `chatColor` = '".mysql_real_escape_string($_POST['ChatColor'])."', - `mat` = '".mysql_real_escape_string((int)$_POST['mat'])."' + `design` = '" . $u->info['design'] . "', + `name` = '" . mysql_real_escape_string($_POST['name']) . "', + `city_real` = '" . mysql_real_escape_string($_POST['city2']) . "', + `icq` = '" . mysql_real_escape_string((int)$_POST['icq']) . "', + `icq_hide` = '" . mysql_real_escape_string($_POST['hide_icq']) . "', + `skype` = '" . mysql_real_escape_string($_POST['skype']) . "', + `skype_hide` = '" . mysql_real_escape_string($_POST['hide_skype']) . "', + `homepage` = '" . mysql_real_escape_string($_POST['homepage']) . "', + " . $dateofbirth . " + `deviz` = '" . mysql_real_escape_string($_POST['about']) . "', + `hobby` = '" . mysql_real_escape_string($_POST['hobby']) . "', + `chatColor` = '" . mysql_real_escape_string($_POST['ChatColor']) . "', + `mat` = '" . mysql_real_escape_string((int)$_POST['mat']) . "' WHERE - `id` = '".mysql_real_escape_string($u->info['id'])."' LIMIT 1;")) -{echo '
    '; - if( $u->info['design'] != $lastdes ) { - echo ''; - } -$u->info['name'] = $_POST['name']; -$u->info['city_real'] = $city; -$u->info['icq'] = $_POST['icq']; -$u->info['icq_hide'] = $_POST['hide_icq']; -$u->info['skype'] = $_POST['skype']; -$u->info['skype_hide'] = $_POST['hide_skype']; -$u->info['homepage'] = $_POST['homepage']; -$u->info['deviz'] = $_POST['about']; -$u->info['hobby'] = $_POST['hobby']; -$u->info['chatColor'] = $_POST['ChatColor']; -$u->info['mat'] = $_POST['mat']; -} -else{echo '- ...';} + `id` = '" . mysql_real_escape_string($u->info['id']) . "' LIMIT 1;" + )) { + echo '
    '; + if ($u->info['design'] != $lastdes) { + echo ''; + } + $u->info['name'] = $_POST['name']; + $u->info['city_real'] = $city; + $u->info['icq'] = $_POST['icq']; + $u->info['icq_hide'] = $_POST['hide_icq']; + $u->info['skype'] = $_POST['skype']; + $u->info['skype_hide'] = $_POST['hide_skype']; + $u->info['homepage'] = $_POST['homepage']; + $u->info['deviz'] = $_POST['about']; + $u->info['hobby'] = $_POST['hobby']; + $u->info['chatColor'] = $_POST['ChatColor']; + $u->info['mat'] = $_POST['mat']; + } else { + echo '- ...'; + } } +?> + +info['pass']) { + if ($_POST['pass_new'] == $_POST['pass_new2']) { + $u->info['pass'] = md5($_POST['pass_new']); + mysql_query( + 'UPDATE `users` SET `pass` = "' . $u->info['pass'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1' + ); + // + setcookie('login', $u->info['login'], time() + 86400 * 365, '', $c['host']); + setcookie('pass', $u->info['pass'], time() + 86400 * 365, '', $c['host']); + // + echo '
    !
    '; + } else { + echo '
    !
    '; + } + } else { + echo '
    , !
    '; + } } ?> @@ -273,168 +378,284 @@ if(isset($_POST['pass_old'])) { - - - - - - - - - - - - - - - - - + + + + + + + + + + + + +
    - - - -
     
    -
    - - - - - - - - - - -
    - - - + +
    + + + + + + + + +
    + - + +
    +  
    +
    + + + + + + + + + + + + + +
    + + + + + + + +
    + + + - - - - -
    - - - - - - -
    + + + + + + -
    -
    -
    microLogin($u->info['id'],1)?>
    -
    -
    - - :

    - :

    - ( ):

    - -
    -
    +
    +
    microLogin($u->info['id'], 1) ?>
    +
    +
    + + + :

    + :

    + ( ):

    + +
    +
    -
    +
    -
    -
    - -
    - :

    - :
    -
    - :
    -
    + :
    +
    + :
    + - -
    -
    - info['icq'] == 0 ) { - $u->info['icq'] = ''; - } - ?> - ICQ:

    - Skype:

    - :
    - - -
    -
    -
    - / ( 300 ) -
    - -
    -
    -
    + } + ?> + + + +
    + info['icq'] == 0) { + $u->info['icq'] = ''; + } + ?> + ICQ:

    + Skype:

    + :
    + + +
    +
    +
    + / ( + 300 ) +
    + + + +
    +
    +
    +

    -
    - - - -
     
      
      - - - - - -
      - -
    © 2013-2016 -

    -   -
    -
     

    +
    + + + + +
     
    +
      
      + + + + + + +
      + +
    © 2013-2016 +

    +   +
    +
     
    -
    - - - -
    - +
    + \ No newline at end of file diff --git a/shop_editor.php b/shop_editor.php index 52a6240e..e0c2acf2 100644 --- a/shop_editor.php +++ b/shop_editor.php @@ -1,10 +1,11 @@ -info['id']) || $u->info['admin'] < 1) { +if(!$u->info['admin']) { header('location: /index.php'); die(); } diff --git a/sms.php b/sms.php index 64f3a3bc..33df3dc9 100644 --- a/sms.php +++ b/sms.php @@ -1,17 +1,22 @@ - 0 AND `banned` = 0 ORDER BY `id` DESC'); - while( $pl = mysql_fetch_array($sp) ) { - $prc = mysql_fetch_array(mysql_query('SELECT SUM(`2price`) AS `a` , SUM(`1price`) AS `b` FROM `items_users` WHERE `uid` = "'.$pl['id'].'" AND `delete` < `time_create` LIMIT 1')); - if( $prc['a'] > 0 ) { - echo $u->microLogin($pl,2) . '   - - - - - - - - '.($prc['a']).' () + '.$pl['money2'].' \ '.($prc['b']+$pl['money1']).'
    '; - echo '
    '; - } - } +if (isset($_GET['test'])) { + $sp = mysql_query('SELECT * FROM `users` WHERE `real` > 0 AND `banned` = 0 ORDER BY `id` DESC'); + while ($pl = mysql_fetch_array($sp)) { + $prc = mysql_fetch_array( + mysql_query( + 'SELECT SUM(`2price`) AS `a` , SUM(`1price`) AS `b` FROM `items_users` WHERE `uid` = "' . $pl['id'] . '" AND `delete` < `time_create` LIMIT 1' + ) + ); + if ($prc['a'] > 0) { + echo $u->microLogin( + $pl, 2 + ) . '   - - - - - - - - ' . ($prc['a']) . ' () + ' . $pl['money2'] . ' \ ' . ($prc['b'] + $pl['money1']) . '
    '; + echo '
    '; + } + } } -?> \ No newline at end of file diff --git a/social.php b/social.php index f23332ac..7536d42e 100644 --- a/social.php +++ b/social.php @@ -5,7 +5,7 @@ die(); define('GAME',true); include('_incl_data/__config.php'); include('_incl_data/class/__db_connect.php'); -include('_incl_data/class/__user.php'); +$u = User::start(); // if(isset($u->info['id'])) { $mcf = mysql_fetch_array(mysql_query('SELECT * FROM `mini_actions` WHERE `uid` = "'.$u->info['id'].'" AND (`val` = "vkauth" OR `val` = "fbauth" OR `val` = "okauth") LIMIT 1')); diff --git a/spam.php b/spam.php index d6b0cbaa..891f3442 100644 --- a/spam.php +++ b/spam.php @@ -1,124 +1,73 @@ 0 AND `id` > "'.mysql_real_escape_string($_GET['test_login']).'" LIMIT 1')); - $sp = mysql_query('SELECT `id`,`login`,`pass` FROM `users` WHERE `real` > 0 AND `id` IN ( SELECT `uid` FROM `logs_auth` WHERE `depass` != "" GROUP BY `uid` ) AND `id` > "'.mysql_real_escape_string($_GET['test_login']).'" ORDER BY `id` ASC LIMIT 1'); - while( $pl = mysql_fetch_array($sp) ) { - $test = false; - $cn = file_get_contents('https://old-combats.com/info/'.$pl['login'].''); - $cn = explode('',$cn); - $cn = explode('',$cn[1]); - $cn = $cn[0]; - echo '['.$cn.']'; - if( $cn != ' ' ) { - $test = true; - } - if($test == true) { - $logs = mysql_fetch_array(mysql_query('SELECT `depass` FROM `logs_auth` WHERE `uid` = "'.$pl['id'].'" AND `depass` != ""')); - echo ''.$pl['login'].' - '.$pl['pass'].' - '.$pl['id'].' -> ('.$xx[0].') "'; - print_r($logs); - echo '"

    '; - }else{ - die('location: /spam.php?test_login='.$pl['id'].''); - } - } - die(); -}elseif(isset($_GET['test_login2'])) { - die(); - $xx = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `real` > 0 AND `id` > "'.mysql_real_escape_string($_GET['test_login2']).'" LIMIT 1')); - $sp = mysql_query('SELECT `id`,`login`,`pass` FROM `users` WHERE `real` > 0 AND `id` IN ( SELECT `uid` FROM `logs_auth` WHERE `depass` != "" GROUP BY `uid` ) AND `id` > "'.mysql_real_escape_string($_GET['test_login2']).'" ORDER BY `id` ASC LIMIT 1'); - while( $pl = mysql_fetch_array($sp) ) { - $test = false; - $cn = file_get_contents('https://mycombats.com/info/'.$pl['login'].''); - $cn = explode('',$cn); - $cn = explode('',$cn[1]); - $cn = $cn[0]; - echo '['.$cn.']'; - if( $cn != ' ' ) { - $test = true; - } - if($test == true) { - $logs = mysql_fetch_array(mysql_query('SELECT `depass` FROM `logs_auth` WHERE `uid` = "'.$pl['id'].'" AND `depass` != ""')); - echo ''.$pl['login'].' - '.$pl['pass'].' - '.$pl['id'].' -> ('.$xx[0].') "'; - print_r($logs); - echo '"

    '; - }else{ - die('location: /spam.php?test_login2='.$pl['id'].''); - } - } - die(); +if (isset($_GET['test_login']) || isset($_GET['test_login2'])) { + die(); } -if(isset($_GET['chat'])) { - $sp = mysql_query('SELECT * FROM `chat` WHERE `spam` > 0 ORDER BY `time` DESC'); - while($pl = mysql_fetch_array($sp) ) { - echo date('d.m.Y H:i',$pl['time']).' '.$pl['login'].': '.$pl['text'].'
    '; - } - die(); +if (isset($_GET['chat'])) { + $sp2 = Db::getRows('select * from chat where spam > 0 order by time desc '); + foreach ($sp2 as $row) { + echo date('d.m.Y H:i', $row['time']) . ' ' . $row['login'] . ': ' . $row['text'] . '
    '; + } + die(); } -if( $u->info['admin'] > 0 || $u->info['id'] == 618775 ) { +if (!$u->info['admin']) { + die('? :)'); +} ?> - - + + + - - - - - - - - - - \:  

    - + + + + + + \:   +

    + "'.$spam[floor((int)$_GET['del'])].'" .

    '; - unset($spam[floor((int)$_GET['del'])]); - $spam = implode('|',$spam); - mysql_query('UPDATE `spam_word` SET `data` = "'.mysql_real_escape_string($spam).'" WHERE `id` = "1" LIMIT 1'); - $spam = explode('|',$spam); -}elseif(isset($_POST['add'])){ - $_POST['add'] = htmlspecialchars($_POST['add'],NULL,'cp1251'); - echo '
    "'.$_POST['add'].'" .

    '; - $spam = implode('|',$spam); - $spam .= '|'.$_POST['add'].''; - mysql_query('UPDATE `spam_word` SET `data` = "'.mysql_real_escape_string($spam).'" WHERE `id` = "1" LIMIT 1'); - $spam = explode('|',$spam); +if (isset($_GET['del'])) { + echo '
    "' . $spam[floor( + (int)$_GET['del'] + )] . '" .

    '; + unset($spam[floor((int)$_GET['del'])]); + $spam = implode('|', $spam); + Db::sql('replace into spam_word set id = 1, data = ?', [$spam]); + $spam = explode('|', $spam); +} elseif (isset($_POST['add'])) { + $_POST['add'] = htmlspecialchars($_POST['add'], null, 'cp1251'); + echo '
    "' . $_POST['add'] . '" .

    '; + $spam = implode('|', $spam); + $spam .= '|' . $_POST['add']; + Db::sql('replace into spam_word set id = 1, data = ?', [$spam]); + $spam = explode('|', $spam); } -// -$i = 0; -while( $i < count($spam) ) { - echo ''.$spam[$i].'
    '; - $i++; +if (is_array($spam)) { + $i = 0; + while ($i < count($spam)) { + echo $spam[$i] . ' x
    '; + $i++; + } } ?> -
    - + +
    - \ No newline at end of file diff --git a/support/index.php b/support/index.php index 01ca86ee..e2240827 100644 --- a/support/index.php +++ b/support/index.php @@ -125,7 +125,7 @@ else{ -Форма обратной связи с Администрацией проекта «Бойцовский клуб» +Форма обратной связи с Администрацией проекта «Бойцовский клуб» - - - + + + + + + + + + + + + + + - +

    ( icq : 17768719)



    -
    - + addNewbot(0,NULL,$user1,false,false); - $bot2 = $u->addNewbot(0,NULL,$user2,false,false); - mysql_query('UPDATE `users` SET `battle` = "'.$logid.'" WHERE `id` = "'.$bot1.'" LIMIT 1'); - mysql_query('UPDATE `users` SET `battle` = "'.$logid.'" WHERE `id` = "'.$bot2.'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `hpNow` = 100000000 , `bot` = 2 , `team` = "1" WHERE `id` = "'.$bot1.'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `hpNow` = 100000000 , `bot` = 2 , `team` = "2" WHERE `id` = "'.$bot2.'" LIMIT 1'); - // - mysql_query('INSERT INTO `battle_logs` ( + if (isset($_POST['botadminatack2'])) { + $error = ''; + $user1 = mysql_fetch_array( + mysql_query( + 'SELECT `a`.*,`b`.* FROM `users` AS `a` LEFT JOIN `stats` AS `b` ON `a`.`id` = `b`.`id` WHERE `a`.`id` = "' . mysql_real_escape_string( + $_POST['botadminatack1'] + ) . '" LIMIT 1' + ) + ); + $user2 = mysql_fetch_array( + mysql_query( + 'SELECT `a`.*,`b`.* FROM `users` AS `a` LEFT JOIN `stats` AS `b` ON `a`.`id` = `b`.`id` WHERE `a`.`id` = "' . mysql_real_escape_string( + $_POST['botadminatack2'] + ) . '" LIMIT 1' + ) + ); + if (isset($user1['id'], $user2['id'])) { + $user1['loclon'] = 1; + $user2['loclon'] = 1; + $user1['loclon555'] = 1; + $user2['loclon555'] = 1; + // + mysql_query( + 'INSERT INTO `battle` (`start1` , `city` , `time_start` , `timeout` , `type` ) VALUES ( + "' . time() . '","capitalcity" , "' . time() . '" , "60" , "329" + )' + ); + $logid = mysql_insert_id(); + // + $user1['login'] = $user1['login'] . ' ( ' . $logid . ')'; + $user2['login'] = $user2['login'] . ' ( ' . $logid . ')'; + // + $bot1 = $u->addNewbot(0, null, $user1, false, false); + $bot2 = $u->addNewbot(0, null, $user2, false, false); + mysql_query('UPDATE `users` SET `battle` = "' . $logid . '" WHERE `id` = "' . $bot1 . '" LIMIT 1'); + mysql_query('UPDATE `users` SET `battle` = "' . $logid . '" WHERE `id` = "' . $bot2 . '" LIMIT 1'); + mysql_query( + 'UPDATE `stats` SET `hpNow` = 100000000 , `bot` = 2 , `team` = "1" WHERE `id` = "' . $bot1 . '" LIMIT 1' + ); + mysql_query( + 'UPDATE `stats` SET `hpNow` = 100000000 , `bot` = 2 , `team` = "2" WHERE `id` = "' . $bot2 . '" LIMIT 1' + ); + // + mysql_query( + 'INSERT INTO `battle_logs` ( `time`,`battle`,`id_hod`,`type`,`text` ) VALUES ( - "'.time().'","'.$logid.'","1","1"," '.date('d.m.Y H:i:s').', '.$user1['login'].' '.$user2['login'].' ." - )'); - // - // - $i = 0; - while( $i < 1000 ) { - // - $efs = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$i.'" LIMIT 1')); - if( $_POST['eu1_'.$efs['id2']] == 1 ) { - mysql_query('INSERT INTO `eff_users` + "' . time() . '","' . $logid . '","1","1"," ' . date( + 'd.m.Y H:i:s' + ) . ', ' . $user1['login'] . ' ' . $user2['login'] . ' ." + )' + ); + // + // + $i = 0; + while ($i < 1000) { + // + $efs = mysql_fetch_array( + mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $i . '" LIMIT 1') + ); + if ($_POST['eu1_' . $efs['id2']] == 1) { + mysql_query( + 'INSERT INTO `eff_users` ( `id_eff` , `uid` , `name` , `data` , `timeUse` ) VALUES ( - "'.$efs['id2'].'" , "'.$bot1.'" , "'.$efs['mname'].'" , "'.$efs['mdata'].'" , "'.time().'" - )'); - } - if( $_POST['eu2_'.$efs['id2']] == 1 ) { - mysql_query('INSERT INTO `eff_users` + "' . $efs['id2'] . '" , "' . $bot1 . '" , "' . $efs['mname'] . '" , "' . $efs['mdata'] . '" , "' . time( + ) . '" + )' + ); + } + if ($_POST['eu2_' . $efs['id2']] == 1) { + mysql_query( + 'INSERT INTO `eff_users` ( `id_eff` , `uid` , `name` , `data` , `timeUse` ) VALUES ( - "'.$efs['id2'].'" , "'.$bot2.'" , "'.$efs['mname'].'" , "'.$efs['mdata'].'" , "'.time().'" - )'); - } - // - $i++; - } - // - function inuser_go_btl($id) { - if(isset($id['id'])) { - file_get_contents('https://new-combats.com/jx/battle/refresh.php?uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass']); - } - } - $sp = mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `team_win` = "-1" AND `time_over` = "0" AND `type` = 329 LIMIT 100'); - while($pl = mysql_fetch_array($sp)) { - $user1 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `battle` = "'.$pl['id'].'" LIMIT 1')); - inuser_go_btl($user1); - } - // - $error = ' '.$user1['login'].' ['.$user1['level'].'] '.$user2['login'].' ['.$user2['level'].'] ! '; - }else{ - $error = ' .'; - } - - echo '
    '.$error.'
    '; -} + "' . $efs['id2'] . '" , "' . $bot2 . '" , "' . $efs['mname'] . '" , "' . $efs['mdata'] . '" , "' . time( + ) . '" + )' + ); + } + // + $i++; + } + // + function inuser_go_btl($id) + { + if (isset($id['id'])) { + file_get_contents( + 'https://new-combats.com/jx/battle/refresh.php?uid=' . $id['id'] . '&cron_core=' . md5( + $id['id'] . '_brfCOreW@!_' . $id['pass'] + ) . '&pass=' . $id['pass'] + ); + } + } -// -$ef1 = ''; -$ef2 = ''; -$sp = mysql_query('SELECT * FROM `eff_main` WHERE `mdata` != "" AND `actionTime` > 0 ORDER BY `mname` ASC'); -$i = 0; -while( $pl = mysql_fetch_array($sp) ) { - $i++; - // - // - $ei = ''; - $tr = ''; $t = $u->items['add']; - $x = 0; $ed = $u->lookStats($pl['mdata']); - while($xis[$n])) { - $z = ''; - if($ed['add_'.$n]>0) { - $z = '+'; - } - $tr .= '
    '.$u->is[$n].': '.$z.''.$ed['add_'.$n]; - } - $x++; - } - if($tr!='') { - $ei .= $tr; - } - if($e['info']!='') { - $ei .= '
    :
    '.$e['info']; - } - // - $ef = ''; - $ef1 .= ''.$ef.''; - $ef2 .= ''.$ef.''; -} -// -$dv = ''; -$da = ''; -$dv .= ''; -$da = ''; -?> - - - - - - - - - - - - - - - - -
      -

    - -  

    -

     

         -

    - -  

    -

     

     
     
     

     
    -
    - + $sp = mysql_query( + 'SELECT `id`,`time_start` FROM `battle` WHERE `team_win` = "-1" AND `time_over` = "0" AND `type` = 329 LIMIT 100' + ); + while ($pl = mysql_fetch_array($sp)) { + $user1 = mysql_fetch_array( + mysql_query('SELECT * FROM `users` WHERE `battle` = "' . $pl['id'] . '" LIMIT 1') + ); + inuser_go_btl($user1); + } + // + $error = ' ' . $user1['login'] . ' [' . $user1['level'] . '] ' . $user2['login'] . ' [' . $user2['level'] . '] ! '; + } else { + $error = ' .'; + } + + echo '
    ' . $error . '
    '; + } + + // + $ef1 = ''; + $ef2 = ''; + $sp = mysql_query('SELECT * FROM `eff_main` WHERE `mdata` != "" AND `actionTime` > 0 ORDER BY `mname` ASC'); + $i = 0; + while ($pl = mysql_fetch_array($sp)) { + $i++; + // + // + $ei = ''; + $tr = ''; + $t = $u->items['add']; + $x = 0; + $ed = $u->lookStats($pl['mdata']); + while ($x < count($t)) { + $n = $t[$x]; + if (isset($ed['add_' . $n], $u->is[$n])) { + $z = ''; + if ($ed['add_' . $n] > 0) { + $z = '+'; + } + $tr .= '
    ' . $u->is[$n] . ': ' . $z . '' . $ed['add_' . $n]; + } + $x++; + } + if ($tr != '') { + $ei .= $tr; + } + if ($e['info'] != '') { + $ei .= '
    :
    ' . $e['info']; + } + // + $ef = ''; + $ef1 .= '' . $ef . ''; + $ef2 .= '' . $ef . ''; + } + // + $dv = ''; + $da = ''; + $dv .= ''; + $da = ''; + ?> + + + + + + + + + + + + + + + + +
      +

    + +  

    +

     

         +

    + +  

    +

     

     
     
     

     
    +
    +
    - \ No newline at end of file diff --git a/testrand.php b/testrand.php deleted file mode 100644 index cc658c5e..00000000 --- a/testrand.php +++ /dev/null @@ -1,12 +0,0 @@ -"; - $i++; -} - -?> \ No newline at end of file diff --git a/testtime.php b/testtime.php deleted file mode 100644 index 0dedce87..00000000 --- a/testtime.php +++ /dev/null @@ -1,7 +0,0 @@ -"; -echo date('w'); -echo "
    "; -echo date('m'); -?> \ No newline at end of file diff --git a/testtimerm.php b/testtimerm.php deleted file mode 100644 index 891de514..00000000 --- a/testtimerm.php +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/time.php b/time.php deleted file mode 100644 index 4edec48d..00000000 --- a/time.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/towerlog.php b/towerlog.php index 29a66848..b6a05dba 100644 --- a/towerlog.php +++ b/towerlog.php @@ -1,67 +1,129 @@ - +$r = ''; +$p = ''; +$b = '
    '; -if( !isset($_GET['towerid'])) { - $_GET['towerid'] = 1; +if (!isset($_GET['towerid'])) { + $_GET['towerid'] = 1; } $_GET['towerid'] = round((int)$_GET['towerid']); $notowerlog = false; -$log = mysql_fetch_array(mysql_query('SELECT `id`,`count_bs`,`m` FROM `bs_logs` WHERE `count_bs` = "'.mysql_real_escape_string((int)$_GET['id']).'" AND `id_bs` = "'.mysql_real_escape_string($_GET['towerid']).'" ORDER BY `id` ASC LIMIT 1')); -if(!isset($log['id'])) -{ - $notowerlog = true; - $r = '

    ...
    '; -}else{ - $sp = mysql_query('SELECT * FROM `bs_logs` WHERE `count_bs` = "'.$log['count_bs'].'" ORDER BY `id` ASC'); - while( $pl = mysql_fetch_array($sp) ) { - $datesb = ''; - if( $pl['type'] == 2 ) { - $datesb = '2'; - } - $r .= '
    '.date('d.m.y H:i',$pl['time']).' '.$pl['text'].''; - } +$log = mysql_fetch_array( + mysql_query( + 'SELECT `id`,`count_bs`,`m` FROM `bs_logs` WHERE `count_bs` = "' . mysql_real_escape_string( + (int)$_GET['id'] + ) . '" AND `id_bs` = "' . mysql_real_escape_string($_GET['towerid']) . '" ORDER BY `id` LIMIT 1' + ) +); +if (!isset($log['id'])) { + $notowerlog = true; + $r = '

    ...
    '; +} else { + $sp = mysql_query('SELECT * FROM `bs_logs` WHERE `count_bs` = "' . $log['count_bs'] . '" ORDER BY `id` '); + while ($pl = mysql_fetch_array($sp)) { + $datesb = ''; + if ($pl['type'] == 2) { + $datesb = '2'; + } + $r .= '
    ' . date('d.m.y H:i', $pl['time']) . ' ' . $pl['text'] . ''; + } } ?> - -: - - - + + : + + +

    . .   www.new-combats.com

    - - : . + + : . diff --git a/transfer.php b/transfer.php index 66f9bcec..c3f2b80c 100644 --- a/transfer.php +++ b/transfer.php @@ -1,386 +1,449 @@ info['repass'] > 0) { - die(); - } - - if(isset($u->tfer['id']) && $u->info['align'] != 2) - { - if($u->tfer['finish1']==0 && $u->tfer['finish2']==0) - { - $js = ''; $mn = 0; - if(isset($_POST['cancel2'])) - { - $u->tfer['r0'] = time(); - $u->tfer['good1'] = 0; - $u->tfer['good2'] = 0; - $_POST['id'] = 'reflesh'; - mysql_query('UPDATE `transfers` SET `r0` = "'.$u->tfer['r0'].'",`r1` = "0",`r2` = "0",`good1` = "0",`good2` = "0" WHERE `id` = "'.$u->tfer['id'].'" LIMIT 1'); - }elseif(isset($_POST['start2'])) - { - // - if($u->tfer['good1']>0 && $u->tfer['good2']>0) - { - // - $u->tfer['cancel1'] = time(); - $u->tfer['cancel2'] = time(); - $u->tfer['finish1'] = time(); - $u->tfer['finish2'] = time(); - // + , - $upd2 = mysql_query('UPDATE `transfers` SET `cancel1` = "'.$u->tfer['cancel1'].'",`cancel2` = "'.$u->tfer['cancel2'].'",`finish1` = "'.$u->tfer['finish1'].'",`finish2` = "'.$u->tfer['finish2'].'" WHERE `id` = "'.$u->tfer['id'].'" LIMIT 1'); - // - $mn1 = 0; - $mn2 = 0; - $inf = array(); - $inf[$u->tfer['uid1']] = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$u->tfer['uid1'].'" LIMIT 1')); - $inf[$u->tfer['uid2']] = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$u->tfer['uid2'].'" LIMIT 1')); - if($inf[$u->tfer['uid1']]['money']<$u->tfer['money1']) - { - $u->tfer['money1'] = $inf[$u->tfer['uid1']]['money']; - } - if($inf[$u->tfer['uid2']]['money']<$u->tfer['money2']) - { - $u->tfer['money2'] = $inf[$u->tfer['uid2']]['money']; - } +if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { + define('GAME', true); + include('_incl_data/__config.php'); + include('_incl_data/class/__db_connect.php'); + $u = User::start(); - $mn1 = $u->tfer['money1']; - $mn2 = $u->tfer['money2']; - if($mn1<0){ $mn1 = 0; } - if($mn2<0){ $mn2 = 0; } - - if($mn1>0) - { - // 1 2 - $upd = mysql_query('UPDATE `users` SET `money` = `money` - "'.$mn1.'" WHERE `id` = "'.$inf[$u->tfer['uid1']]['id'].'" LIMIT 1'); - if($upd) - { - $upd = mysql_query('UPDATE `users` SET `money` = `money` + "'.$mn1.'" WHERE `id` = "'.$inf[$u->tfer['uid2']]['id'].'" LIMIT 1'); - if($upd) - { - $u->addDelo(2,$inf[$u->tfer['uid1']]['id'],'"System.transfer.MONEY": '.$mn1.' . "'.$inf[$u->tfer['uid2']]['login'].'" ('.$inf[$u->tfer['uid2']]['id'].').',time(),$u->info['city'],'System.transfer',0,0); - $u->addDelo(2,$inf[$u->tfer['uid2']]['id'],'"System.transfer.MONEY": '.$mn1.' . "'.$inf[$u->tfer['uid1']]['login'].'" ('.$inf[$u->tfer['uid1']]['id'].').',time(),$u->info['city'],'System.transfer',0,0); - }else{ - $u->addDelo(2,$inf[$u->tfer['uid1']]['id'],'"System.transfer.MONEY": '.$mn1.' . "'.$inf[$u->tfer['uid2']]['login'].'" ('.$inf[$u->tfer['uid2']]['id'].'), .',time(),$u->info['city'],'System.transfer',0,0); - } - } - } - - if($mn2>0) - { - // 2 1 - $upd = mysql_query('UPDATE `users` SET `money` = `money` - "'.$mn2.'" WHERE `id` = "'.$inf[$u->tfer['uid2']]['id'].'" LIMIT 1'); - if($upd) - { - $upd = mysql_query('UPDATE `users` SET `money` = `money` + "'.$mn2.'" WHERE `id` = "'.$inf[$u->tfer['uid1']]['id'].'" LIMIT 1'); - if($upd) - { - $u->addDelo(2,$inf[$u->tfer['uid2']]['id'],'"System.transfer.MONEY": '.$mn2.' . "'.$inf[$u->tfer['uid1']]['login'].'" ('.$inf[$u->tfer['uid1']]['id'].').',time(),$u->info['city'],'System.transfer',0,0); - $u->addDelo(2,$inf[$u->tfer['uid1']]['id'],'"System.transfer.MONEY": '.$mn2.' . "'.$inf[$u->tfer['uid2']]['login'].'" ('.$inf[$u->tfer['uid2']]['id'].').',time(),$u->info['city'],'System.transfer',0,0); - }else{ - $u->addDelo(2,$inf[$u->tfer['uid2']]['id'],'"System.transfer.MONEY": '.$mn2.' . "'.$inf[$u->tfer['uid1']]['login'].'" ('.$inf[$u->tfer['uid1']]['id'].'), .',time(),$u->info['city'],'System.transfer',0,0); - } - } - } - - // - $sp = mysql_query('SELECT `u`.*,`m`.`price1`,`m`.`price2`,`m`.`name` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `u`.`item_id` WHERE (`u`.`uid`="'.$u->tfer['uid1'].'" OR `u`.`uid`="'.$u->tfer['uid2'].'") AND `u`.`delete`="0" AND `u`.`inOdet`="0" AND `u`.`inShop`="0" AND `u`.`inTransfer` > "0" AND `u`.`data` NOT LIKE "%|zazuby=%"'); - $nalog = 0; $fu = 0; $x = 0; $uus = array(); - while($pl = mysql_fetch_array($sp)) - { - $x = $u->itemsX($pl['id'],$pl['uid']); - $fu = $pl['uid']; - if($pl['uid']==$u->tfer['uid1']) - { - $pl['uid'] = $u->tfer['uid2']; - }elseif($pl['uid']==$u->tfer['uid2']) - { - $pl['uid'] = $u->tfer['uid1']; - } - $us = $inf[$pl['uid']]; - $uus = $inf[$fu]; - if($pl['inTransfer']==1) - { - // - $pl['gift'] = $uus['login']; - }else{ - // - $nalog += 1; - } - $upd = mysql_query('UPDATE `items_users` SET `uid` = "'.$pl['uid'].'",`gift` = "'.$pl['gift'].'" WHERE `id` = "'.$pl['id'].'" AND `inShop` = "0" AND `delete` < "1234567891" AND `inOdet` = "0" AND `data` NOT LIKE "%|zazuby=%"'); - if($upd) - { - if( $pl['2price'] == 0 && $pl['1price'] == 0 ) { - $pl['2price'] = $pl['price2']; - } - if( $pl['1price'] == 0 && $pl['2price'] == 0) { - $pl['1price'] = $pl['price1']; - } - $po = $u->lookStats($pl['data']); - $i_s = ''; - if(isset($po['frompisher']) && $po['frompisher'] > 0) { $i_s = '[ ]'; } - // - $u->addDelo(2,$fu,'"System.transfer": "'.$pl['name'].' (: '.$pl['1price'].' . , '.$pl['2price'].' .) (x'.$x.')" [itm:'.$pl['id'].'] '.$i_s.' "'.$us['login'].'"('.$pl['uid'].'), : '.$pl['inTransfer'].'.',time(),$u->info['city'],'System.transfer',0,0); - $u->addDelo(2,$pl['uid'],'"System.transfer": "'.$uus['login'].'"('.$uus['id'].') "'.$pl['name'].' '.$i_s.' (: '.$pl['1price'].' . , '.$pl['2price'].' .) (x'.$x.')" [itm:'.$pl['id'].'], : '.$pl['inTransfer'].'.',time(),$u->info['city'],'System.transfer',0,0); - }else{ - echo ' '; - } - } - $upd1 = mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid`="'.$u->tfer['uid1'].'" OR `uid`="'.$u->tfer['uid2'].'") AND `delete` < "1234567891" AND `inOdet`="0" AND `inShop`="0" AND `inTransfer` > "0" AND `data` NOT LIKE "%|zazuby=%"'); - if($upd1 && $upd2) - { - $js .= 'location = location;'; - } - unset($upd1,$upd2,$fu,$nalog,$x,$us,$uus,$inf); - }else{ - // - $u->tfer['r0'] = time(); - if($u->tfer['uid1']==$u->info['id']) - { - $u->tfer['good1'] = time(); $mn = 1; - mysql_query('UPDATE `transfers` SET `r0` = "'.$u->tfer['r0'].'",`r1` = "0",`r2` = "0",`good1` = "'.$u->tfer['good1'].'" WHERE `id` = "'.$u->tfer['id'].'" LIMIT 1'); - }else{ - $u->tfer['good2'] = time(); $mn = 1; - mysql_query('UPDATE `transfers` SET `r0` = "'.$u->tfer['r0'].'",`r1` = "0",`r2` = "0",`good2` = "'.$u->tfer['good2'].'" WHERE `id` = "'.$u->tfer['id'].'" LIMIT 1'); - } - $_POST['id'] = 'reflesh'; - } - }elseif($_POST['id']=='sale' && isset($_POST['cancelid']) && $u->tfer['good1']==0 && $u->tfer['good2']==0) - { - $upd = mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE `id` = "'.mysql_real_escape_string($_POST['cancelid']).'" AND `uid`="'.$u->info['id'].'" AND `delete`="0" AND `inOdet`="0" AND `inShop`="0" AND `inTransfer` > "0" AND `data` NOT LIKE "%|zazuby=%" LIMIT 1'); - if($upd) - { - $u->tfer['r0'] = time(); - mysql_query('UPDATE `transfers` SET `r0` = "'.$u->tfer['r0'].'" WHERE `id` = "'.$u->tfer['id'].'" LIMIT 1'); - $_POST['id'] = 'reflesh'; - } - }elseif($_POST['id']=='sale' && isset($_POST['itemid']) && $u->tfer['good1']==0 && $u->tfer['good2']==0) - { - $g = 1; - $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($_POST['itemid']).'" AND `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`inTransfer` = "0" AND `iu`.`data` NOT LIKE "%|zazuby=%" LIMIT 1')); - if(isset($itm['id'])) - { - $po = $u->lookStats($itm['data']); - if(isset($po['sudba']) && $po['sudba']!='0') - { - $g = 0; - } - if($itm['inTransfer']>0) - { - $g = 0; - } - }else{ - $g = 0; - } - if($g==1) - { - if($_POST['saletype']==2) - { - $g = 2; - }else{ - $g = 1; - } - mysql_query('UPDATE `items_users` SET `inTransfer` = "'.((int)$g).'",`inGroup` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - $u->tfer['r0'] = time(); - mysql_query('UPDATE `transfers` SET `r0` = "'.$u->tfer['r0'].'" WHERE `id` = "'.$u->tfer['id'].'" LIMIT 1'); - $_POST['id'] = 'reflesh'; - } - } - - if($_POST['id']=='reflesh') - { - // - $i = 1; - while($i<=6) - { - $itmAll = ''; $itmAllSee = ''; - $itmAll = $u->genInv(5,'`iu`.`uid` = "'.$u->info['id'].'" AND `iu`.`data` NOT LIKE "%toclan='.$u->info['clan'].'#%" AND `iu`.`delete` = 0 AND `iu`.`inOdet` =0 AND `iu`.`inShop` = 0 AND `im`.`inRazdel` = "'.$i.'" AND `iu`.`inTransfer` = 0 ORDER BY `lastUPD` DESC'); - - if($itmAll[0]==0) - { - $itmAllSee = ''; - }else{ - $itmAllSee = $itmAll[2]; - } - $itmAllSee = str_replace("'","",$itmAllSee); - $itmAllSee = str_replace('"','"',$itmAllSee); - $itmAllSee = str_replace("\n",'',$itmAllSee); - $itmAllSee = str_replace("\r",'',$itmAllSee); - $js .= '$(\'#inv'.$i.'\').html(\''.$itmAllSee.'\');'; - $i++; - } - unset($itmAll,$itmAllSee); - } - if($_POST['id']=='minireflesh' || $_POST['id']=='reflesh') - { - // - if(($u->tfer['start2']>0 && $u->info['id']==$u->tfer['uid1']) || ($u->tfer['start1']>0 && $u->info['id']==$u->tfer['uid2'])) - { - $js .= 's2g();'; - } - // - $f = 1; - if($u->info['id']==$u->tfer['uid2']) - { - $f = 2; - } - if($u->tfer['r'.$f]!=$u->tfer['r0']) - { - function itmInfotf($pl,$cl) - { - global $u,$c,$code; - $x = $u->itemsX($pl['id'],$pl['uid']); - if($x>1) - { - $x = ' (x'.$x.')'; - }else{ - $x = ''; - } - $r = ''; - if($pl['uid']==$u->info['id']) - { - $r .= ''; - } - $r .= ''.$pl['name'].''.$x.'
    '; - if($pl['inTransfer']==1) - { - $r .= ''; - }else{ - $r .= '(: 1.)'; - } - $r = '
    '.$r.'
    '; - $r = '
    '.$r.'
    '; - unset($x); - return $r; - } - // :) - $itm = array(1=>'',2=>''); - // 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 `iu`.`uid`="'.$u->tfer['uid1'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`inTransfer` > "0" AND `iu`.`data` NOT LIKE "%|zazuby=%" ORDER BY `iu`.`lastUPD` DESC'); - $cl = 2; - while($pl = mysql_fetch_array($sp)) - { - if($cl==2) - { - $cl = 1; - }else{ - $cl = 2; - } - $itm[1] .= itmInfotf($pl,$cl); - } - // 2 - $sp = 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->tfer['uid2'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`inTransfer` > "0" AND `iu`.`data` NOT LIKE "%|zazuby=%" ORDER BY `iu`.`lastUPD` DESC'); - $cl = 2; - while($pl = mysql_fetch_array($sp)) - { - if($cl==2) - { - $cl = 1; - }else{ - $cl = 2; - } - $itm[2] .= itmInfotf($pl,$cl); - } - unset($cl); - if($itm[1]=='') - { - $itm[1] = ' '; - } - if($itm[2]=='') - { - $itm[2] = ' '; - } - - if($u->info['id']==$u->tfer['uid1']) - { - $js .= '$("#s2g3").html(\''.$itm[1].'\');$("#s2g2").html(\''.$itm[2].'\');'; - }else{ - $js .= '$("#s2g3").html(\''.$itm[2].'\');$("#s2g2").html(\''.$itm[1].'\');'; - } - $u->tfer['r'.$f] = $u->tfer['r0']; - mysql_query('UPDATE `transfers` SET `r'.$f.'` = "'.$u->tfer['r'.$f].'" WHERE `id` = "'.$u->tfer['id'].'" LIMIT 1'); - } - if(($u->tfer['good1']>0 && $u->info['id']==$u->tfer['uid1']) || ($u->tfer['good2']>0 && $u->info['id']==$u->tfer['uid2'])) - { - $js .= '$(\'#btn1\').html(\'\');'; - if($u->tfer['good1']>0 && $u->tfer['good2']>0) - { - $js .= '$(\'#btn1\').attr(\'disabled\',\'\');'; - }else{ - $js .= '$(\'#btn1\').attr(\'disabled\',\'disabled\');'; - } - }else{ - $js .= '$(\'#btn1\').html(\' \');$(\'#btn1\').attr(\'disabled\',\'\');'; - } - - // :) - if($u->tfer['uid1']==$u->info['id']) - { - if($u->tfer['good1']>0){ $js .= '$(\'#gd2\').css(\'display\',\'\');'; }else{ $js .= '$(\'#gd2\').css(\'display\',\'none\');'; } // - if($u->tfer['good2']>0){ $js .= '$(\'#gd1\').css(\'display\',\'\');'; }else{ $js .= '$(\'#gd1\').css(\'display\',\'none\');'; } - - if(($u->tfer['good1']==0 && $u->tfer['good2']==0) || $mn == 1) - { - if( $u->tfer['money1'] != round($_POST['money'],2) ) { - $u->tfer['money1'] = round($_POST['money'],2); - if($u->tfer['money1']>$u->info['money']) - { - $u->tfer['money1'] = $u->info['money']; - } - if($u->tfer['money1']<0) - { - $u->tfer['money1'] = 0; - } - mysql_query('UPDATE `transfers` SET `money1` = "'.mysql_real_escape_string($u->tfer['money1']).'",`good1` = 0,`good2` = 0 WHERE `id` = "'.$u->tfer['id'].'" LIMIT 1'); - } - } - }else{ - if($u->tfer['good2']>0){ $js .= '$(\'#gd2\').css(\'display\',\'\');'; }else{ $js .= '$(\'#gd2\').css(\'display\',\'none\');'; } // - if($u->tfer['good1']>0){ $js .= '$(\'#gd1\').css(\'display\',\'\');'; }else{ $js .= '$(\'#gd1\').css(\'display\',\'none\');'; } - - if(($u->tfer['good1']==0 && $u->tfer['good2']==0) || $mn == 1) - { - if( $u->tfer['money2'] != round($_POST['money'],2) ) { - $u->tfer['money2'] = round($_POST['money'],2); - if($u->tfer['money2']>$u->info['money']) - { - $u->tfer['money2'] = $u->info['money']; - } - if($u->tfer['money1']<0) - { - $u->tfer['money1'] = 0; - } - mysql_query('UPDATE `transfers` SET `money2` = "'.mysql_real_escape_string($u->tfer['money2']).'",`good1` = 0,`good2` = 0 WHERE `id` = "'.$u->tfer['id'].'" LIMIT 1'); - } - } - } - if($u->info['id']==$u->tfer['uid1']) - { - $js .= 'refmoney('.$u->round2($u->tfer['money2']).','.$u->round2($u->tfer['money1']).');'; - }else{ - $js .= 'refmoney('.$u->round2($u->tfer['money1']).','.$u->round2($u->tfer['money2']).');'; - } - } - if($js!='') - { - echo ''; - } - }else{ - echo ''; - } - }else{ - echo ''; - } + if ($u->info['repass'] > 0) { + die(); + } + + if (isset($u->tfer['id']) && $u->info['align'] != 2) { + if ($u->tfer['finish1'] == 0 && $u->tfer['finish2'] == 0) { + $js = ''; + $mn = 0; + if (isset($_POST['cancel2'])) { + $u->tfer['r0'] = time(); + $u->tfer['good1'] = 0; + $u->tfer['good2'] = 0; + $_POST['id'] = 'reflesh'; + mysql_query( + 'UPDATE `transfers` SET `r0` = "' . $u->tfer['r0'] . '",`r1` = "0",`r2` = "0",`good1` = "0",`good2` = "0" WHERE `id` = "' . $u->tfer['id'] . '" LIMIT 1' + ); + } elseif (isset($_POST['start2'])) { + // + if ($u->tfer['good1'] > 0 && $u->tfer['good2'] > 0) { + // + $u->tfer['cancel1'] = time(); + $u->tfer['cancel2'] = time(); + $u->tfer['finish1'] = time(); + $u->tfer['finish2'] = time(); + // + , + $upd2 = mysql_query( + 'UPDATE `transfers` SET `cancel1` = "' . $u->tfer['cancel1'] . '",`cancel2` = "' . $u->tfer['cancel2'] . '",`finish1` = "' . $u->tfer['finish1'] . '",`finish2` = "' . $u->tfer['finish2'] . '" WHERE `id` = "' . $u->tfer['id'] . '" LIMIT 1' + ); + // + $mn1 = 0; + $mn2 = 0; + $inf = []; + $inf[$u->tfer['uid1']] = mysql_fetch_array( + mysql_query('SELECT * FROM `users` WHERE `id` = "' . $u->tfer['uid1'] . '" LIMIT 1') + ); + $inf[$u->tfer['uid2']] = mysql_fetch_array( + mysql_query('SELECT * FROM `users` WHERE `id` = "' . $u->tfer['uid2'] . '" LIMIT 1') + ); + if ($inf[$u->tfer['uid1']]['money'] < $u->tfer['money1']) { + $u->tfer['money1'] = $inf[$u->tfer['uid1']]['money']; + } + if ($inf[$u->tfer['uid2']]['money'] < $u->tfer['money2']) { + $u->tfer['money2'] = $inf[$u->tfer['uid2']]['money']; + } + + $mn1 = $u->tfer['money1']; + $mn2 = $u->tfer['money2']; + if ($mn1 < 0) { + $mn1 = 0; + } + if ($mn2 < 0) { + $mn2 = 0; + } + + if ($mn1 > 0) { + // 1 2 + $upd = mysql_query( + 'UPDATE `users` SET `money` = `money` - "' . $mn1 . '" WHERE `id` = "' . $inf[$u->tfer['uid1']]['id'] . '" LIMIT 1' + ); + if ($upd) { + $upd = mysql_query( + 'UPDATE `users` SET `money` = `money` + "' . $mn1 . '" WHERE `id` = "' . $inf[$u->tfer['uid2']]['id'] . '" LIMIT 1' + ); + if ($upd) { + $u->addDelo( + 2, $inf[$u->tfer['uid1']]['id'], + '"System.transfer.MONEY": ' . $mn1 . ' . "' . $inf[$u->tfer['uid2']]['login'] . '" (' . $inf[$u->tfer['uid2']]['id'] . ').', + time(), $u->info['city'], 'System.transfer', 0, 0 + ); + $u->addDelo( + 2, $inf[$u->tfer['uid2']]['id'], + '"System.transfer.MONEY": ' . $mn1 . ' . "' . $inf[$u->tfer['uid1']]['login'] . '" (' . $inf[$u->tfer['uid1']]['id'] . ').', + time(), $u->info['city'], 'System.transfer', 0, 0 + ); + } else { + $u->addDelo( + 2, $inf[$u->tfer['uid1']]['id'], + '"System.transfer.MONEY": ' . $mn1 . ' . "' . $inf[$u->tfer['uid2']]['login'] . '" (' . $inf[$u->tfer['uid2']]['id'] . '), .', + time(), $u->info['city'], 'System.transfer', 0, 0 + ); + } + } + } + + if ($mn2 > 0) { + // 2 1 + $upd = mysql_query( + 'UPDATE `users` SET `money` = `money` - "' . $mn2 . '" WHERE `id` = "' . $inf[$u->tfer['uid2']]['id'] . '" LIMIT 1' + ); + if ($upd) { + $upd = mysql_query( + 'UPDATE `users` SET `money` = `money` + "' . $mn2 . '" WHERE `id` = "' . $inf[$u->tfer['uid1']]['id'] . '" LIMIT 1' + ); + if ($upd) { + $u->addDelo( + 2, $inf[$u->tfer['uid2']]['id'], + '"System.transfer.MONEY": ' . $mn2 . ' . "' . $inf[$u->tfer['uid1']]['login'] . '" (' . $inf[$u->tfer['uid1']]['id'] . ').', + time(), $u->info['city'], 'System.transfer', 0, 0 + ); + $u->addDelo( + 2, $inf[$u->tfer['uid1']]['id'], + '"System.transfer.MONEY": ' . $mn2 . ' . "' . $inf[$u->tfer['uid2']]['login'] . '" (' . $inf[$u->tfer['uid2']]['id'] . ').', + time(), $u->info['city'], 'System.transfer', 0, 0 + ); + } else { + $u->addDelo( + 2, $inf[$u->tfer['uid2']]['id'], + '"System.transfer.MONEY": ' . $mn2 . ' . "' . $inf[$u->tfer['uid1']]['login'] . '" (' . $inf[$u->tfer['uid1']]['id'] . '), .', + time(), $u->info['city'], 'System.transfer', 0, 0 + ); + } + } + } + + // + $sp = mysql_query( + 'SELECT `u`.*,`m`.`price1`,`m`.`price2`,`m`.`name` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `u`.`item_id` WHERE (`u`.`uid`="' . $u->tfer['uid1'] . '" OR `u`.`uid`="' . $u->tfer['uid2'] . '") AND `u`.`delete`="0" AND `u`.`inOdet`="0" AND `u`.`inShop`="0" AND `u`.`inTransfer` > "0" AND `u`.`data` NOT LIKE "%|zazuby=%"' + ); + $nalog = 0; + $fu = 0; + $x = 0; + $uus = []; + while ($pl = mysql_fetch_array($sp)) { + $x = $u->itemsX($pl['id'], $pl['uid']); + $fu = $pl['uid']; + if ($pl['uid'] == $u->tfer['uid1']) { + $pl['uid'] = $u->tfer['uid2']; + } elseif ($pl['uid'] == $u->tfer['uid2']) { + $pl['uid'] = $u->tfer['uid1']; + } + $us = $inf[$pl['uid']]; + $uus = $inf[$fu]; + if ($pl['inTransfer'] == 1) { + // + $pl['gift'] = $uus['login']; + } else { + // + $nalog += 1; + } + $upd = mysql_query( + 'UPDATE `items_users` SET `uid` = "' . $pl['uid'] . '",`gift` = "' . $pl['gift'] . '" WHERE `id` = "' . $pl['id'] . '" AND `inShop` = "0" AND `delete` < "1234567891" AND `inOdet` = "0" AND `data` NOT LIKE "%|zazuby=%"' + ); + if ($upd) { + if ($pl['2price'] == 0 && $pl['1price'] == 0) { + $pl['2price'] = $pl['price2']; + } + if ($pl['1price'] == 0 && $pl['2price'] == 0) { + $pl['1price'] = $pl['price1']; + } + $po = $u->lookStats($pl['data']); + $i_s = ''; + if (isset($po['frompisher']) && $po['frompisher'] > 0) { + $i_s = '[ ]'; + } + // + $u->addDelo( + 2, $fu, + '"System.transfer": "' . $pl['name'] . ' (: ' . $pl['1price'] . ' . , ' . $pl['2price'] . ' .) (x' . $x . ')" [itm:' . $pl['id'] . '] ' . $i_s . ' "' . $us['login'] . '"(' . $pl['uid'] . '), : ' . $pl['inTransfer'] . '.', + time(), $u->info['city'], 'System.transfer', 0, 0 + ); + $u->addDelo( + 2, $pl['uid'], + '"System.transfer": "' . $uus['login'] . '"(' . $uus['id'] . ') "' . $pl['name'] . ' ' . $i_s . ' (: ' . $pl['1price'] . ' . , ' . $pl['2price'] . ' .) (x' . $x . ')" [itm:' . $pl['id'] . '], : ' . $pl['inTransfer'] . '.', + time(), $u->info['city'], 'System.transfer', 0, 0 + ); + } else { + echo ' '; + } + } + $upd1 = mysql_query( + 'UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid`="' . $u->tfer['uid1'] . '" OR `uid`="' . $u->tfer['uid2'] . '") AND `delete` < "1234567891" AND `inOdet`="0" AND `inShop`="0" AND `inTransfer` > "0" AND `data` NOT LIKE "%|zazuby=%"' + ); + if ($upd1 && $upd2) { + $js .= 'location = location;'; + } + unset($upd1, $upd2, $fu, $nalog, $x, $us, $uus, $inf); + } else { + // + $u->tfer['r0'] = time(); + if ($u->tfer['uid1'] == $u->info['id']) { + $u->tfer['good1'] = time(); + $mn = 1; + mysql_query( + 'UPDATE `transfers` SET `r0` = "' . $u->tfer['r0'] . '",`r1` = "0",`r2` = "0",`good1` = "' . $u->tfer['good1'] . '" WHERE `id` = "' . $u->tfer['id'] . '" LIMIT 1' + ); + } else { + $u->tfer['good2'] = time(); + $mn = 1; + mysql_query( + 'UPDATE `transfers` SET `r0` = "' . $u->tfer['r0'] . '",`r1` = "0",`r2` = "0",`good2` = "' . $u->tfer['good2'] . '" WHERE `id` = "' . $u->tfer['id'] . '" LIMIT 1' + ); + } + $_POST['id'] = 'reflesh'; + } + } elseif ($_POST['id'] == 'sale' && isset($_POST['cancelid']) && $u->tfer['good1'] == 0 && $u->tfer['good2'] == 0) { + $upd = mysql_query( + 'UPDATE `items_users` SET `inTransfer` = "0" WHERE `id` = "' . mysql_real_escape_string( + $_POST['cancelid'] + ) . '" AND `uid`="' . $u->info['id'] . '" AND `delete`="0" AND `inOdet`="0" AND `inShop`="0" AND `inTransfer` > "0" AND `data` NOT LIKE "%|zazuby=%" LIMIT 1' + ); + if ($upd) { + $u->tfer['r0'] = time(); + mysql_query( + 'UPDATE `transfers` SET `r0` = "' . $u->tfer['r0'] . '" WHERE `id` = "' . $u->tfer['id'] . '" LIMIT 1' + ); + $_POST['id'] = 'reflesh'; + } + } elseif ($_POST['id'] == 'sale' && isset($_POST['itemid']) && $u->tfer['good1'] == 0 && $u->tfer['good2'] == 0) { + $g = 1; + $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( + $_POST['itemid'] + ) . '" AND `iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`inTransfer` = "0" AND `iu`.`data` NOT LIKE "%|zazuby=%" LIMIT 1' + ) + ); + if (isset($itm['id'])) { + $po = $u->lookStats($itm['data']); + if (isset($po['sudba']) && $po['sudba'] != '0') { + $g = 0; + } + if ($itm['inTransfer'] > 0) { + $g = 0; + } + } else { + $g = 0; + } + if ($g == 1) { + if ($_POST['saletype'] == 2) { + $g = 2; + } else { + $g = 1; + } + mysql_query( + 'UPDATE `items_users` SET `inTransfer` = "' . ((int)$g) . '",`inGroup` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1' + ); + $u->tfer['r0'] = time(); + mysql_query( + 'UPDATE `transfers` SET `r0` = "' . $u->tfer['r0'] . '" WHERE `id` = "' . $u->tfer['id'] . '" LIMIT 1' + ); + $_POST['id'] = 'reflesh'; + } + } + + if ($_POST['id'] == 'reflesh') { + // + $i = 1; + while ($i <= 6) { + $itmAll = ''; + $itmAllSee = ''; + $itmAll = $u->genInv( + 5, + '`iu`.`uid` = "' . $u->info['id'] . '" AND `iu`.`data` NOT LIKE "%toclan=' . $u->info['clan'] . '#%" AND `iu`.`delete` = 0 AND `iu`.`inOdet` =0 AND `iu`.`inShop` = 0 AND `im`.`inRazdel` = "' . $i . '" AND `iu`.`inTransfer` = 0 ORDER BY `lastUPD` DESC' + ); + + if ($itmAll[0] == 0) { + $itmAllSee = ''; + } else { + $itmAllSee = $itmAll[2]; + } + $itmAllSee = str_replace("'", "", $itmAllSee); + $itmAllSee = str_replace('"', '"', $itmAllSee); + $itmAllSee = str_replace("\n", '', $itmAllSee); + $itmAllSee = str_replace("\r", '', $itmAllSee); + $js .= '$(\'#inv' . $i . '\').html(\'' . $itmAllSee . '\');'; + $i++; + } + unset($itmAll, $itmAllSee); + } + if ($_POST['id'] == 'minireflesh' || $_POST['id'] == 'reflesh') { + // + if (($u->tfer['start2'] > 0 && $u->info['id'] == $u->tfer['uid1']) || ($u->tfer['start1'] > 0 && $u->info['id'] == $u->tfer['uid2'])) { + $js .= 's2g();'; + } + // + $f = 1; + if ($u->info['id'] == $u->tfer['uid2']) { + $f = 2; + } + if ($u->tfer['r' . $f] != $u->tfer['r0']) { + function itmInfotf($pl, $cl) + { + global $u, $c, $code; + $x = $u->itemsX($pl['id'], $pl['uid']); + if ($x > 1) { + $x = ' (x' . $x . ')'; + } else { + $x = ''; + } + $r = ''; + if ($pl['uid'] == $u->info['id']) { + $r .= ''; + } + $r .= '' . $pl['name'] . '' . $x . '
    '; + if ($pl['inTransfer'] == 1) { + $r .= ''; + } else { + $r .= '(: 1.)'; + } + $r = '
    ' . $r . '
    '; + $r = '
    ' . $r . '
    '; + unset($x); + return $r; + } + + // :) + $itm = [1 => '', 2 => '']; + // 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 `iu`.`uid`="' . $u->tfer['uid1'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`inTransfer` > "0" AND `iu`.`data` NOT LIKE "%|zazuby=%" ORDER BY `iu`.`lastUPD` DESC' + ); + $cl = 2; + while ($pl = mysql_fetch_array($sp)) { + if ($cl == 2) { + $cl = 1; + } else { + $cl = 2; + } + $itm[1] .= itmInfotf($pl, $cl); + } + // 2 + $sp = 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->tfer['uid2'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`inTransfer` > "0" AND `iu`.`data` NOT LIKE "%|zazuby=%" ORDER BY `iu`.`lastUPD` DESC' + ); + $cl = 2; + while ($pl = mysql_fetch_array($sp)) { + if ($cl == 2) { + $cl = 1; + } else { + $cl = 2; + } + $itm[2] .= itmInfotf($pl, $cl); + } + unset($cl); + if ($itm[1] == '') { + $itm[1] = ' '; + } + if ($itm[2] == '') { + $itm[2] = ' '; + } + + if ($u->info['id'] == $u->tfer['uid1']) { + $js .= '$("#s2g3").html(\'' . $itm[1] . '\');$("#s2g2").html(\'' . $itm[2] . '\');'; + } else { + $js .= '$("#s2g3").html(\'' . $itm[2] . '\');$("#s2g2").html(\'' . $itm[1] . '\');'; + } + $u->tfer['r' . $f] = $u->tfer['r0']; + mysql_query( + 'UPDATE `transfers` SET `r' . $f . '` = "' . $u->tfer['r' . $f] . '" WHERE `id` = "' . $u->tfer['id'] . '" LIMIT 1' + ); + } + if (($u->tfer['good1'] > 0 && $u->info['id'] == $u->tfer['uid1']) || ($u->tfer['good2'] > 0 && $u->info['id'] == $u->tfer['uid2'])) { + $js .= '$(\'#btn1\').html(\'\');'; + if ($u->tfer['good1'] > 0 && $u->tfer['good2'] > 0) { + $js .= '$(\'#btn1\').attr(\'disabled\',\'\');'; + } else { + $js .= '$(\'#btn1\').attr(\'disabled\',\'disabled\');'; + } + } else { + $js .= '$(\'#btn1\').html(\' \');$(\'#btn1\').attr(\'disabled\',\'\');'; + } + + // :) + if ($u->tfer['uid1'] == $u->info['id']) { + if ($u->tfer['good1'] > 0) { + $js .= '$(\'#gd2\').css(\'display\',\'\');'; + } else { + $js .= '$(\'#gd2\').css(\'display\',\'none\');'; + } // + if ($u->tfer['good2'] > 0) { + $js .= '$(\'#gd1\').css(\'display\',\'\');'; + } else { + $js .= '$(\'#gd1\').css(\'display\',\'none\');'; + } + + if (($u->tfer['good1'] == 0 && $u->tfer['good2'] == 0) || $mn == 1) { + if ($u->tfer['money1'] != round($_POST['money'], 2)) { + $u->tfer['money1'] = round($_POST['money'], 2); + if ($u->tfer['money1'] > $u->info['money']) { + $u->tfer['money1'] = $u->info['money']; + } + if ($u->tfer['money1'] < 0) { + $u->tfer['money1'] = 0; + } + mysql_query( + 'UPDATE `transfers` SET `money1` = "' . mysql_real_escape_string( + $u->tfer['money1'] + ) . '",`good1` = 0,`good2` = 0 WHERE `id` = "' . $u->tfer['id'] . '" LIMIT 1' + ); + } + } + } else { + if ($u->tfer['good2'] > 0) { + $js .= '$(\'#gd2\').css(\'display\',\'\');'; + } else { + $js .= '$(\'#gd2\').css(\'display\',\'none\');'; + } // + if ($u->tfer['good1'] > 0) { + $js .= '$(\'#gd1\').css(\'display\',\'\');'; + } else { + $js .= '$(\'#gd1\').css(\'display\',\'none\');'; + } + + if (($u->tfer['good1'] == 0 && $u->tfer['good2'] == 0) || $mn == 1) { + if ($u->tfer['money2'] != round($_POST['money'], 2)) { + $u->tfer['money2'] = round($_POST['money'], 2); + if ($u->tfer['money2'] > $u->info['money']) { + $u->tfer['money2'] = $u->info['money']; + } + if ($u->tfer['money1'] < 0) { + $u->tfer['money1'] = 0; + } + mysql_query( + 'UPDATE `transfers` SET `money2` = "' . mysql_real_escape_string( + $u->tfer['money2'] + ) . '",`good1` = 0,`good2` = 0 WHERE `id` = "' . $u->tfer['id'] . '" LIMIT 1' + ); + } + } + } + if ($u->info['id'] == $u->tfer['uid1']) { + $js .= 'refmoney(' . $u->round2($u->tfer['money2']) . ',' . $u->round2($u->tfer['money1']) . ');'; + } else { + $js .= 'refmoney(' . $u->round2($u->tfer['money1']) . ',' . $u->round2($u->tfer['money2']) . ');'; + } + } + if ($js != '') { + echo ''; + } + } else { + echo ''; + } + } else { + echo ''; + } } -?> \ No newline at end of file