game/_incl_data/class/dnaction/3/altar.php

47 lines
2.5 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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);
}
?>