Забытый файл лечения после большой чистки.
This commit is contained in:
parent
21fa7d923a
commit
5936fd1d28
@ -1,60 +0,0 @@
|
|||||||
<?php
|
|
||||||
// magic идентификацыя
|
|
||||||
if ($_SESSION['uid'] == null) header("Location: index.php");
|
|
||||||
|
|
||||||
|
|
||||||
$us = mysql_fetch_array(mysql_query("SELECT *, (select `id` from `online` WHERE `date` >= ".(time()-60)." AND `id` = users.`id`) as `online` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
|
||||||
$int=101;
|
|
||||||
if(!$us) {
|
|
||||||
$bots = mysql_fetch_array(mysql_query ('SELECT * FROM `bots` WHERE `name` = \''.$_POST['target'].'\' LIMIT 1;'));
|
|
||||||
/*if($bots) {
|
|
||||||
$id=$bots['prototype'];
|
|
||||||
$us = mysql_fetch_array(mysql_query("SELECT *, (select `id` from `online` WHERE `date` >= ".(time()-60)." AND `id` = users.`id`) as `online` FROM `users` WHERE `id` = '{$id}' LIMIT 1;"));
|
|
||||||
$us['login'] = $bots['name'];
|
|
||||||
$us['hp'] = $bots['hp'];
|
|
||||||
$us['id'] = $bots['id'];
|
|
||||||
$us['battle'] = $bots['battle'];
|
|
||||||
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
//echo
|
|
||||||
echo "<font color=red><B>";
|
|
||||||
if ($bots) { echo "Нельзя лечить клонов!"; }
|
|
||||||
elseif ($us['battle'] != $user['battle']) { echo "Персонаж находится в поединке!"; }
|
|
||||||
elseif ($user['room'] != $us['room'] && !$us['battle']) { echo "Персонаж в другой комнате!"; }
|
|
||||||
elseif ($us['battle'] && !in_array($us['id'],$fbattle->team_mine)) { echo "Нельзя лечить противников!"; }
|
|
||||||
else {
|
|
||||||
|
|
||||||
if (rand(1,100) < $int) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($user['sex'] == 1) {$action="";}
|
|
||||||
else {$action="а";}
|
|
||||||
|
|
||||||
if(($us['hp']+30) > $us['maxhp']) {
|
|
||||||
$hp = $us['maxhp'];
|
|
||||||
} else {
|
|
||||||
$hp = $us['hp']+30;
|
|
||||||
}
|
|
||||||
if ($user['battle'] > 0) {
|
|
||||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' использовал заклятие восстановления энергии '.(($us['id']!=$user['id'])?"на ".nick::id($us['id'])->short():"").' и восстановил уровень жизни <B>+60</B> ['.($hp).'/'.$us['maxhp'].']<BR>\') WHERE `id` = '.$us['battle'].'');
|
|
||||||
$fbattle->AddToLog('<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' использовал'.$action.' заклятие восстановления энергии '.(($us['id']!=$user['id'])?"на ".Nick::id($us['id'])->short():"").' и восстановил'.$action.' уровень жизни <B>+30</B> ['.($hp).'/'.$us['maxhp'].']<BR>');
|
|
||||||
//$fbattle->AddToLog('');
|
|
||||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1;");
|
|
||||||
|
|
||||||
$fbattle->write_log ();
|
|
||||||
}
|
|
||||||
|
|
||||||
mysql_query("UPDATE `users` SET `hp` = ".$hp." WHERE `id` = ".$us['id'].";");
|
|
||||||
echo "Вы восстановили 30 НР персонажу ".$us['login']."!";
|
|
||||||
$bet=1;
|
|
||||||
} else {
|
|
||||||
echo "Свиток рассыпался в ваших руках...";
|
|
||||||
$bet=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
echo "</B></FONT>";
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user