Файл: DARK WARS/dark_war/hunting/set_trap.php
Строк: 21
<?php
include_once '../start.php';
$doc = new document();
$doc->title('Установка капкана');
$q = mysql_query("SELECT * FROM `dark_war_hshop_u` WHERE type='4' AND `id_player` = '{$player->id}' AND `active` = '1' LIMIT 1");
if (!mysql_num_rows($q)) {
$doc->err('Вы не взяли с собой капкан');
exit();
}
$ar = mysql_fetch_assoc($q);
$rand_t = mt_rand(300, 1800);
$rand = mt_rand($ar['chance'], 100);
$breakdown = mt_rand(1, 6);
$bdown = ($breakdown + $ar['breakdown']);
if ($bdown > 20) {
$broke = mt_rand(0, 7);
if ($broke == 3) {
mysql_query("DELETE FROM `dark_war_hshop_u` WHERE `id` = '$ar[id]' AND `id_player` = '{$player->id}' LIMIT 1");
}
}
mysql_query("INSERT INTO `dark_war_htrap` (`id_player`, `type_beast`, `took`, `time`) VALUES('{$player->id}', '1', '1', '".(TIME + $rand_t)."')");
mysql_query("UPDATE `dark_war_hshop_u` SET `breakdown` = '$bdown' WHERE `id` = '$ar[id]'");
?>