game/_incl_data/class/magic/addrep.php

176 lines
6.1 KiB
PHP

<?
if(!defined('GAME'))
{
die();
}
if( $u->info['twink'] != 0 )
{
$u->error = 'Íåâîçìîæíî èñïîëüçîâàòü &quot;'.$itm['name'].'&quot;. Çàéäèòå íà îñíîâíîãî ïåðñîíàæà!';
}
elseif( $itm['id'] > 0 && $itm['item_id']==10006 )
{
$repc='repcapitalcity';
if ($u->rep[$repc]<25000)
{
$st['expUpg'] += 0;
$u->rep[$repc] += $st['expUpg'];
if ($u->rep[$repc]>25000)
{
$u->rep[$repc]=25000;
}
$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 `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" 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;. Óðîâåíü Âàøåé ðåïóòàöèè äîñòèã ïðåäåëà 25000 åä.!';
}
}
elseif( $itm['id'] > 0 && $itm['item_id']==10007 )
{
$repc='repsandcity';
if ($u->rep[$repc]<25000)
{
$st['expUpg'] += 0;
$u->rep[$repc] += $st['expUpg'];
if ($u->rep[$repc]>25000)
{
$u->rep[$repc]=25000;
}
$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 `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" 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;. Óðîâåíü Âàøåé ðåïóòàöèè äîñòèã ïðåäåëà 25000 åä.!';
}
}
elseif( $itm['id'] > 0 && $itm['item_id']==10008 )
{
$repc='repemeraldscity';
if ($u->rep[$repc]<25000)
{
$st['expUpg'] += 0;
$u->rep[$repc] += $st['expUpg'];
if ($u->rep[$repc]>25000)
{
$u->rep[$repc]=25000;
}
$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 `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" 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;. Óðîâåíü Âàøåé ðåïóòàöèè äîñòèã ïðåäåëà 25000 åä.!';
}
}
elseif( $itm['id'] > 0 && $itm['item_id']==10009 )
{
$repc='repabandonedplain';
if ($u->rep[$repc]<25000)
{
$st['expUpg'] += 0;
$u->rep[$repc] += $st['expUpg'];
if ($u->rep[$repc]>25000)
{
$u->rep[$repc]=25000;
}
$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 `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" 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;. Óðîâåíü Âàøåé ðåïóòàöèè äîñòèã ïðåäåëà 25000 åä.!';
}
}
elseif( $itm['id'] > 0 && $itm['item_id']==10010 )
{
$repc='repangelscity';
if ($u->rep[$repc]<25000)
{
$st['expUpg'] += 0;
$u->rep[$repc] += $st['expUpg'];
if ($u->rep[$repc]>25000)
{
$u->rep[$repc]=25000;
}
$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 `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" 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;. Óðîâåíü Âàøåé ðåïóòàöèè äîñòèã ïðåäåëà 25000 åä.!';
}
}
elseif( $itm['id'] > 0 && $itm['item_id']==10011 )
{
$repc='repdemonscity';
if ($u->rep[$repc]<25000)
{
$st['expUpg'] += 0;
$u->rep[$repc] += $st['expUpg'];
if ($u->rep[$repc]>25000)
{
$u->rep[$repc]=25000;
}
$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 `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" 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;. Óðîâåíü Âàøåé ðåïóòàöèè äîñòèã ïðåäåëà 25000 åä.!';
}
}
elseif( $itm['id'] > 0 && $itm['item_id']==10012 )
{
$repc='repsuncity';
if ($u->rep[$repc]<25000)
{
$st['expUpg'] += 0;
$u->rep[$repc] += $st['expUpg'];
if ($u->rep[$repc]>25000)
{
$u->rep[$repc]=25000;
}
$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 `rep` SET `'.$repc.'` = "'.$u->rep[$repc].'" 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;. Óðîâåíü Âàøåé ðåïóòàöèè äîñòèã ïðåäåëà 25000 åä.!';
}
}
?>