game/_incl_data/class/magic/off_hpVinos.php

58 lines
2.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.

<?
if (!defined('GAME')) {
die();
}
//выбираем эффект жертвы
$eff = mysql_fetch_array(
mysql_query(
'SELECT * FROM `eff_users` WHERE `name` LIKE "%Жажда Жизни +%" AND `uid` = "' . $usr['id'] . '" AND `delete` = "0" LIMIT 1'
)
);
//эффект свой
$eff_users = mysql_fetch_array(
mysql_query(
'SELECT * FROM `eff_users` WHERE `name` LIKE "%Жажда Жизни +%" AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0" LIMIT 1'
)
);
//эффект защиты от вора
$no_vor = mysql_fetch_array(
mysql_query(
'SELECT * FROM `eff_users` WHERE `id_eff` = "459" AND `uid` = "' . $usr['id'] . '" AND `delete` = "0" LIMIT 1'
)
);
if ($u->info['login'] == $usr['login']) {
$u->error = 'Глупец, ты не можешь украсть сам у себя ;)';
} elseif (isset($no_vor['id'])) {
$u->error = 'Персонаж ' . $usr['login'] . ' не дремлет, будьте осторожны';
} elseif ($usr['battle'] > 0) {
$u->error = 'Персонаж ' . $usr['login'] . ' в поединке!';
} elseif (!isset($eff['id'])) {
$u->error = 'На персонаже ' . $usr['login'] . ' нету эффекта "Жажда Жизни"';
} elseif ($eff_users['name'] && $eff_users['delete'] == 0) {
$u->error = 'У вас есть Жажда Жизни!';
} else {
//воруем эффект
mysql_query(
'UPDATE `eff_users` SET `uid` = "' . $u->info['id'] . '" WHERE `uid` = "' . $usr['id'] . '" AND `name` = "' . $eff['name'] . '" LIMIT 1'
);
$u->error = 'Вы украли эффект ' . $eff['name'] . ' у персонажа ' . $usr['login'] . '!';
//отправляем системку
$chatDto = new ChatMessage();
$chatDto->setTo($usr['login']);
$chatDto->setText("Персонаж <b>{$u->info['login']}</b> украл у вас эффект {$eff['name']}.");
$chatDto->setType(6);
$chatDto->setTime(-1);
(new Chat())->sendMsg($chatDto);
$chatDto = new ChatMessage();
$chatDto->setCity($u->info['city']);
$chatDto->setRoom($u->info['room']);
$chatDto->setText("<b>{$u->info['login']}</b> украл эффект <b>{$eff['name']}</b> у персонажа <b>{$usr['login']}</b>.");
$chatDto->setType(6);
$chatDto->setTypeTime(1);
$chatDto->setIsAlert(true);
(new Chat())->sendMsg($chatDto);
$u->deleteItem($itm['id']); //удаляем свиток
}