Файл: DARK WARS/dark_war/clans/raid/attack.php
Строк: 61
<?php
include_once '../../start.php';
$doc = new document();
if(!$_SESSION['clan']){
header("Location: /dark_war/clans/");
}
if(!$_SESSION['clan_monster_id']){
header("Location: /dark_war/clans/raid/view.php");
}
$ar = mysql_fetch_assoc(mysql_query("SELECT * FROM `dark_war_clan_creep` WHERE `id_clan` = '".$_SESSION['clan']."' LIMIT 1"));
$creep = mysql_fetch_assoc(mysql_query("SELECT `name`, `img`, `max_gold`, `max_silver`, `max_expe`
FROM `dark_war_clan_monsters`
WHERE `id` = '$ar[id_creep]' LIMIT 1"));
$doc->title('Атака ' . $creep['name']);
if (!mysql_result(mysql_query("SELECT COUNT(*) FROM `dark_war_clan_creep` WHERE `id_clan` = '".$_SESSION['clan']."'"), 0)) {
$_SESSION['clan_monster_id'] = false;
header ("Location: /dark_war/clans/");
exit();
}
include_once 'finish.php'; // Отправит сообщение о победе или поражении и закончит сражение
if (isset($_GET['attack'])) {
include_once 'dmg.php'; // при атаке обычным дамагом
header ("Location: /dark_war/clans/raid/attack.php");
exit();
}if (isset($_GET['magic'])) {
include_once 'magic_dmg.php'; // при атаке скилами
include_once 'dmg.php'; // при атаке обычным дамагом
header ("Location: /dark_war/clans/raid/attack.php");
exit;
}
echo "<center><img src='$creep[img]' alt='!' /></center>";
if(isset($_SESSION['fight_1'])){
echo $player->name . " нанес удар " . $creep['name']. " ". $_SESSION['fight_1'] . "<br />";
$_SESSION['fight_1']= NULL;}
if(isset($_SESSION['fight_2'])){
echo $creep['name'] . " нанес удар " . $player->name. " ". $_SESSION['fight_2'] . "<br />";
$_SESSION['fight_2']= NULL;}
if(isset($_SESSION['fight_3'])){
echo "Ваш питомец нанес удар " . $creep['name']. " ". $_SESSION['fight_3'] . "<br />";
$_SESSION['fight_3']= NULL;}
$dispatch[] = array ('name' => $player->name, 'hp' => $player->hp, 'mp' => $player->mp, 'dmg' => $player->dmg,
'armor' => $player->armor, 'armorp' => $player->armorp,
'magicr' => $player->magicr, 'magicp' => $player->magicp);
$dispatch[] = array ('name' => $creep['name'], 'hp' => $ar['hp'], 'mp' => $ar['mp'], 'dmg' => $ar['dmg'],
'armor' => $ar['armor'],'armorp' => $ar['armorp'], 'magicr' => $ar['magicr'],
'magicp' => $ar['magicp']);
$doc->assign('post', $dispatch);
$doc->display('view_attack.tpl');
$dispatch = array();
$q=mysql_query("SELECT * FROM `dark_war_masteries_u` WHERE `active` = '1' AND `id_player` = '{$player->id}'");
while ($post = mysql_fetch_array($q)) {
$list = $post['name'];
$img = '/dark_war/all_img/masteries/'.$post['img'].'.png" ';
$link = "?magic=" . $post['id'] . "".(isset($_GET['page'])?'&page='.$_GET['page'].'' : '')."";
$descrip = "<img src='/dark_war/all_img/14/hp.png' alt='' />-$post[hp] ";
$descrip .= "<img src='/dark_war/all_img/14/sword.png' alt='' />-$post[dmg] ";
$descrip .= "<img src='/dark_war/all_img/14/shield1.png' alt='' />-$post[armor] ";
$descrip .= "<img src='/dark_war/all_img/14/shield.png' alt='' />-$post[magicr] ";
$dispatch[] = array ('title' => $list, 'img' => $img, 'link' => $link, 'descrip' => $descrip);
}$doc->assign('post', $dispatch);
$doc->display('view_list_plus_img.tpl');
$doc->act("attack.php?attack", "Атака");
?>