game/_incl_data/class/Magic/off_s2.php
2023-08-11 18:28:54 +03:00

57 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.

<?php
if (!defined('GAME')) {
die();
}
//выбираем эффект жертвы $usr
$eff = mysql_fetch_array(
mysql_query(
'SELECT * FROM `eff_users` WHERE `id_eff` = "308" AND `uid` = "' . $usr['id'] . '" AND `delete` = "0" LIMIT 1'
)
);
//эффект свой
$eff_users = mysql_fetch_array(
mysql_query(
'SELECT * FROM `eff_users` WHERE `id_eff` = "308" 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'] . '!';
//отправляем системку
$chat = new Chat();
$cmsg = new ChatMessage();
$cmsg->setTo($usr['login']);
$cmsg->setText("Персонаж <b>{$u->info['login']}</b> украл у вас эффект {$eff['name']}.");
$cmsg->setType(6);
$chat->sendMsg($cmsg);
$cmsg->setTo('');
$cmsg->setText("<b>{$u->info['login']}</b> украл эффект {$eff['name']} у персонажа <b>{$usr['login']}</b>.");
$cmsg->setCity($u->info['city']);
$cmsg->setRoom($u->info['room']);
$cmsg->setTypeTime(1);
$cmsg->setIsAlert(true);
$chat->sendMsg($cmsg);
//уменьшаем износ
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1');
}