Файл: mod/instalscript/metro/battle.php
Строк: 210
<?
#########МОД ПОДЗЕМЕЛЬЕ ДЛЯ ДВИЖКА WAPHERO.RU###
#########Автор:InstalScript[is](Колян Карамышев)#####
#########Понравился мод я здесь bymas.ru/id3741######
#########ПРОДОВАТЬ И СЛИВАТЬ МОД ЗАПРЕЩЕНО###
$_GET[id]=intval($_GET['id']);
$instalscript=htmlspecialchars(trim($_GET['instalscript']));
$header = 'Подземелье бой';
include_once '../../../core/system.php';
include_once '../../../core/head.php';
$moya_banda = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `user`='".$user['nick']."' "));
$moe_metro = mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$moya_banda['metro_id']."' "));
$moi_battle = mysql_fetch_array(mysql_query("SELECT * FROM `metro_battle` WHERE `general_id`='".$moya_banda['general_id']."' "));
$moi_log = mysql_fetch_array(mysql_query("SELECT * FROM `metro_log` WHERE `general_id`='".$moya_banda['general_id']."' "));
$lvbvm = mysql_result(mysql_query("SELECT COUNT(*) FROM `metro_bands` WHERE `general_id`='".$moya_banda['general_id']."' AND `zhiv`='yes' AND `vboi`='yes' "),0);
$info_user_1 = mysql_query("SELECT * FROM `metro_bands` WHERE `general_id`='".$moya_banda['general_id']."' AND `vbande`='yes' AND `vboi`='yes' ");
$time = time();
if($moi_battle['time']<=time()-600){mysql_query("UPDATE `user` SET `health`= '".(0)."' WHERE `nick`='".$user['nick']."' ");
mysql_query("UPDATE `metro_bands` SET `zhiv`= 'no' WHERE `user`='".$user['nick']."' ");
}
mysql_query("UPDATE `metro_battle` SET `time`='".(time())."' WHERE `general_id`='".$moya_banda['general_id']."' ");
if($user['health']<=0){mysql_query("UPDATE `metro_bands` SET `zhiv`='no' WHERE `user`='".$user['nick']."' ");}
if($moya_banda['zhiv']=='no'){mysql_query("UPDATE `user` SET `health`='0' WHERE `nick`='".$moya_banda['user']."' ");}
if($lvbvm==0){
$mobs=mysql_fetch_array(mysql_query("SELECT * FROM `metro_mob` WHERE `metro_id`='".$moya_banda['metro_id']."' ORDER BY `poryadok` DESC"));
mysql_query("UPDATE `metro_battle` SET `metro_id` = '".$mobs['id']."',`general_id` = '".$moya_banda['general_id']."',`tip` = '".$mobs['tip']."',`poryadok` = '".$mobs['poryadok']."',`lovk` = '".$mobs['lovk']."',`zashit` = '".$mobs['zashit']."',`health` = '".$mobs['health']."',`max_health` = '".$mobs['max_health']."',`sila` = '".$mobs['sila']."',`kol` = '".$mobs['kol']."',`img` = '".$mobs['img']."',`name` = '".$mobs['name']."',`time`='".time()."' ") or die (mysql_error());
header('Location:instalscript-bymas?instalscript=dead&all=dead');exit;}
if($moi_battle['kol']==0 && $moi_battle['poryadok']==0){
mysql_query("INSERT INTO `metro_user_time` SET `metro_id` = '".$moya_banda['metro_id']."',`user` = '".$user['nick']."',`time` = '".($time+$moe_metro['time'])."' ");
mysql_query("UPDATE `metro_bands` SET `proideno`='yes' WHERE `general_id`='".$moya_banda['general_id']."' ");
header('Location:instalscript-bymas?instalscript=banda');exit;}
if($moya_banda['proideno']=='yes'){header('Location:instalscript-bymas?instalscript=banda');exit;}
$tsu = mysql_fetch_array(mysql_query("SELECT * FROM `metro_user_time` WHERE `user` = '".$user['nick']."' AND `metro_id`='".$moya_banda['metro_id']."' AND `time`>'".time()."' "));
if($tsu!=0){header('Location:instalscript-bymas?instalscript=banda&time=no');exit;}
switch($instalscript){
default:
if($moya_banda['tip']=='lider' && $moya_banda['zhiv']=='no' && $lvbvm==0 ){header('Location:instalscript-bymas?instalscript=banda&defeat=yes');exit;}
$log = mysql_fetch_array(mysql_query("SELECT * FROM `metro_log` "));
$time_1=time()-1800;
if(time()-1800>$log['time']){mysql_query("DELETE FROM `metro_log` WHERE `time` < '". $time_1 ."' ");}
if($moya_banda==0){header('Location: instalscript');exit;}
echo"<div class='title'>";
if($_GET['battle']==1){echo"<font color='#F00000'>Вы находитесь в бою</font></br>";}
$start = mysql_fetch_array(mysql_query("SELECT * FROM `metro_log` WHERE `general_id`='".$moya_banda['general_id']."' "));
if($start['kto_udaril']=='start'){echo"<font color='#448BF7'>$start[text]</font>";}
echo"<table><td><img src='$moi_battle[img]'>";if($moi_battle['kol']>1){echo"($moi_battle[kol])";}echo"</td>
<td><img src='/images/icon/str.png' alt='str'/>$moi_battle[sila]</td>
<td><img src='/images/icon/vit.png' alt='vit'/>$moi_battle[health]</td>
<td><img src='/images/icon/agi.png' alt='agi'/>$moi_battle[lovk]</td>
<td><img src='/images/icon/def.png' alt='def'/>$moi_battle[zashit]</td></table>";
echo"$moi_battle[name]";
if($moya_banda['zhiv']=='yes'){
echo"<div class='player menuList'><li><a href='instalscript-bymas-battle?instalscript=ataka'><font color='#C40000'>Атаковать</font></a></li>";
echo"<li><a href='instalscript-bymas-battle?instalscript=vl'><font color='#3D29E4'>Восстановить жизни -50<img src='img/ico/mana.png'></font></a></li></div>";
}
else{echo"</br>Вы умерли</br><div class=player menuList'><a href='instalscript-bymas-battle?'><font color='#8D8D8D'>Обновить</font></a></div>";}
while($info_user = mysql_fetch_array($info_user_1)){
$use = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `nick`='".$info_user['user']."' "));
$health_1 = ($use['health']/$use['max_health'])*100;
$life_use = round($health_1);
echo"$use[nick] <img src='img/ico/health.png'>$life_use% ";}
echo"</br>";
$logbb=mysql_query("SELECT * FROM `metro_log` WHERE `general_id`='".$moya_banda['general_id']."' ORDER by `time` DESC LIMIT 0,10 ");
while($logb=mysql_fetch_array($logbb)){
if($logb['kto_udaril']=='vl'){echo"<font color='#7264EC'>$logb[log_time] $logb[text]</font></br>";}
if($logb['kto_udaril']=='user'){echo"<font color='#4ADF56'>$logb[log_time] $logb[text]</font></br>";}
if($logb['kto_udaril']=='mob'){echo"<font color='#FA3732'>$logb[log_time] $logb[text]</font></br>";}
}
echo"</div>";
break;
case'ataka':
if($tsu!=0){header('Location:instalscript-bymas?instalscript=banda');exit;}
if($moya_banda['zhiv']=='yes'){
if($moya_banda==0){header('Location: instalscript');exit;}
$uudar=$user['sila']/100*50;
$mudar=$moi_battle['sila']/100*45;
$udaru=round((rand($uudar,$user['sila']))-(($moi_battle['zashit']+$moi_battle['lovk'])/15));
$udarm=round((rand($mudar,$moi_battle['sila']))-(($user['zashit']+$user['lovk'])/15));
$uron=$moya_banda['uron']+$udaru;
$userexp=$user['exp']+$udaru;
$log_time = date("H:i");
$time=time();
if($udarm>0){
$kum=rand(1,10);
if($kum==1){$kum_1='в голову';}if($kum==2){$kum_1='по телу';}if($kum==3){$kum_1='по ногам';}if($kum==4){$kum_1='в живот';}if($kum==5){$kum_1='в руку';}if($kum==6){$kum_1='в ногу';}
if($kum==7){$kum_1='в лицо';}if($kum==8){$kum_1='в глаз';}if($kum==9){$kum_1='в нос';}if($kum==10){$kum_1='в лоб';}
$loggg="Противник $moi_battle[name] ударил игрока $user[nick] $kum_1 -$udarm";
$uron_useru=$user['health']-$udarm;
mysql_query("UPDATE `user` SET `exp`='".$userexp."',`health`='".$uron_useru."' WHERE `nick`='".$user['nick']."' ");
mysql_query("INSERT INTO `metro_log` SET `kto_udaril` = 'mob',`text` = '".$loggg."',`general_id` = '".$moya_banda['general_id']."',`log_time`='".$log_time."', `time` = '".$time."' ");}
if($udaru>0)
{
if($moi_battle['kol']>1 && $udaru>=$moi_battle['health']){
$kol=$moi_battle['kol']-1;
mysql_query("UPDATE `metro_battle` SET `health`= '".$moi_battle['max_health']."',`kol` = '".$kol."' WHERE `general_id`='".$moya_banda['general_id']."' ");
}
else{$uron_mobu=$moi_battle['health']-$udaru;
mysql_query("UPDATE `metro_battle` SET `health`= '".$uron_mobu."' WHERE `general_id`='".$moya_banda['general_id']."' ");
}
if($udaru>=$moi_battle['health'] && $moi_battle['kol']==1){
$poryadok=$moi_battle['poryadok']-1;
$mobs=mysql_fetch_array(mysql_query("SELECT * FROM `metro_mob` WHERE `metro_id`='".$moya_banda['metro_id']."' AND `poryadok`='".$poryadok."' "));
mysql_query("UPDATE `metro_battle` SET
`tip` = '".$mobs['tip']."',
`poryadok` = '".$mobs['poryadok']."',
`lovk` = '".$mobs['lovk']."',
`zashit` = '".$mobs['zashit']."',
`health` = '".$mobs['health']."',
`max_health` = '".$mobs['max_health']."',
`sila` = '".$mobs['sila']."',
`kol` = '".$mobs['kol']."',
`img` = '".$mobs['img']."',
`name` = '".$mobs['name']."',
`time`='".time()."'
WHERE `general_id`='".$moya_banda['general_id']."' ") or die (mysql_error());
}
$kuu=rand(1,10);
if($kuu==1){$kuu_1='в голову';}if($kuu==2){$kuu_1='по телу';}if($kuu==3){$kuu_1='по ногам';}if($kuu==4){$kuu_1='в живот';}if($kuu==5){$kuu_1='в руку';}if($kuu==6){$kuu_1='в ногу';}if($kuu==7){$kuu_1='в лицо';}if($kuu==8){$kuu_1='в глаз';}if($kuu==9){$kuu_1='в нос';}if($kuu==10){$kuu_1='в лоб';}
$logg="Боец $user[nick] ударил противника $moi_battle[name] $kuu_1 -$udaru";
mysql_query("INSERT INTO `metro_log` SET `kto_udaril` = 'user',`text` = '".$logg."',`general_id` = '".$moya_banda['general_id']."',`log_time`='".$log_time."', `time` = '".$time."' ");
mysql_query("UPDATE `metro_bands` SET `uron`='".$uron."' WHERE `user`='".$user['nick']."' ");
if($moi_battle['poryadok']==1 && $moi_battle['kol']==1 && $udaru>=$battle['health']){
mysql_query("INSERT INTO `metro_user_time` SET `metro_id` = '".$moya_banda['metro_id']."',`user` = '".$user['nick']."',`time` = '".($time+$moe_metro['time'])."' ");
mysql_query("UPDATE `metro_bands` SET `proideno`='yes' WHERE `general_id`='".$moya_banda['general_id']."' ");
header('Location:instalscript-bymas?instalscript=banda');exit;
}
}
}
header ("Location:?");exit;
break;
case'vl':
if($moya_banda['zhiv']=='yes'){
$mana=$user['mana']-50;
mysql_query("UPDATE `user` SET `health`='".$user['max_health']."',`mana`='".$mana."' WHERE `nick`='".$user['nick']."' ");
$log_time = date("H:i");
$time=time();
$logg="Боец $user[nick] восстановил здоровье";
mysql_query("INSERT INTO `metro_log` SET `kto_udaril` = 'vl',`text` = '".$logg."',`general_id` = '".$moya_banda['general_id']."',`log_time`='".$log_time."', `time` = '".$time."' ");
}
header ("Location:?");exit;
break;
}
include'../../../core/foot.php';
?>