Файл: DARK WARS/dark_war/place/magic_dmg.php
Строк: 5
<?php
$mag = (int)$_GET['magic'];
$mym = mysql_fetch_assoc(mysql_query("SELECT * FROM `dark_war_masteries_u` WHERE `id` = '$mag' LIMIT 1"));
if (!$mym['id']) {
$doc->err("Нету такого умения");
exit;
} elseif ($mym['minus_mp'] > $player->mp) {
$doc->err("Недостаточно маны для применения умения");
exit;
} else {
if (!$dmg = ($ar['dmg'] - $mym['dmg'])) $dmg = 1;
if (!$armor = ($ar['armor'] - $mym['armor'])) $armor = 1;
if (!$armorp = ($ar['armorp'] - $mym['armorp'])) $armorp = 1;
if (!$magicr = ($ar['magicr'] - $mym['magicr'])) $magicr = 1;
if (!$magicp = ($ar['magicp'] - $mym['magicp'])) $magicp = 1;
mysql_query("UPDATE `dark_war_attack_creep` SET `hp` = (`hp`-'$mym[hp]'), `mp` = (`mp`-'$mym[mana]'), `dmg` = '$dmg',
`armor` = '$armor', `armorp` = '$armorp', `magicr` = '$magicr',
`magicp` = '$magicp' WHERE `id_player` = '{$player->id}'");
mysql_query("UPDATE `dark_war_users` SET `mp` = (`mp`-'$mym[minus_mp]') WHERE `id` = '{$player->id}'");
$_SESSION['fight_1'] = $mym['hp'] . " магией";
}
?>