2023-03-31 18:42:06 +00:00
|
|
|
|
<?php
|
2023-01-28 02:24:37 +00:00
|
|
|
|
if (!defined('GAME')) {
|
|
|
|
|
die();
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//выбираем эффект жертвы
|
2023-01-28 02:24:37 +00:00
|
|
|
|
$eff = mysql_fetch_array(
|
|
|
|
|
mysql_query(
|
|
|
|
|
'SELECT * FROM `eff_users` WHERE `name` LIKE "%Жажда Жизни +%" AND `uid` = "' . $usr['id'] . '" AND `delete` = "0" LIMIT 1'
|
|
|
|
|
)
|
|
|
|
|
);
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//эффект свой
|
2023-01-28 02:24:37 +00:00
|
|
|
|
$eff_users = mysql_fetch_array(
|
|
|
|
|
mysql_query(
|
|
|
|
|
'SELECT * FROM `eff_users` WHERE `name` LIKE "%Жажда Жизни +%" AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0" LIMIT 1'
|
|
|
|
|
)
|
|
|
|
|
);
|
2023-01-10 16:29:32 +00:00
|
|
|
|
//эффект защиты от вора
|
2023-01-28 02:24:37 +00:00
|
|
|
|
$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);
|
|
|
|
|
(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']); //удаляем свиток
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|