Вход Регистрация
Файл: element_mission_location.php
Строк: 228
<?php
require_once './element_options/element_options.php';
if (!
$user) { header('Location: /'); exit; }
require_once 
'./element_function/element_function_mission.php';

    if (!
$id) { header('Location: /mission'); exit; }
    
$location mysql_fetch_array(mysql_query("SELECT * FROM `element_mission_list` WHERE `lost_id` = '$id' LIMIT 1"));
    if (!
$location) { header('Location: /mission'); exit; }
    if (
readcache('element_user_mesto'.$user['lost_id']) != 'Миссии'writecache('element_user_mesto'.$user['lost_id'], 'Миссии');
    
    
$mission = (isset($_GET['mission']) AND is_numeric($_GET['mission'])) ? (int)$_GET['mission'] : false;
    
$z = (isset($_GET['z']) AND is_numeric($_GET['z'])) ? (int)$_GET['z'] : false;

$title $location['lost_id'].'. '.$location['lost_location'];
require_once 
'./element_include/element_head.php';
require_once 
'./element_include/element_header_user_true.php';
require_once 
'./element_function/element_function_battle.php'
    if (
$go == 'start' AND $mission AND $z) {
        if (
$user_energy[0] > 0) {
        
$missions mysql_fetch_array(mysql_query("SELECT * FROM `element_mission` WHERE `lost_id` = '$mission' AND `lost_location` = '$id' LIMIT 1"));
            if (
$missions) {    
            
$explode_mission explode(':',$missions['lost_params']);
            
$avto_battle = (empty($lost_other[7]) OR $lost_other[7] == 0) ? 1;
            
$gold = ($missions['lost_boss'] > AND $user_mission['lost_location'.$id] < $location['lost_count']) ? $missions['lost_boss'] : 0;
            
$exp_micro explode(' 'microtime());
                
$exp_micro[1] = $exp_micro[1] - 2;
            
$microtime implode(' '$exp_micro);
            
$cristalls handler_cristalls($missions['lost_cristalls'], $user_blessing['nagrada']);
                
                
$params = array('bot_params' => array('other_hp' => GenerationMaxHeatpoints($explode_mission[1]), // Бот
                                                     
'name' => $missions['lost_name_bot'],
                                                     
'hp' => GenerationMaxHeatpoints($explode_mission[1]),
                                                     
'strlen' => $explode_mission[0],
                                                     
'life' => 0,
                                                     
'time' => $microtime),
                               
'user_params' => array('strlen' => $user['lost_params_strlen'], // Персонаж
                                                     
'other_hp' => GenerationMaxHeatpoints($user['lost_params_heatpoints']),
                                                     
'hp' => GenerationMaxHeatpoints($user['lost_params_heatpoints']),
                                                     
'protection' => $user['lost_params_protection'],
                                                     
'life' => 0,
                                                     
'avto_battle' => $avto_battle,
                                                     
'time' => false),
                                
'missions' => array('cristalls' => $cristalls,
                                                    
'expoint' => $missions['lost_expoint'],
                                                    
'gold' => $gold,
                                                    
'end_count' => $z,
                                                    
'my_count' => $user_mission['lost_location'.$id],
                                                    
'other_count' => $location['lost_count'],
                                                    
'location' => $id,
                                                    
'equip' => $location['lost_equip'],
                                                    
'mission' => $mission));
                
ResetAbilitiesUser($user['lost_id']);    
            
            if (
$user_energy[0] >= $user_energy[1]) $user_energy[5] = time(); else $user_energy[5] = $user_energy[5];
            
$user_energy[0] = $user_energy[0] - 1;
            
$user['lost_params_energy'] =  $user_energy[0].':'.$user_energy[1].':'.$user_energy[5];

            
            
writecache('element_mission_journal'.$user['lost_id'], array('<span class="lngreen bold">Вы начали бой!</span>'));
            
writecache('element_users_battle'.$user['lost_id'], '/mission/battle');
            
writecache('element_users_id_'.$user['lost_id'],$user);             // кэш юзера
            
writecache('element_mission_user_'.$user['lost_id'],$params);    // кэш параметров боя
            
header('Location: /mission/battle');
            exit;
            }
        } else {
            echo 
'<div class="nf2 p5 mb5 small cntr mt5 mlra"><span class="red">У Вас недостаточно энергии</span><br/><a class="mt5" href="/mission/location?id='.$id.'&go=energy">Пополнить энергию за <img src="/images/icons/gold.png">'.($user_energy[1] * 2).'</a></div>';
        }
    }

    if (
$go == 'avto_battle') {
        if (empty(
$lost_other[7]) OR $lost_other[7] == 0$lost_other[7] = 1; else $lost_other[7] = 0;
        
$user['lost_other'] = implode(' '$lost_other);
        
writecache('element_users_id_'.$user['lost_id'],$user);    
        
header('Location: /mission/location?id='.$id);
        exit;
    }

echo 
'<div class="nfl p5 mb5 mt5 mlra">';
echo 
'<div class="cntr small"><a class="yellow1" href="/mission">« К выбору локации</a></div>';
echo 
'<div class="cntr small mt5 mb5"><a class="lngreen" href="/mission/location?id='.$id.'&go=avto_battle">'.((empty($lost_other[7]) OR $lost_other[7] == 0) ? 'Автобой: «включить«' 'Автобой: «отключить«').'</a></div>';
    
    
$query mysql_query("SELECT * FROM `element_mission` WHERE `lost_location` = '$id'");
    
$count 0$i 0$cccc 0;
    while (
$myrrow mysql_fetch_array($query)) {
        
$cccc $cccc $myrrow['lost_count'];
        if (
$user_mission['lost_location'.$id] >= $cccc) {
            
$bla $myrrow['lost_count'];
        } else {
            if (
$user_mission['lost_location'.$id] > ($cccc $myrrow['lost_count'])) {
                
$bla $user_mission['lost_location'.$id] - ($cccc $myrrow['lost_count']);
            } else 
$bla 0;
        }
        if (
$bla 0$bla 0;
        
$expooint handler_expoint($myrrow['lost_expoint'], $user['lost_add_user_exp'], $user['lost_add_town_exp']);
        
$cristalls handler_cristalls($myrrow['lost_cristalls'], $user_blessing['nagrada']);
        
        echo 
'<div class="mb2 small">
                <table>
                <td>
                <img src="'
.$myrrow['lost_img'].'">
                </td>
                <td class="small" valign="top">
                <span class="ml5 small yellow1">'
.$myrrow['lost_name'].'</span><br/>
                <span class="ml5 small yellow1">Награда: '
.(($myrrow['lost_boss'] > AND $user_mission['lost_location'.$id] < $cccc) ? '<img src="/images/icons/gold.png">'.$myrrow['lost_boss'].', ' '').' <img width="14" height="14" src="/images/icons/experience.png">'.$expooint['user'].', <img src="/images/icons/cristall.png">'.$cristalls.'</span><br/>
<span class="ml5 small white">Пройдено: <span class="ccc">'
.$bla.' из '.$myrrow['lost_count'].' ('.(($bla 0) ? (int)(($bla $myrrow['lost_count']) * 100).'%''0%').')</span></span>
                '
.(($i == OR $user_mission['lost_location'.$id] >= $count) ? '<br/><a class="ml5 lngreen" href="/mission/location?id='.$id.'&mission='.$myrrow['lost_id'].'&go=start&z='.$cccc.'">'.(($user_mission['lost_location'.$id] >= ($count $myrrow['lost_count'])) ? 'Повторить' 'Начать бой').'</a>' '<br/><span class="ml5 ccc">Закрыто</span>').'
                </td>
                </table>
              </div>'
;
    unset(
$bla);
    
$count $count $myrrow['lost_count'];    
    
$i++;
    }
    
echo 
'<div class="cntr small yellow1"><a href="/mission">К выбору локации</a></div>';    
echo 
'</div>';
require_once 
'./element_include/element_foot_user_true.php';
?>
Онлайн: 1
Реклама