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

39 lines
1.4 KiB
PHP

<?
if(!defined('GAME'))
{
die();
}
if( $u->info['twink'] != 0 ) {
$u->error = 'Íåâîçìîæíî èñïîëüçîâàòü &quot;'.$itm['name'].'&quot;. Çàéäèòå íà îñíîâíîãî ïåðñîíàæà!';
}elseif( $u->info['activ'] != 0 ) {
$u->error = 'Íåâîçìîæíî èñïîëüçîâàòü &quot;'.$itm['name'].'&quot;. Àêòèâèðóéòå ïåðñîíàæà ÷åðåç E-mail!';
}elseif( $itm['id'] > 0 ) {
if ($u->info['exp']<469999999)
{
$st['expUpg'] += 0;
//$u->error = 'Âû èñïîëüçîâàëè &quot;'.$itm['name'].'&quot;. Óðîâåíü Âàøåãî îïûòà óâåëè÷èëñÿ íà '.$st['expUpg'].' åä.!';
/*
if( $u->info['exp'] < 12500 ) {
//Âûäàåì åùå è êðèñòàëë
$test_itm = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 1204 AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
if( !isset($test_itm['id']) ) {
$u->addItem(1204,$u->info['id']);
}
}
*/
$u->info['exp'] += $st['expUpg'];
if ($u->info['exp']>469999999)
{
$u->info['exp']=469999999;
}
$u->error = 'Âû èñïîëüçîâàëè &quot;'.$itm['name'].'&quot;. Óðîâåíü Âàøåãî îïûòà óâåëè÷èëñÿ íà '.$st['expUpg'].' åä.!';
mysql_query('UPDATE `stats` SET `exp` = "'.$u->info['exp'].'" WHERE `id` = '.$u->info['id'].' LIMIT 1');
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
}
else
{
$u->error = 'Âû íå ñìîãëè èñïîëüçîâàòü &quot;'.$itm['name'].'&quot;. Óðîâåíü Âàøåãî îïûòà äîñòèã ïðåäåëà 470000000 åä.!';
}
}
?>