87 lines
3.9 KiB
PHP
87 lines
3.9 KiB
PHP
<?
|
|
if(!defined('GAME'))
|
|
{
|
|
die();
|
|
}
|
|
if($u->info['admin']>0 || ($u->info['align']>=3 && $u->info['align']<4))
|
|
{
|
|
$uu = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['logingo']).'" LIMIT 1'));
|
|
$ust = $u->getStats($uu['id'],0);
|
|
if(isset($uu['id']))
|
|
{
|
|
if($uu['id'] == $u->info['id'])
|
|
{
|
|
$uer = 'Âû íå ìîæåòå êóñàòü ñàìîãî ñåáÿ';
|
|
}elseif($u->info['battle']>0)
|
|
{
|
|
$uer = 'Âû íå ìîæåòå êóñàòü â áîþ';
|
|
}elseif($ust['hpNow']<($ust['hpAll']/100*15))
|
|
{
|
|
$uer = 'Âû íå ìîæåòå óêóñèòü ýòîãî ïåðñîíàæà, æåðòâà ñëèøêîì ñëàáà';
|
|
}elseif($uu['level']>$u->info['level'])
|
|
{
|
|
$uer = 'Âû íå ìîæåòå êóñàòü ïåðñîíàæåé ñòàðøå âàñ ïî óðîâíþ';
|
|
}elseif(date('H',time())>6 && date('H',time())<21 && $u->info['admin']==0)
|
|
{
|
|
$uer = 'Âàìïèðû íå ìîãóò êóñàòüñÿ äíåì';
|
|
}elseif($u->stats['hpNow'] >= ($u->stats['hpAll']/100*67) && $u->info['admin']==0)
|
|
{
|
|
$uer = 'Âû íå íóæíàåòåñü â ýòîì, âàøå çäîðîâüå âîññòàíîâèòñÿ ñàìî ...';
|
|
}elseif(floor($uu['align'])==3 && $u->info['admin']==0)
|
|
{
|
|
$uer = 'Âû íå ìîæåòå êóñàòü òåìíûõ';
|
|
}elseif($uu['online']<time()-120)
|
|
{
|
|
$uer = 'Ïåðñîíàæ ñåé÷àñ îôôëàéí';
|
|
}elseif($uu['room']!=$u->info['room'])
|
|
{
|
|
$uer = 'Âû äîëæíû íàõîäèòñÿ â îäíîé ëîêàöèè ñ æåðòâîé';
|
|
}elseif($uu['battle']>0)
|
|
{
|
|
$uer = 'Ïåðñîíàæ íàõîäèòñÿ â áîþ';
|
|
}else{
|
|
$sx = ''; $sx2 = 'èé';
|
|
if($u->info['sex']==1)
|
|
{
|
|
$sx = 'à'; $sx2 = 'àÿ';
|
|
}
|
|
$itm1 = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$uu['id'].'" AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 AND `iznosNOW` <= `iznosMAX` AND `item_id` = 1164 LIMIT 1'));
|
|
if(isset($itm1['id']))
|
|
{
|
|
$uer = 'Íå óäàëîñü âûïèòü ýíåðãèþ "'.$uu['login'].'", ó ïåðñîíàæà áûë ïðè ñåáå êîë ïðîòèâ âàìïèðîâ. Íà÷àëñÿ áîé ñ æåðòâîé!<br>';
|
|
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW`+1 WHERE `id` = "'.$itm2['id'].'" LIMIT 1');
|
|
}else{
|
|
$itm2 = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "'.$uu['id'].'" AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 AND `iznosNOW` <= `iznosMAX` AND `item_id` = 1163 LIMIT 1'));
|
|
if(isset($itm2['id']))
|
|
{
|
|
$sx = 'íåãî'; $sx2 = 'èé';
|
|
if($uu['sex']==1)
|
|
{
|
|
$sx = 'íå¸'; $sx2 = 'àÿ';
|
|
}
|
|
$uer = 'Íå óäàëîñü âûïèòü ýíåðãèþ "'.$uu['login'].'", ó ïåðñîíàæà áûë ïðè ñåáå <span title="'.ceil($itm2['iznosNOW']).'/'.floor($itm2['iznosMAX']).'">÷åñíîê</span> ïðîòèâ âàìïèðîâ. Âû óòðàòèëè âñå çäîðîâüå.<br>';
|
|
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW`+1 WHERE `id` = "'.$itm2['id'].'" LIMIT 1');
|
|
mysql_query('UPDATE `stats` SET `hpNow` = "1",`regHP` = "'.time().'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
|
$rtxt = '[img[items/chesnok2.gif]] Âàìïèð "'.$u->info['cast_login'].'" íåóäà÷íî óêóñèë'.$sx.' ò.ê. ó "'.$uu['login'].'" áûë ïðè ñåáå ÷åñíîê';
|
|
}else{
|
|
$rtxt = '[img[items/vampir.gif]] Îãîëîäàâø'.$sx2.' "'.$u->info['cast_login'].'" íàïàë'.$sx.' íà ïåðñîíàæà "'.$uu['login'].'" è âûïèë'.$sx.' âñþ ýíåðãèþ.';
|
|
$u->stats['hpNow'] += $ust['hpNow'];
|
|
if($u->stats['hpNow']>$u->stats['hpAll'])
|
|
{
|
|
$u->stats['hpNow'] = $u->stats['hpAll'];
|
|
}
|
|
mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->stats['hpAll'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
|
mysql_query('UPDATE `stats` SET `hpNow` = "1",`regHP` = "'.time().'" WHERE `id` = "'.$uu['id'].'" LIMIT 1');
|
|
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");
|
|
$uer = 'Âû óñïåøíî âûïèëè âñþ êðîâü ó ïåðñîíàæà "'.$uu['login'].'".<br>';
|
|
}
|
|
}
|
|
unset($itm1,$itm2);
|
|
}
|
|
}else{
|
|
$uer = 'Ïåðñîíàæ íå íàéäåí â ýòîì ãîðîäå';
|
|
}
|
|
}else{
|
|
$uer = 'Ó Âàñ íåò ïðàâ íà èñïîëüçîâàíèå äàííîãî íàâûêà';
|
|
}
|
|
?>
|