game/_incl_data/class/priems/muh.php
2022-06-07 00:30:34 +03:00

59 lines
2.6 KiB
PHP

<?
if(!defined('GAME'))
{
die();
}
if($st['usefromfile']=='muh' && $u->info['battle'] > 0 && $u->info['hpNow'] >= 1)
{
if($btl->info['team_win'] != -1 ) {
$u->error = 'Èñïîëüçîâàòü ïèðîæêè âîçìîæíî òîëüêî âî âðåìÿ áîÿ';
}else{
$bu = mysql_fetch_array(mysql_query('SELECT * FROM `pirogi` WHERE `btl` = "'.$u->info['battle'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
if(isset($bu['id'])) {
$u->error = 'Íåëüçÿ èñïîëüçîâàòü ïèðîæêè òàê ÷àñòî! Îñòàëîñü õîäîâ: '.$bu['hod'].'';
}else{
mysql_query('INSERT INTO `pirogi` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES ("'.$u->info['battle'].'","'.$u->info['id'].'","'.time().'","'.$itm['item_id'].'","'.$itm['name'].'","7")');
if( $itm['magic_inci'] == 449 ) {
$txt = ' Â ðåçóëüòàòå ïåðñîíàæ &quot;{u2}&quot; áûë ïîäâåðæåí äåéñòâèþ &quot;<b>Ñóøåíûé Ìóõîìîð</b>&quot;.';
//
$txt = '';
if( isset($mgp['id']) ) {
$mgp['x']++;
$mgp['hod']++;
$txt = ' (x'.$mgp['x'].')';
}
if(isset($mgp['id'])) {
mysql_query('UPDATE `eff_users` SET `hod` = "'.$mgp['hod'].'", `x` = "'.$mgp['x'].'" WHERE `id` = "'.$mgp['id'].'" LIMIT 1');
}else{
mysql_query('INSERT INTO `eff_users` (
`hod`, `v2`, `img2`, `id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `v1`, `user_use`
) VALUES (
"7", "328", "invoke_kar3_mush.gif", 22, "'.$u->info['id'].'", "Ñóøåíûé Ìóõîìîð", "add_m10=40|add_m11=40|add_za=-60|add_zma=-60", 0, "77", "priem", "'.$u->info['id'].'"
)');
}
}
if($u->info['sex']==1) {
$txt = '{u1} ïðèìåíèëà çàêëèíàíèå &quot;<b>'.$itm['name'].'</b>&quot;. '.$txt.'';
}else{
$txt = '{u1} ïðèìåíèë çàêëèíàíèå &quot;<b>'.$itm['name'].'</b>&quot;. '.$txt.'';
}
$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
$id_hod = $lastHOD['id_hod'];
if($lastHOD['type']!=6) {
$id_hod++;
}
//
mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||time1='.time().'||login2='.$u->info['login'].'||t2='.$u->info['team'].'||time2='.time().'","","","","","6")');
//
mysql_query('UPDATE `items_users` SET `iznosNow` = `iznosNow` + 0 WHERE `id` = "'.$itm['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `iznosNOW` >= `iznosMAX` AND `id` = "'.$itm['id'].'" LIMIT 1');
}
}
}
?>