game/modules_data/location/dungeons/trap15.php

84 lines
3.9 KiB
PHP
Raw Normal View History

2022-06-06 21:30:34 +00:00
<?php
if(!defined('GAME'))die();
if(isset($file) && $file[0]=='dungeons/trap15.php'){
$actions = array();
$action = explode('|',$file[1]);
//id_bot:col |
foreach( $action as $value ) {
$temp = explode(':',$value);
$actions[$temp[0]]= $temp[1];
}
# attackBot:1|left=1|right=1
$vad = array();
//
$vad['rnd'] = rand(-3,5);
if($vad['rnd'] == 1) {
2023-01-10 16:29:32 +00:00
//Вымороженные сухожилия (Ловкость: -5)
2022-06-06 21:30:34 +00:00
$vad['img'] = 'hockey_trap_agil';
2023-01-10 16:29:32 +00:00
$vad['g'] = 'Вымороженные сухожилия';
2022-06-06 21:30:34 +00:00
$vad['id_eff'] = 391;
$vad['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `id_eff` = "'.$vad['id_eff'].'" LIMIT 1'));
$vad['data'] = 'add_s2=-'.(round($vad['eff']['x']+1)*5).'';
}elseif($vad['rnd'] == 2) {
2023-01-10 16:29:32 +00:00
//Замедленная реакция (Интуиция: -5)
2022-06-06 21:30:34 +00:00
$vad['img'] = 'hockey_trap_inst';
2023-01-10 16:29:32 +00:00
$vad['g'] = 'Замедленная реакция';
2022-06-06 21:30:34 +00:00
$vad['id_eff'] = 392;
$vad['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `id_eff` = "'.$vad['id_eff'].'" LIMIT 1'));
$vad['data'] = 'add_s3=-'.(round($vad['eff']['x']+1)*5).'';
}elseif($vad['rnd'] == 3) {
2023-01-10 16:29:32 +00:00
//Пробитый иммунитет (Уровень жизни (НР): -10%)
2022-06-06 21:30:34 +00:00
$vad['img'] = 'hockey_trap_hp';
2023-01-10 16:29:32 +00:00
$vad['g'] = 'Пробитый иммунитет';
2022-06-06 21:30:34 +00:00
$vad['id_eff'] = 393;
$vad['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `id_eff` = "'.$vad['id_eff'].'" LIMIT 1'));
$vad['data'] = 'add_hpProc=-'.(round($vad['eff']['x']+1)*10).'';
}elseif($vad['rnd'] == 4) {
2023-01-10 16:29:32 +00:00
//Печальное бессилие (Сила: -5)
2022-06-06 21:30:34 +00:00
$vad['img'] = 'hockey_trap_str';
2023-01-10 16:29:32 +00:00
$vad['g'] = 'Печальное бессилие';
2022-06-06 21:30:34 +00:00
$vad['id_eff'] = 394;
$vad['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `id_eff` = "'.$vad['id_eff'].'" LIMIT 1'));
$vad['data'] = 'add_s1=-'.(round($vad['eff']['x']+1)*5).'';
}elseif($vad['rnd'] == 5) {
2023-01-10 16:29:32 +00:00
//Замедленная скорость передвижения
2022-06-06 21:30:34 +00:00
$vad['img'] = 'hockey_trap_speed';
2023-01-10 16:29:32 +00:00
$vad['g'] = 'Замедленная скорость передвижения';
2022-06-06 21:30:34 +00:00
$vad['id_eff'] = 395;
$vad['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `id_eff` = "'.$vad['id_eff'].'" LIMIT 1'));
$vad['data'] = 'add_speed_dungeon=-'.(round($vad['eff']['x']+1)*20).'';
}else{
$vad['g'] = '';
}
if( $vad['eff']['x'] > 4 ) {
2023-01-10 16:29:32 +00:00
$d->error = 'Вы и так покалечены, вы не катаетесь на коньках, а просто ползете по льду...';
2022-06-06 21:30:34 +00:00
}elseif( $vad['g'] == '' ) {
2023-01-10 16:29:32 +00:00
$d->error = 'Вы чудом не упали, но в следующий раз вам точно не повезет!';
2022-06-06 21:30:34 +00:00
}else{
2023-01-10 16:29:32 +00:00
$d->error = 'Вы упали и получили негативный эффект &quot;'.$vad['g'].'&quot;...';
2022-06-06 21:30:34 +00:00
//
2023-01-10 16:29:32 +00:00
//Добавляем новую болезнь
2022-06-06 21:30:34 +00:00
if(!isset($vad['eff']['id'])) {
mysql_query('INSERT INTO `eff_users` (
`id_eff`,`uid`,`name`,`data`,`timeUse`
) VALUES (
"'.$vad['id_eff'].'","'.$u->info['id'].'","'.$vad['g'].'","'.$vad['data'].'","'.time().'"
)');
//
if($u->info['sex'] == 0) {
2023-01-10 16:29:32 +00:00
$vad['text'] = '[img[items/'.$vad['img'].'.gif]] <b>'.$u->info['login'].'</b> поскользнулся и получил увечья &quot;'.$vad['g'].'&quot;!';
2022-06-06 21:30:34 +00:00
}else{
2023-01-10 16:29:32 +00:00
$vad['text'] = '[img[items/'.$vad['img'].'.gif]] <b>'.$u->info['login'].'</b> поскользнулась и получила увечья &quot;'.$vad['g'].'&quot;!';
2022-06-06 21:30:34 +00:00
}
$d->sys_chat($vad['text']);
}else{
mysql_query('UPDATE `eff_users` SET `data` = "'.$vad['data'].'" , `x` = `x`+1 WHERE `id` = "'.$vad['eff']['id'].'" LIMIT 1');
}
}
//
unset($temp,$actions,$r,$vad);
}