131 lines
5.0 KiB
PHP
131 lines
5.0 KiB
PHP
<?
|
|
if(!defined('GAME'))
|
|
{
|
|
die();
|
|
}
|
|
if($tr['var_id'] != '') {
|
|
|
|
$io = '';
|
|
|
|
/*
|
|
1. Âûïàäàåò àðòåôàêò óðîâíÿ ïåðñîíàæà - 1% , âðåìåííûé , íå ïðîäàåòñÿ , ñóäüáà , 3 äí. ñðîê ãîäíîñòè
|
|
2. Âûïàäàåò ëèáî 5 åêð. ñâèòîê, ëèáî ñâèòîê +200% îïûòà íà 3 ÷àñà (áåç çàìîðîçêè)
|
|
3. 1 èç 4 ýëèêñèðîâà +15 (åêð.)
|
|
4. ×åê 20 êð.
|
|
*/
|
|
$trgos = false;
|
|
|
|
$key1 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4460 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1'));
|
|
$key2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4461 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1'));
|
|
$key3 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4462 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1'));
|
|
$key4 = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = 4463 AND `uid` = '.$this->info['id'].' AND `delete` = 0 AND `inShop` = 0 AND `inTransfer` = 0 LIMIT 1'));
|
|
|
|
if( isset($key1['id']) && isset($key2['id']) && isset($key3['id']) && isset($key4['id']) ) {
|
|
mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = '.$key1['id'].' OR `id` = '.$key2['id'].' OR `id` = '.$key3['id'].' OR `id` = '.$key4['id'].' LIMIT 4');
|
|
$trgos = true;
|
|
}
|
|
|
|
if( $trgos == true ) {
|
|
if( rand(0,100) == 57 || $this->info['admin'] > 0 ) {
|
|
//Âûäàåì àðòåôàêò
|
|
$io .= '<i>Âðåìåííûé àðòåôàêò</i>, ';
|
|
$arts_1 = array();
|
|
$arts_lvl = $this->info['level'];
|
|
if( $arts_lvl < 4 ) {
|
|
$arts_lvl = 4;
|
|
}elseif( $arts_lvl > 10 ) {
|
|
$arts_lvl = 10;
|
|
}
|
|
$sp1 = mysql_query('SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%|art=%" AND `data` LIKE "%tr_lvl='.$arts_lvl.'%"');
|
|
while( $pl1 = mysql_fetch_array($sp1) ) {
|
|
$arts_1[] = $pl1['items_id'];
|
|
}
|
|
$arts_1 = $arts_1[rand(0,count($arts_1)-1)];
|
|
if( $arts_1 > 0 ) {
|
|
$this->addItem($arts_1,$this->info['id'],'|nosale=1|srok='.(1*1209600).'',NULL,50);
|
|
}
|
|
//echo '['.$arts_1[rand(0,count($arts_1)-1)].'!'.count($arts_1).'!'.$arts_lvl.']';
|
|
}
|
|
|
|
$recr=rand(1,200); // 0.5% 4510 - 40 åêð /2% 5021 - 20 åêð /5.5% 5020 -10 åêð/ 10.5% 4465 -5 åêð/ 100% 5017 - 1åêð
|
|
$rcr=rand(1,200); // 5%4274 - 400 êð / 15% 4392/4392 - 100 êð / 30% 4392 -50 êð/ 100% 4464 - 20êð
|
|
$ryay=rand(1,200); // 5%4274 - 400 êð / 15% 4392/4392 - 100 êð / 30% 4392 -50 êð/ 100% 4464 - 20êð
|
|
|
|
if( $recr > 199 ) {
|
|
//Âûäàåì ÷åê +40 åêð.
|
|
|
|
$io .= '<i>×åê íà 40 åêð.</i>, ';
|
|
$this->addItem(4510,$this->info['id'],'|sudba='.$this->info['login']);
|
|
|
|
}elseif( $recr > 198 ){
|
|
//Âûäàåì ÷åê +20 åêð.
|
|
$io .= '<i>×åê íà 20 åêð.</i>, ';
|
|
$this->addItem(5021,$this->info['id'],'|sudba='.$this->info['login']);
|
|
}elseif( $recr > 192 ){
|
|
//Âûäàåì ÷åê +10 åêð.
|
|
$io .= '<i>×åê íà 10 åêð.</i>, ';
|
|
$this->addItem(5020,$this->info['id'],'|sudba='.$this->info['login']);
|
|
}elseif( $recr > 180 ){
|
|
//Âûäàåì ÷åê +5 åêð.
|
|
$io .= '<i>×åê íà 5 åêð.</i>, ';
|
|
$this->addItem(4465,$this->info['id'],'|sudba='.$this->info['login']);
|
|
}else{
|
|
//Âûäàåì ÷åê +1 åêð.
|
|
$io .= '<i>×åê íà 1 åêð.</i>, ';
|
|
$this->addItem(5017,$this->info['id'],'|sudba='.$this->info['login']);
|
|
}
|
|
|
|
if( $rcr > 94 ) {
|
|
//Âûäàåì ÷åê íà 400 êð.
|
|
$io .= '<i>×åê íà 400 êð.</i> ';
|
|
$this->addItem(4274,$this->info['id'],'|sudba='.$this->info['login']);
|
|
}elseif( $rcr > 84 ){
|
|
//Âûäàåì ÷åê íà 100 êð.
|
|
$io .= '<i>×åêè íà ñóììó 100 êð.</i> ';
|
|
$this->addItem(4392,$this->info['id'],'|sudba='.$this->info['login']);
|
|
$this->addItem(4392,$this->info['id'],'|sudba='.$this->info['login']);
|
|
}elseif( $rcr > 69 ){
|
|
//Âûäàåì ÷åê íà 50 êð.
|
|
$io .= '<i>×åê íà 50 êð.</i> ';
|
|
$this->addItem(4392,$this->info['id'],'|sudba='.$this->info['login']);
|
|
}else{
|
|
//Âûäàåì ÷åê íà 20 êð.
|
|
$io .= '<i>×åê íà 20 êð.</i> ';
|
|
$this->addItem(4464,$this->info['id'],'|sudba='.$this->info['login']);
|
|
}
|
|
if( $ryay > 199 ) {
|
|
//Âûäàåì ÿéöî äðàêîíà.
|
|
$io .= '<i>ßéöî Äðàêîíà.</i> ';
|
|
$this->addItem(6445,$this->info['id']);
|
|
}
|
|
|
|
|
|
|
|
$elik_1 = array(
|
|
4037,4038,4039,4040
|
|
);
|
|
$elik_1 = $elik_1[rand(0,3)];
|
|
if( $elik_1 > 0 ) {
|
|
//Âûäàåì 1 èç 4 ýëèêîâ
|
|
$io .= '<i>Ýëèêñèð +22 ñòàòîâ</i>, ';
|
|
$this->addItem($elik_1,$this->info['id'],'|nosale=1|',NULL,1);
|
|
}
|
|
|
|
|
|
|
|
//Âûäàåì ñâèòîê +200%
|
|
$io .= '<i>Ñâèòîê +100% îïûòà</i>, ';
|
|
$this->addItem(4466,$this->info['id'],'');
|
|
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("'.$this->info['id'].'","'.time().'","capitalcity","'.$this->info['room'].'","trup_sun"," ","","")');
|
|
mysql_query('UPDATE `users_achiv` SET `snt`= `snt`+1 WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
|
|
|
|
}else{
|
|
$no_open_itm = true;
|
|
$this->error = 'Òðåáóåòñÿ 4 ðàçëè÷íûõ êëþ÷à ñ ïîëÿ áèòâû.';
|
|
}
|
|
|
|
|
|
}
|
|
unset($i5,$i3,$i4);
|
|
?>
|