game/modules_data/location/ruine_enter.php

211 lines
7.9 KiB
PHP
Raw Normal View History

2022-06-06 21:30:34 +00:00
<?
if(!defined('GAME')) { die(); }
if($u->room['file']=='ruine_enter') {
$loc_c = array(
'users' => 2, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
'money' => '0.00', // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>. <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
'free' => 125
);
if(isset($_GET['join'])) {
$rz = mysql_fetch_array(mysql_query('SELECT * FROM `ruine_zv` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
if(isset($rz['id'])) {
$u->error = '<27><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
}else{
$rc = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `ruine_zv` LIMIT 1'));
if( $rc[0] >= $loc_c['users'] ) {
$u->error = '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>...';
}else{
if( $u->info['money'] < (int)$loc_c['money'] ) {
$u->error = '<27><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.$loc_c['money'].' <20><>.';
}else{
mysql_query('INSERT INTO `ruine_zv` (
`city`,`time`,`uid`,`money`
) VALUES (
"'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.((int)$loc_c['money']).'"
)');
mysql_query('UPDATE `users` SET `money` = "'.($u->info['money'] - (int)$loc_c['money']).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$u->error = '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.$loc_c['money'].' <20><>. <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
}
}
unset($rc);
}
}elseif(isset($_GET['cancel'])) {
$rz = mysql_fetch_array(mysql_query('SELECT * FROM `ruine_zv` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
if(!isset($rz['id'])) {
$u->error = '<27><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
}else{
$rc = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `ruine_zv` LIMIT 1'));
if( $rc[0] >= $loc_c['users'] ) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...';
}else{
mysql_query('DELETE FROM `ruine_zv` WHERE `id` = "'.$rz['id'].'" LIMIT 1');
mysql_query('UPDATE `users` SET `money` = "'.($u->info['money'] + $rz['money']).'" WHERE `id` = "'.$rz['uid'].'" LIMIT 1');
$u->error = '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.$loc_c['money'].' <20><>. <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
}
unset($rc);
}
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div style="padding-left:0px;" align="center">
<h3><? echo $u->room['name']; ?></h3>
</div>
</td>
<td width="200" valign="top"><div align="right">
<table cellspacing="0" cellpadding="0">
<tr>
<td width="100%">&nbsp;</td>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr align="right" valign="top">
<td><!-- -->
<? echo $goLis; ?>
<!-- -->
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DEDEDE">
<tr>
<td bgcolor="#D3D3D3"><img src="https://img.new-combats.com/i/move/links.gif" width="9" height="7" /></td>
<td bgcolor="#D3D3D3" nowrap="nowrap"><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.323&rnd=<? echo $code; ?>';"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></a></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</div></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top">
<?
if($u->error != '') {
echo '<div><b><font color=red>'.$u->error.'</font></b></div><br>';
}
?>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: 0<br><br>
<?
//
$i = 0;
$sp = mysql_query('SELECT * FROM `ruine_zv`');
while( $pl = mysql_fetch_array($sp) ) {
$usr = mysql_fetch_array(mysql_query('SELECT `online`,`money` FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1'));
if( $usr['online'] < time()-600 ) {
mysql_query('UPDATE `users` SET `money` = "'.($usr['money'] + $pl['money']).'" WHERE `id` = "'.$pl['uid'].'" LIMIT 1');
mysql_query('DELETE FROM `ruine_zv` WHERE `id` = "'.$pl['id'].'" LIMIT 1');
}else{
$i++;
}
}
//
if( $i >= $loc_c['users'] ) {
//
mysql_query('INSERT INTO `ruine_now` (
`time_start`,`time_finish`,`t1w`,`t2w`,`tw`
) VALUES (
"'.time().'","0","0","0","0"
)');
$text_user = '';
$rid = mysql_insert_id();
//
$team = rand(1,2);
//
if( $rid > 0 ) {
//
$sp = mysql_query('SELECT * FROM `ruine_zv`');
while( $pl = mysql_fetch_array($sp) ) {
//
if( $team == 1 ) {
$team = 2;
}else{
$team = 1;
}
//
$bus = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1'));
if(isset($bus['id'])) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
$text_user[$team] .= $u->microLogin($bus['id'],1).', ';
//
mysql_query('INSERT INTO `users` (`obraz`,`chatColor`,`align`,`inTurnir`,`molch1`,`molch2`,`activ`,`login`,`room`,`name`,`sex`,`level`,`bithday`) VALUES (
"'.$bus['obraz'].'","'.$bus['chatColor'].'","'.$bus['align'].'","'.$rid.'","'.$bus['molch1'].'","'.$bus['molch2'].'","0","'.$bus['login'].'","413","'.$bus['name'].'","'.$bus['sex'].'","10","'.date('d.m.Y').'")');
//
$inbot = mysql_insert_id(); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
if( $inbot > 0 ) {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
$rx = 0;
$ry = 0;
//
$botst = mysql_fetch_array(mysql_query('SELECT * FROM `ruine_sets` WHERE `uid` = "'.$bus['id'].'" AND `use` = 1 LIMIT 1'));
if(!isset($botst['id'])) {
$botst = array(
's1' => 0,'s2' => 0,'s3' => 0,'s4' => 0,'s5' => 0,'s6' => 0,
'free' => $loc_c['free']
);
}
//
mysql_query('INSERT INTO `stats` (`res_x`,`res_y`,`timeGo`,`timeGoL`,`upLevel`,`dnow`,`id`,`stats`,`exp`,`ability`,`skills`,`x`,`y`)
VALUES (
"'.$rx.'","'.$ry.'",
"'.(time()+180).'","'.(time()+180).'","81","0","'.$inbot.'",
"s1='.round($botst['s1']+3).'|s2='.round($botst['s2']+3).'|s3='.round($botst['s3']+3).'|s4='.round($botst['s4']+3).'|s5='.round($botst['s5']).'|s6='.round($botst['s6']).'|rinv=40|m9=5|m6=10","0",
"'.$botst['free'].'","11","'.$rx.'","'.$ry.'"
)');
//
mysql_query('UPDATE `users` SET `room` = "414", `inUser` = "'.$inbot.'" WHERE `id` = "'.$bus['id'].'" LIMIT 1');
//
mysql_query('INSERT INTO `ruine_users` (
`tid`,`team`,`uid`,`bot`,`die`,`last_die`,`money`
) VALUES (
"'.$rid.'","'.$team.'","'.$bus['id'].'","'.$inbot.'","0","0","'.$pl['money'].'"
)');
//
mysql_query('DELETE FROM `ruine_zv` WHERE `id` = "'.$pl['id'].'" LIMIT 1');
//
}
//
}
//
}
//
}
//
$text_user[1] = rtrim($text_user[1],', ');
$text_user[2] = rtrim($text_user[2],', ');
$text = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> '.$text_user[1].' <20> '.$text_user[2].' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
//
mysql_query('INSERT INTO `ruine_logs` (
`tid`,`time`,`text`
) VALUES (
"'.$rid.'","'.time().'","'.mysql_real_escape_string($text).'"
)');
//
}
//
$rz = mysql_fetch_array(mysql_query('SELECT * FROM `ruine_zv` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
echo '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.$i.'/'.$loc_c['users'].' <20><><EFBFBD>. ';
if( isset($rz['id']) ) {
echo '<input onClick="location.href=\'https://new-combats.com/main.php?cancel\';" type="button" value="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btnnew">';
}else{
echo '<input onClick="location.href=\'https://new-combats.com/main.php?join\';" type="button" value="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btnnew">';
}
?>
</td>
<td align="right" valign="top">
<input type="button" value="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btnnew" onclick="location.href='https://new-combats.com/main.php';">
<input type="button" value="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btnnew2" onclick="top.winframe('ruine_fm','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',590,480,'https://new-combats.com/ruin_characteristics.php');">
<input type="button" value="<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btnnew">
</td>
</tr>
</table>
<? } ?>