game/modules_data/moder/usempa.php

45 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if(!defined('GAME'))
{
die();
}
if($p['heal'] == 1)
{
$uu = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['logingo']).'" LIMIT 1'));
if(isset($uu['id']))
{
if($uu['city']!=$u->info['city'] && $p['citym1']==0){
$uer = 'Персонаж находится в другом городе';
}elseif($uu['battle']>0){
$uer = 'Персонаж находится в поединке';
}else{
$upd = mysql_query('UPDATE `stats` SET `mpNow` = `mpNow` + "1200" WHERE `id` = "'.$uu['id'].'" LIMIT 1');
if($upd)
{
$sx = '';
if($u->info['sex']==1)
{
$sx = 'а';
}
$rtxt = '[img[items/cureMana1000.gif]] '.$rang.' &quot;'.$u->info['cast_login'].'&quot; восстановил'.$sx.' ману персонажа &quot;'.$uu['login'].'&quot;';
$cmsg = new ChatMessage();
$cmsg->setCity($u->info['city']);
$cmsg->setRoom($u->info['room']);
$cmsg->setText($rtxt);
$cmsg->setType(6);
$cmsg->setTypeTime(1);
(new Chat())->sendMsg($cmsg);
$uer = 'Вы успешно восстановили ману персонажа "'.$uu['login'].'".';
}else{
$uer = 'Не удалось использовать данное заклятие';
}
}
}else{
$uer = 'Персонаж не найден в этом городе';
}
}else{
$uer = 'У Вас нет прав на использование данного заклятия';
}
?>