game/_incl_data/class/dnaction/3/altar.php
2022-06-07 00:30:34 +03:00

47 lines
2.3 KiB
PHP

<?
if( isset($s[1]) && $s[1] == '3/altar' ) {
/*
ÀËòàðü
* Ìîæíî ïîëó÷èòü îäèí èç 4 eff
*/
//Âñå ïåðåìåííûå ñîõðàíÿòü â ìàññèâå $vad !
$vad = array(
'go' => true
);
$vad['test1'] = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `dungeon_actions` WHERE `dn` = "'.$u->info['dnow'].'" AND `vars` = "obj_act'.$obj['id'].'" LIMIT 1'));
if( $vad['test1'][0] > 0 ) {
$r = 'Íè÷åãî íå ïðîèçîøëî...';
$vad['go'] = false;
}
if( $vad['go'] == true ) {
mysql_query('INSERT INTO `dungeon_actions` (`dn`,`time`,`x`,`y`,`uid`,`vars`,`vals`) VALUES (
"'.$u->info['dnow'].'","'.time().'","'.$obj['x'].'","'.$obj['y'].'","'.$u->info['id'].'","obj_act'.$obj['id'].'","'.$vad['bad'].'"
)');
$vad['i1'] = array(
0 => 422,
1 => 423,
2 => 424,
3 => 425,
4 => 458
);
$vad['i2'] = array(
422 => 'INSERT INTO `eff_users` (`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`) VALUES ("422","'.$u->info['id'].'","Áëàãîñëîâåíèå ×åðíîêíèæíèêà","add_m6=5|nofastfinisheff=1|onlyOne=1","60","'.time().'") ' ,
423 => 'INSERT INTO `eff_users` (`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`) VALUES ("423","'.$u->info['id'].'","Áëàãîñëîâåíèå Ýïèñêîïà","add_m10=5|nofastfinisheff=1|onlyOne=1","61","'.time().'") ' ,
424 => 'INSERT INTO `eff_users` (`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`) VALUES ("424","'.$u->info['id'].'","Áëàãîñëîâåíèå Îôèöåðà Ãëóáèí","add_speedhp=-50|nofastfinisheff=1|onlyOne=1","62","'.time().'") ' ,
425 => 'INSERT INTO `eff_users` (`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`) VALUES ("425","'.$u->info['id'].'","Áëàãîñëîâåíèå Ñòðàæåé","add_m5=100|nofastfinisheff=1|onlyOne=1","63","'.time().'") ',
458 => 'INSERT INTO `eff_users` (`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`) VALUES ("458","'.$u->info['id'].'","Áëàãîñëîâåíèå Ïîâåëèòåëÿ","add_m7=5|nofastfinisheff=1|onlyOne=1","76","'.time().'") ' );
$vad['i1'] = $vad['i1'][rand(0,count($vad['i1'])-1)];
if( isset($vad['i2'][$vad['i1']]) ) {
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = "'.$vad['i1'].'" AND `delete` = 0');
mysql_query($vad['i2'][$vad['i1']]);
$r = 'Íà âàñ íàëîæåíî çàêëÿòèå!';
}else{
$r = 'Íà âàñ íàëîæåíî çàêëÿòèå! (ýôôåêò íå íàéäåí, ïîæàëóéñÿ Àäìèíàì)';
}
}
unset($vad);
}
?>