game/_incl_data/class/Magic/berezka_tactic.php

44 lines
1.9 KiB
PHP
Raw Normal View History

2023-03-31 18:42:06 +00:00
<?php
2024-01-06 15:30:34 +00:00
if (!defined('GAME')) {
die();
2022-06-06 21:30:34 +00:00
}
2024-01-06 15:30:34 +00:00
$bu = mysql_fetch_array(mysql_query('SELECT * FROM `tactic` WHERE `btl` = "' . $u->info['battle'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1'));
2022-06-06 21:30:34 +00:00
2024-01-06 15:30:34 +00:00
if ($u->info['battle'] == 0) {
$u->error = 'Использовать можно только в поединке';
} elseif (isset($bu['id'])) {
$u->error = 'Нельзя использовать свиток каждый ход...';
} elseif (isset($btl->i->id)) {
//
mysql_query(
'INSERT INTO `tactic` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES ("' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time(
) . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1")'
);
//
$btl->priemAddLog(
$id, 1, 2, $u->info['id'], $u->info['enemy'],
'',
'{tm1} {u1} использовал заклятие &quot;<b>' . $itm['name'] . '</b>&quot;.',
($btl->hodID)
);
$btl->users[$btl->uids[$u->info['id']]]['tactic1'] += 1;
$btl->users[$btl->uids[$u->info['id']]]['tactic2'] += 1;
$btl->users[$btl->uids[$u->info['id']]]['tactic3'] += 1;
$btl->users[$btl->uids[$u->info['id']]]['tactic4'] += 1;
$btl->users[$btl->uids[$u->info['id']]]['tactic5'] += 1;
mysql_query(
'UPDATE `stats` SET
`tactic1` = "' . $btl->users[$btl->uids[$u->info['id']]]['tactic1'] . '",
`tactic2` = "' . $btl->users[$btl->uids[$u->info['id']]]['tactic2'] . '",
`tactic3` = "' . $btl->users[$btl->uids[$u->info['id']]]['tactic3'] . '",
`tactic4` = "' . $btl->users[$btl->uids[$u->info['id']]]['tactic4'] . '",
`tactic5` = "' . $btl->users[$btl->uids[$u->info['id']]]['tactic5'] . '"
WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
//
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1');
$u->error = '‚ы использовали “никальную тактику +1';
2022-06-06 21:30:34 +00:00
}