game/_incl_data/class/magic/berezka_tactic.php

39 lines
1.7 KiB
PHP
Raw Normal View History

2023-03-31 18:42:06 +00:00
<?php
2022-06-06 21:30:34 +00:00
if(!defined('GAME'))
{
die();
}
$bu = mysql_fetch_array(mysql_query('SELECT * FROM `tactic` WHERE `btl` = "'.$u->info['battle'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
if($u->info['battle']==0) {
2023-01-10 16:29:32 +00:00
$u->error = 'Использовать можно только в поединке';
2022-06-06 21:30:34 +00:00
}elseif(isset($bu['id'])) {
2023-01-10 16:29:32 +00:00
$u->error = 'Нельзя использовать свиток каждый ход...';
2022-06-06 21:30:34 +00:00
}elseif( isset($btl->info['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'],
'',
2023-01-10 16:29:32 +00:00
'{tm1} {u1} использовал заклятие &quot;<b>'.$itm['name'].'</b>&quot;.',
2022-06-06 21:30:34 +00:00
($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');
2023-01-10 16:29:32 +00:00
$u->error = '‚ы использовали “никальную тактику +1';
2022-06-06 21:30:34 +00:00
}
?>