Файл: DARK WARS/dark_war/clans/raid/finish.php
Строк: 40
<?php
if(!$_SESSION['dmg_u']){
$_SESSION['dmg_u'] = true;
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `dark_war_clan_creep_u` WHERE `id_user` = '{$player->id}'"), 0)){mysql_query("INSERT INTO `dark_war_clan_creep_u`(`id_user`, `dmg`)VALUES('{$player->id}', '0')");}
}
if($player->hp <= 0) {
$msg = "Вы потерпели поражение от $creep[name]. Восстановите здоровье и сражайтесь далье за свой клан.";
if ($player->set_journal_place) {
$jo = new journal($player->id, $msg, 'После нападения');
}
mysql_query("UPDATE `dark_war_users` SET `hp` = '2', `energy` = (`energy`-'5') WHERE `id` = '{$player->id}'");
header ("Location: /dark_war/clans/");
exit();
}if ($ar['hp'] <= 0) {
$rand = mt_rand(50,100);
$gold = ceil($creep['max_gold'] * $rand / 100);
$silver = ceil($creep['max_silver'] * $rand / 100);
$expe = ceil($creep['max_expe'] * $rand / 100);
$_SESSION['dmg_u'] = false;
$q = mysql_query("SELECT id_user, dmg FROM `dark_war_clan_creep_u`");
$w = mysql_query("SELECT max_gold,max_silver,max_expe FROM `dark_war_clan_monsters`");
while ($post = mysql_fetch_assoc($q)) {
$msg = "Вы одержали победу над $creep[name] nr Ваш клан получил: nr Золото: $gold nr Серебро: $silver ";
$jo = new journal($post['id_user'], $msg, 'После наподения');
mysql_query("UPDATE `dark_war_users` SET `present_level` = (`present_level`+'$expe'),
`energy` = (`energy`-'4'),
`max_creep_attack` = `max_creep_attack` + '1', `time_next_attack` = '".TIME."'
WHERE `id` = '".$post['id_user']."'");
mysql_query("DELETE FROM `dark_war_clan_creep_u` WHERE `id_user` = '".$post['id_user']."'");
}
mysql_query("UPDATE `dark_war_clan_bank` SET `gold` = `gold`+'$gold', `silver` = `silver`+'$silver' WHERE `id_clan` = '".$_SESSION['clan']."'");
mysql_query("DELETE FROM `dark_war_clan_creep` WHERE `id_clan` = '".$_SESSION['clan']."'");
header ("Location: /dark_war/clans/");
exit();
}
?>