game/_incl_data/class/magic/off_s2.php

57 lines
2.4 KiB
PHP
Raw Normal View History

2023-01-28 02:24:37 +00:00
<?php
if (!defined('GAME')) {
die();
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
//выбираем эффект жертвы $usr
2023-01-28 02:24:37 +00:00
$eff = mysql_fetch_array(
mysql_query(
'SELECT * FROM `eff_users` WHERE `id_eff` = "308" 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 `id_eff` = "308" 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'] . '!';
//отправляем системку
$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);
2023-01-10 16:29:32 +00:00
//уменьшаем износ
2023-01-28 02:24:37 +00:00
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1');
2022-06-06 21:30:34 +00:00
}