Заменяем одним классом магии healing.php на полсотни строк почти 30 файлов.

This commit is contained in:
lopar 2020-08-30 22:32:08 +03:00
parent e24f97fae8
commit 1a6aca425d
28 changed files with 48 additions and 1236 deletions

View File

@ -1,57 +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;"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '10' ;"));
if ($user['intel'] >= 3) {
$int=$magic['chanse'] + ($user['intel'] - 3)*3;
if ($int>98){$int=99;}
}
else {$int=0;}
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 ($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;
}
echo "</B></FONT>";

View File

@ -1,64 +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;"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '69' ;"));
if ($user['intel'] >= 1) {
$int=$magic['chanse'] + ($user['intel'] - 1)*3;
if ($int>98){$int=99;}
}
else {$int=0;}
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']+120) > $us['maxhp']) {
$hp = $us['maxhp'];
} else {
$hp = $us['hp']+120;
}
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>+120</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 "Вы восстановили 120 НР персонажу ".$us['login']."!";
$bet=1;
} else {
echo "Свиток рассыпался в ваших руках...";
$bet=1;
}
}
echo "</B></FONT>";

View File

@ -1,54 +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;"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '9' ;"));
if ($user['intel'] >= 1) {
$int=$magic['chanse'] + ($user['intel'] - 1)*3;
if ($int>98){$int=99;}
}
else {$int=0;}
if(!$us) {
$bots = mysql_fetch_array(mysql_query ('SELECT * FROM `bots` WHERE `name` = \''.$_POST['target'].'\' LIMIT 1;'));
}
//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']+15) > $us['maxhp']) {
$hp = $us['maxhp'];
} else {
$hp = $us['hp']+15;
}
if ($user['battle'] > 0) {
//$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>+15</B> ['.($hp).'/'.$us['maxhp'].']<BR>');
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 "Вы восстановили 15 НР персонажу ".$us['login']."!";
$bet=1;
} else {
echo "Свиток рассыпался в ваших руках...";
$bet=1;
}
}
echo "</B></FONT>";

View File

@ -1,65 +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;"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '70' ;"));
if ($user['intel'] >= 1) {
$int=$magic['chanse'] + ($user['intel'] - 1)*3;
if ($int>98){$int=99;}
}
else {$int=0;}
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']+150) > $us['maxhp']) {
$hp = $us['maxhp'];
} else {
$hp = $us['hp']+150;
}
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>+150</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 "Вы восстановили 150 НР персонажу ".$us['login']."!";
$bet=1;
$outok=1;
} else {
echo "Свиток рассыпался в ваших руках...";
$bet=1;
}
}
echo "</B></FONT>";

View File

@ -1,63 +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;"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '10' ;"));
if ($user['intel'] >= 2) {
$int=$magic['chanse'] + ($user['intel'] - 2)*3;
if ($int>98){$int=99;}
}
else {$int=0;}
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>";

View File

@ -1,62 +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;"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '12' ;"));
if ($user['intel'] >= 6) {
$int=$magic['chanse'] + ($user['intel'] - 6)*3;
if ($int>98){$int=99;}
}
else {$int=0;}
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']+300) > $us['maxhp']) {
$hp = $us['maxhp'];
} else {
$hp = $us['hp']+300;
}
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>+300</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>+300</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 "Вы восстановили 300 НР персонажу ".$us['login']."!";
$bet=1;
} else {
echo "Свиток рассыпался в ваших руках...";
$bet=1;
}
}
echo "</B></FONT>";

View File

@ -1,60 +0,0 @@
<?php
// magic идентификацыя
if ($_SESSION['uid'] == null) header("Location: index.php");
echo "12";
$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;"));
else {$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>";

View File

@ -1,53 +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;"));
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 ($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;
}
echo "</B></FONT>";

View File

@ -1,62 +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;"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '11' ;"));
if ($user['intel'] >= 3) {
$int=$magic['chanse'] + ($user['intel'] - 3)*3;
if ($int>98){$int=99;}
}
else {$int=0;}
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']+45) > $us['maxhp']) {
$hp = $us['maxhp'];
} else {
$hp = $us['hp']+45;
}
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>+45</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 "Вы восстановили 45 НР персонажу ".$us['login']."!";
$bet=1;
} else {
echo "Свиток рассыпался в ваших руках...";
$bet=1;
}
}
echo "</B></FONT>";

View File

@ -1,62 +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;"));
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '12' ;"));
if ($user['intel'] >= 6) {
$int=$magic['chanse'] + ($user['intel'] - 6)*3;
if ($int>98){$int=99;}
}
else {$int=0;}
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']+60) > $us['maxhp']) {
$hp = $us['maxhp'];
} else {
$hp = $us['hp']+60;
}
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>+60</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 "Вы восстановили 60 НР персонажу ".$us['login']."!";
$bet=1;
} else {
echo "Свиток рассыпался в ваших руках...";
$bet=1;
}
}
echo "</B></FONT>";

View File

@ -1,28 +0,0 @@
<?php
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
$t1 = explode(";", $battle['t1']);
if(in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if($user['battle'] <= 0) {
echo 'Это боевая магия ...';
} if($user['battle'] > 0 && $user['hp'] == $user['maxhp']) {
echo 'Ваше здоровье, и так полное ...';
} elseif($user['battle'] > 0 && $user['hp'] <= 0) {
echo 'Вы мертвы ...';
} else {
$lod = Nick::id($user['id'])->short();
$hp = floor($user['maxhp']*0.2);
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' использовал заклятие Воcстановление энергии 20%.<BR>');
$user['hp'] += $hp;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo 'Успешно';
$bet = 1;
}

View File

@ -1,28 +0,0 @@
<?php
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
$t1 = explode(";", $battle['t1']);
if(in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if($user['battle'] <= 0) {
echo 'Это боевая магия ...';
} if($user['battle'] > 0 && $user['hp'] == $user['maxhp']) {
echo 'Ваше здоровье, и так полное ...';
} elseif($user['battle'] > 0 && $user['hp'] <= 0) {
echo 'Вы мертвы ...';
} else {
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
$hp = floor($user['maxhp']*0.35);
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' использовал заклятие Воcстановление энергии 35%.<BR>');
$user['hp'] += $hp;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo 'Успешно';
$bet = 1;
}

View File

@ -1,28 +0,0 @@
<?php
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
$t1 = explode(";", $battle['t1']);
if(in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if($user['battle'] <= 0) {
echo 'Это боевая магия ...';
} if($user['battle'] > 0 && $user['hp'] == $user['maxhp']) {
echo 'Ваше здоровье, и так полное ...';
} elseif($user['battle'] > 0 && $user['hp'] <= 0) {
echo 'Вы мертвы ...';
} else {
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
$hp = floor($user['maxhp']*0.5);
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' использовал заклятие Воcстановление энергии 50%.<BR>');
$user['hp'] += $hp;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo 'Успешно';
$bet = 1;
}

View File

@ -1,13 +0,0 @@
<?
if(!isset($_SESSION['uid'])) { header('Location: ../index.php'); die(); }
if($user['battle'] > 0) {
echo "<font color=red><b>Не в бою ...</b></font>";
} elseif($user['hp'] == $user['maxhp']) {
echo "<font color=red><b>Ваше здоровье и так полное ...</b></font>";
} else {
$user['hp'] = $user['maxhp'];
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo "<font color=red><b>Вы скушали Бутербродик ...</b></font>";
$bet = 1;
}

View File

@ -1,37 +0,0 @@
<?php
if(!isset($_SESSION['uid'])) { header('Location: ../index.php'); die(); }
if($user['level'] < 6) {
echo "<font style=\"color: Red;\"><b>Уровень маловат ...</b></font>";
} elseif($user['intel'] < 9) {
echo "<font style=\"color: Red;\"><b>Недостаточно Интеллекта ...</b></font>";
} elseif($user['mgray'] < 3) {
echo "<font style=\"color: Red;\"><b>Недостаточно Владения магией ...</b></font>";
} else {
if($user['sex'] == 1) { $action = ''; } else { $action = 'а'; }
if($user['battle'] != 0) {
if($user['hp'] <= 0) {
echo "<font style=\"color: Red;\"><b>Мёртвые не могут пользоваться магией ...</b></font>";
} else {
$user['hp'] += 120;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
if($user['invis'] == 1) { $hp = '??'; $maxhp = '??'; } else { $hp = $user['hp']; $maxhp = $user['maxhp']; }
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$fbattle->AddToLog('<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' использовал'.$action.' заклятие восстановления энергии и восстановил'.$action.' уровень жизни <b>+120</b> ['.($hp).'/'.$maxhp.']<BR>');
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = '".$user['battle']."' LIMIT 1");
$fbattle->write_log();
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
} else {
$user['hp'] += 120;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
}

View File

@ -1,37 +0,0 @@
<?php
if(!isset($_SESSION['uid'])) { header('Location: ../index.php'); die(); }
if($user['level'] < 8) {
echo "<font style=\"color: Red;\"><b>Уровень маловат ...</b></font>";
} elseif($user['intel'] < 11) {
echo "<font style=\"color: Red;\"><b>Недостаточно Интеллекта ...</b></font>";
} elseif($user['mgray'] < 4) {
echo "<font style=\"color: Red;\"><b>Недостаточно Владения магией ...</b></font>";
} else {
if($user['sex'] == 1) { $action = ''; } else { $action = 'а'; }
if($user['battle'] != 0) {
if($user['hp'] <= 0) {
echo "<font style=\"color: Red;\"><b>Мёртвые не могут пользоваться магией ...</b></font>";
} else {
$user['hp'] += 150;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
if($user['invis'] == 1) { $hp = '??'; $maxhp = '??'; } else { $hp = $user['hp']; $maxhp = $user['maxhp']; }
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$fbattle->AddToLog('<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' использовал'.$action.' заклятие восстановления энергии и восстановил'.$action.' уровень жизни <b>+150</b> ['.($hp).'/'.$maxhp.']<BR>');
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = '".$user['battle']."' LIMIT 1");
$fbattle->write_log();
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
} else {
$user['hp'] += 150;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
}

View File

@ -1,37 +0,0 @@
<?php
if(!isset($_SESSION['uid'])) { header('Location: ../index.php'); die(); }
if($user['level'] < 8) {
echo "<font style=\"color: Red;\"><b>Уровень маловат ...</b></font>";
} elseif($user['intel'] < 14) {
echo "<font style=\"color: Red;\"><b>Недостаточно Интеллекта ...</b></font>";
} elseif($user['mgray'] < 4) {
echo "<font style=\"color: Red;\"><b>Недостаточно Владения магией ...</b></font>";
} else {
if($user['sex'] == 1) { $action = ''; } else { $action = 'а'; }
if($user['battle'] != 0) {
if($user['hp'] <= 0) {
echo "<font style=\"color: Red;\"><b>Мёртвые не могут пользоваться магией ...</b></font>";
} else {
$user['hp'] += 180;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
if($user['invis'] == 1) { $hp = '??'; $maxhp = '??'; } else { $hp = $user['hp']; $maxhp = $user['maxhp']; }
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$fbattle->AddToLog('<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' использовал'.$action.' заклятие восстановления энергии и восстановил'.$action.' уровень жизни <b>+180</b> ['.($hp).'/'.$maxhp.']<BR>');
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = '".$user['battle']."' LIMIT 1");
$fbattle->write_log();
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
} else {
$user['hp'] += 180;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
}

View File

@ -1,37 +0,0 @@
<?php
if(!isset($_SESSION['uid'])) { header('Location: ../index.php'); die(); }
if($user['level'] < 8) {
echo "<font style=\"color: Red;\"><b>Уровень маловат ...</b></font>";
} elseif($user['intel'] < 14) {
echo "<font style=\"color: Red;\"><b>Недостаточно Интеллекта ...</b></font>";
} elseif($user['mgray'] < 4) {
echo "<font style=\"color: Red;\"><b>Недостаточно Владения магией ...</b></font>";
} else {
if($user['sex'] == 1) { $action = ''; } else { $action = 'а'; }
if($user['battle'] != 0) {
if($user['hp'] <= 0) {
echo "<font style=\"color: Red;\"><b>Мёртвые не могут пользоваться магией ...</b></font>";
} else {
$user['hp'] += 270;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
if($user['invis'] == 1) { $hp = '??'; $maxhp = '??'; } else { $hp = $user['hp']; $maxhp = $user['maxhp']; }
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$fbattle->AddToLog('<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' использовал'.$action.' заклятие восстановления энергии и восстановил'.$action.' уровень жизни <b>+270</b> ['.($hp).'/'.$maxhp.']<BR>');
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = '".$user['battle']."' LIMIT 1");
$fbattle->write_log();
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
} else {
$user['hp'] += 270;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
}

View File

@ -1,37 +0,0 @@
<?php
if(!isset($_SESSION['uid'])) { header('Location: ../index.php'); die(); }
if($user['level'] < 8) {
echo "<font style=\"color: Red;\"><b>Уровень маловат ...</b></font>";
} elseif($user['intel'] < 14) {
echo "<font style=\"color: Red;\"><b>Недостаточно Интеллекта ...</b></font>";
} elseif($user['mgray'] < 4) {
echo "<font style=\"color: Red;\"><b>Недостаточно Владения магией ...</b></font>";
} else {
if($user['sex'] == 1) { $action = ''; } else { $action = 'а'; }
if($user['battle'] != 0) {
if($user['hp'] <= 0) {
echo "<font style=\"color: Red;\"><b>Мёртвые не могут пользоваться магией ...</b></font>";
} else {
$user['hp'] += 360;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
if($user['invis'] == 1) { $hp = '??'; $maxhp = '??'; } else { $hp = $user['hp']; $maxhp = $user['maxhp']; }
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$fbattle->AddToLog('<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' использовал'.$action.' заклятие восстановления энергии и восстановил'.$action.' уровень жизни <b>+360</b> ['.($hp).'/'.$maxhp.']<BR>');
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = '".$user['battle']."' LIMIT 1");
$fbattle->write_log();
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
} else {
$user['hp'] += 360;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
}

View File

@ -1,37 +0,0 @@
<?php
if(!isset($_SESSION['uid'])) { header('Location: ../index.php'); die(); }
if($user['level'] < 6) {
echo "<font style=\"color: Red;\"><b>Уровень маловат ...</b></font>";
} elseif($user['intel'] < 6) {
echo "<font style=\"color: Red;\"><b>Недостаточно Интеллекта ...</b></font>";
} elseif($user['mgray'] < 3) {
echo "<font style=\"color: Red;\"><b>Недостаточно Владения магией ...</b></font>";
} else {
if($user['sex'] == 1) { $action = ''; } else { $action = 'а'; }
if($user['battle'] != 0) {
if($user['hp'] <= 0) {
echo "<font style=\"color: Red;\"><b>Мёртвые не могут пользоваться магией ...</b></font>";
} else {
$user['hp'] += 90;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
if($user['invis'] == 1) { $hp = '??'; $maxhp = '??'; } else { $hp = $user['hp']; $maxhp = $user['maxhp']; }
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$fbattle->AddToLog('<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' использовал'.$action.' заклятие восстановления энергии и восстановил'.$action.' уровень жизни <b>+90</b> ['.($hp).'/'.$maxhp.']<BR>');
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = '".$user['battle']."' LIMIT 1");
$fbattle->write_log();
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
} else {
$user['hp'] += 90;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
echo "<font style=\"color: Red;\"><b>Свиток использован ...</b></font>";
$bet = 1;
}
}

View File

@ -1,99 +1,54 @@
<?php
// Магия исцеления
// Все их соберём, вместе соберём...
/*
* Сейчас в игре (да, один этот файл заменит кучу тех, что ниже):
* cure15.php
* cure30.php
* cure30_8.php
* cure30_100.php
* cure45.php
* cure60.php
* cure120.php
* cure150.php
* cure300.php
* cure_20.php
* cure_35.php
* cure_50.php
* cure_d.php
* cure_rep_90.php
* cure_rep_120.php
* cure_rep_150.php
* cure_rep_180.php
* cure_rep_270.php
* cure_rep_360.php
* c30_100.php
* 8cure30.php
* klan/heal20.php user_abilities.php
* klan/heal35.php user_abilities.php
* klan/heal50.php user_abilities.php
* user/heal20.php user_abilities.php
* user/heal35.php user_abilities.php
* user/heal50.php user_abilities.php
* */
// Если не в игре - идём нахер.
if (empty($_SESSION['uid'])) {header("Location: index.php");}
// Если нет цели заклинания - идём нахер.
if (empty($_POST['target'])) {header("Location: index.php");}
class Healing
{
private $target;
private $magicPower;
private $status = null;
//Цель заклинания
$target = $_POST['target'];
//Шанс на успех
$chance = 0;
$chance = $_POST['chance'];
if ($chance > 95) {$chance = 95;}
//Интеллект заклинателя
$mage_intellect = 0;
$mage_intellect = $user['intel'];
//Данные игрока, на которого колдуем
$receiver = db::c()->query('SELECT `id`, `hp`, `maxhp`, `battle`, `room`, (select `id` from `online` WHERE `id` = `users`.`id` AND `date` >= ?i) as `online` FROM `users` WHERE `login` = "?s"', time() - 60, $target)->fetch_assoc();
//Сила заклинания (на сколько лечим)
//Если не указано, лечим на случайное значение от 0 до уровня интеллекта мага.
$magic_power = mt_rand(0, $mage_intellect);
if (!empty($_POST['magic_power'])) {$magic_power = $_POST['magic_power'];}
//Является ли сила лечения процентом?
$percentage = false;
if (!empty($_POST['percentage'])) {
$percentage = true;
if ($magic_power > 100) {$magic_power = 100;}
}
//Статус, отображаемый магу
$status = '';
if ($receiver['battle'] != $user['battle']) {
$status = "Персонаж находится в поединке!";
} elseif ($user['room'] != $receiver['room'] && !$receiver['battle']) {
$status = "Персонаж в другой комнате!";
} elseif ($receiver['battle'] && !in_array($receiver['id'], $fbattle->team_mine)) {
$status = "Нельзя лечить противников!";
} elseif ($user['hp'] < 1) {
$status = "Вы мертвы!";
} else {
public function __construct($target, $power, $isPercentage = null)
{
$this->magicPower = $power;
if ($target && $this->isUsable()) {
//TODO: Проверка на то, что магу хватает навыка владения школой магии.
//IDEA: Можно добавить проверку на интеллект, где при определённом интеллекте шанс на успех становится 95-100%.
if ($chance >= mt_rand(1, 100)) {
//Проверка на то, повышается здоровье на константу или на процент.
if ($percentage) {
$new_hp = $receiver['hp'] + $receiver['maxhp'] / 100 * $magic_power;
return $this->useSpell($isPercentage);
} else {
$new_hp = $receiver['hp'] + $magic_power;
return $this->status;
}
}
if ($new_hp >= $receiver['maxhp']) {$new_hp = $receiver['maxhp'];}
if ($user['battle'] > 0) {
db::c()->query('UPDATE `battle` SET `to1` = ?i, `to2` = ?i WHERE `id` = ?i', time(), time(), $user['battle']);
$fbattle->AddToLog('<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' колдует заклятие лечения и восстанавливает ' . (($receiver['id'] != $user['id']) ? Nick::id($receiver['id'])->short() : "себе") . ' здоровье <B>' . $magic_power . '</B> [' . ($new_hp) . '/' . $receiver['maxhp'] . ']<BR>');
$fbattle->write_log();
private function isUsable()
{
$caster = new User($_SESSION['uid']);
$this->target = new User($this->target);
if ($caster->battle != $this->target->battle || $caster->room != $this->target->room) {
$this->status = 'Вы не видите цель!';
} elseif ($caster->health < 1) {
$this->status = 'Вы мертвы!';
} elseif ($caster->mana < 1) {
$this->status = 'Недостаточно пыли!';
}
if ($this->status) {
return false;
}
return true;
}
db::c()->query('UPDATE `users` SET `hp` = ?i WHERE `id` = ?i', $new_hp, $receiver['id']);
$status = "Вы восстановили {$magic_power} НР персонажу {$target}!";
private function useSpell($isPercentage)
{
if ($isPercentage) {
$healHealthAmount = $this->target->health + $this->target->maxHealth / 100 * $this->magicPower;
} else {
$status = "Свиток рассыпался в ваших руках...";
$healHealthAmount = $this->target->health + $this->magicPower;
}
if ($healHealthAmount > $this->target->maxHealth) {
$healHealthAmount = $this->target->maxHealth;
}
db::c()->query('UPDATE users SET health = ?i WHERE id = ?i', $healHealthAmount, $this->target->id);
$targetName = $this->target->login;
return "Вы восстановили ${healHealthAmount} здоровья персонажу ${targetName}.";
}
}
echo "<span style='color:red;'>$status</span>";

View File

@ -1,33 +0,0 @@
<?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` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `heal20` FROM `abils_klan` WHERE `klan` = "'.$user['klan'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
$t1 = explode(";", $battle['t1']);
if(in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if($user['battle'] <= 0) {
echo 'Это боевая магия ...';
} elseif($vip['heal20'] <= 0) {
echo 'Магия исчерпала себя ...';
} elseif($user['battle'] > 0 && $user['hp'] == $user['maxhp']) {
echo 'Ваше здоровье, и так полное ...';
} elseif($user['battle'] > 0 && $user['hp'] <= 0) {
echo 'Вы мертвы ...';
} else {
$vip['heal20'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
$hp = floor($user['maxhp']*0.2);
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' использовал заклятие Воcстановление энергии 20%.<BR>');
$user['hp'] += $hp;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_klan` SET `heal20` = "'.$vip['heal20'].'" WHERE `klan` = "'.$vip['klan'].'" LIMIT 1');
echo 'Успешно';
}

View File

@ -1,33 +0,0 @@
<?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` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `heal35` FROM `abils_klan` WHERE `klan` = "'.$user['klan'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
$t1 = explode(";", $battle['t1']);
if(in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if($user['battle'] <= 0) {
echo 'Это боевая магия ...';
} elseif($vip['heal35'] <= 0) {
echo 'Магия исчерпала себя ...';
} elseif($user['battle'] > 0 && $user['hp'] == $user['maxhp']) {
echo 'Ваше здоровье, и так полное ...';
} elseif($user['battle'] > 0 && $user['hp'] <= 0) {
echo 'Вы мертвы ...';
} else {
$vip['heal35'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
$hp = floor($user['hp']+35);
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' использовал заклятие Воcстановление энергии 35%.<BR>');
$user['hp'] += $hp;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_klan` SET `heal35` = "'.$vip['heal35'].'" WHERE `klan` = "'.$vip['klan'].'" LIMIT 1');
echo 'Успешно';
}

View File

@ -1,33 +0,0 @@
<?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` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `heal50` FROM `abils_klan` WHERE `klan` = "'.$user['klan'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
$t1 = explode(";", $battle['t1']);
if(in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if($user['battle'] <= 0) {
echo 'Это боевая магия ...';
} elseif($vip['heal50'] <= 0) {
echo 'Магия исчерпала себя ...';
} elseif($user['battle'] > 0 && $user['hp'] == $user['maxhp']) {
echo 'Ваше здоровье, и так полное ...';
} elseif($user['battle'] > 0 && $user['hp'] <= 0) {
echo 'Вы мертвы ...';
} else {
$vip['heal50'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
$hp = floor($user['maxhp']*0.5);
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' использовал заклятие Воcстановление энергии 50%.<BR>');
$user['hp'] += $hp;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_klan` SET `heal50` = "'.$vip['heal50'].'" WHERE `klan` = "'.$vip['klan'].'" LIMIT 1');
echo 'Успешно';
}

View File

@ -1,33 +0,0 @@
<?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` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `heal20` FROM `abils_user` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
$t1 = explode(";", $battle['t1']);
if(in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if($user['battle'] <= 0) {
echo 'Это боевая магия ...';
} elseif($vip['heal20'] <= 0) {
echo 'Магия исчерпала себя ...';
} elseif($user['battle'] > 0 && $user['hp'] == $user['maxhp']) {
echo 'Ваше здоровье, и так полное ...';
} elseif($user['battle'] > 0 && $user['hp'] <= 0) {
echo 'Вы мертвы ...';
} else {
$vip['heal20'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
$hp = floor($user['maxhp']*0.2);
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' использовал заклятие Воcстановление энергии 20%.<BR>');
$user['hp'] += $hp;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_user` SET `heal20` = "'.$vip['heal20'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo 'Успешно';
}

View File

@ -1,33 +0,0 @@
<?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` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `heal35` FROM `abils_user` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
$t1 = explode(";", $battle['t1']);
if(in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if($user['battle'] <= 0) {
echo 'Это боевая магия ...';
} elseif($vip['heal35'] <= 0) {
echo 'Магия исчерпала себя ...';
} elseif($user['battle'] > 0 && $user['hp'] == $user['maxhp']) {
echo 'Ваше здоровье, и так полное ...';
} elseif($user['battle'] > 0 && $user['hp'] <= 0) {
echo 'Вы мертвы ...';
} else {
$vip['heal35'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
$hp = floor($user['maxhp']*0.35);
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' использовал заклятие Воcстановление энергии 35%.<BR>');
$user['hp'] += $hp;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_user` SET `heal35` = "'.$vip['heal35'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo 'Успешно';
}

View File

@ -1,33 +0,0 @@
<?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` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `heal50` FROM `abils_user` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$battle = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
$t1 = explode(";", $battle['t1']);
if(in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if($user['battle'] <= 0) {
echo 'Это боевая магия ...';
} elseif($vip['heal50'] <= 0) {
echo 'Магия исчерпала себя ...';
} elseif($user['battle'] > 0 && $user['hp'] == $user['maxhp']) {
echo 'Ваше здоровье, и так полное ...';
} elseif($user['battle'] > 0 && $user['hp'] <= 0) {
echo 'Вы мертвы ...';
} else {
$vip['heal50'] -= 1;
if($user['invis'] == 1) { $lod = '<i><b>невидимка</b></i>'; } else { $lod = Nick::id($user['id'])->short(); }
$hp = floor($user['maxhp']*0.5);
addlog($battle['id'], '<span class=date>'.date("H:i").'</span> '.$lod.' использовал заклятие Воcстановление энергии 50%.<BR>');
$user['hp'] += $hp;
if($user['hp'] > $user['maxhp']) {
$user['hp'] = $user['maxhp'];
}
mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('UPDATE `abils_user` SET `heal50` = "'.$vip['heal50'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
echo 'Успешно';
}

View File

@ -657,30 +657,6 @@ function user_relicts()
return $r;
}
if (isset($_GET['use'])) {
if ($_GET['use'] == 1) {
include('magic/usability_vip/invisible.php');
} elseif ($_GET['use'] == 2) {
include('magic/usability_vip/devastate.php');
} elseif ($_GET['use'] == 3) {
include('magic/usability_vip/defence.php');
} elseif ($_GET['use'] == 4) {
include('magic/usability_vip/attack.php');
} elseif ($_GET['use'] == 5) {
include('magic/usability_vip/attack_blood.php');
} elseif ($_GET['use'] == 6) {
include('magic/usability_vip/sleep.php');
} elseif ($_GET['use'] == 7) {
include('magic/usability_vip/travmoff.php');
} elseif ($_GET['use'] == 8) {
include('magic/usability_vip/no_attack.php');
} elseif ($_GET['use'] == 9) {
include('magic/usability_vip/un_sleep.php');
} elseif ($_GET['use'] == 10) {
include('magic/usability_vip/pers_blood.php');
}
}
if (isset($_GET['used'])) {
if ($_GET['used'] == 1) {
include('magic/usability_user/sleep15.php');
@ -689,11 +665,11 @@ if (isset($_GET['used'])) {
} elseif ($_GET['used'] == 3) {
include('magic/usability_user/close_battle.php');
} elseif ($_GET['used'] == 4) {
include('magic/usability_user/heal20.php');
//include('magic/usability_user/heal20.php');
} elseif ($_GET['used'] == 5) {
include('magic/usability_user/heal35.php');
//include('magic/usability_user/heal35.php');
} elseif ($_GET['used'] == 6) {
include('magic/usability_user/heal50.php');
//include('magic/usability_user/heal50.php');
} elseif ($_GET['used'] == 7) {
include('magic/usability_user/travmoff.php');
} elseif ($_GET['used'] == 8) {
@ -721,11 +697,11 @@ if (isset($_GET['useds'])) {
} elseif ($_GET['useds'] == 3) {
include('magic/usability_klan/close_battle.php');
} elseif ($_GET['useds'] == 4) {
include('magic/usability_klan/heal20.php');
//include('magic/usability_klan/heal20.php');
} elseif ($_GET['useds'] == 5) {
include('magic/usability_klan/heal35.php');
//include('magic/usability_klan/heal35.php');
} elseif ($_GET['useds'] == 6) {
include('magic/usability_klan/heal50.php');
//include('magic/usability_klan/heal50.php');
} elseif ($_GET['useds'] == 7) {
include('magic/usability_klan/travmoff.php');
} elseif ($_GET['useds'] == 8) {