コード例 #1
0
                    }
                    echo '<HR>' . $nam;
                }
                echo '</font>';
                ?>
',0,1,event)" onmouseout="showhint('','',0,0,event)"><?php 
                echo '<img src="http://' . img_domain . '/avatar/' . $player['avatar'] . '" border="0" alt="' . $player['name'] . '"></a>
				</td>
				<td valign=top>';
                if ($player['clan_id'] != 0) {
                    echo '<a href="http://' . domain_name . '/view/?clan=' . $player['clan_id'] . '" target="_blank""><img src="http://' . img_domain . '/clan/' . $player['clan_id'] . '.gif" alt="Информация о клане" title="Информация о клане" border=0></a>';
                }
                print_sklon($player);
                //проверим на доступность значки нападения на игрока и присоединения к бою
                //значок атаки
                $reas = check_attack($char, $player);
                if ($reas == 1) {
                    $popup_menu = 0;
                    $str = '';
                    if ($char['clan_id'] != 0 and $player['clan_id'] != 0) {
                        $vse = $map['boy_type1'] + $map['boy_type2'] + $map['boy_type3'] + $map['boy_type4'] + $map['boy_type5'] + $map['boy_type6'] + $map['boy_type7'];
                        if ($vse > 1) {
                            echo '
							<SCRIPT language=JavaScript>
							DHTML_texts[' . $num . ']=';
                            if ($map['boy_type1'] == 1) {
                                echo '"&nbsp;<A class=DHTMLmnu href=\\"act.php?func=action&option=attack&type=1&id=' . $player['user_id'] . '\\">Атаковать</A><BR>"';
                                if ($map['boy_type2'] == 1 or $map['boy_type3'] == 1 or $map['boy_type4'] == 1 or $map['boy_type5'] == 1 or $map['boy_type6'] == 1 or $map['boy_type7'] == 1) {
                                    echo '+';
                                }
                            }
コード例 #2
0
ファイル: funct.php プロジェクト: themiddleearth/RPG.SU
function print_online(&$array)
{
    global $char, $user_id;
    $array_size = count($array);
    for ($index = 0; $index < $array_size; $index++) {
        $player = $array[$index];
        if ($player['admin_id'] == '1') {
            echo '<b>';
        }
        $arena = 0;
        if ($player['maps_name'] == 'Арена Хаоса') {
            $arena = 1;
            $player['name'] = '******';
        }
        if ($char['clan_id'] == 1 or $user_id == 36051 or $user_id == 612) {
            echo '<a href="?func=online&teleport_map_name=' . $player["map_name"] . '&teleport_map_xpos=' . $player["map_xpos"] . '&teleport_map_ypos=' . $player["map_ypos"] . '"><img src="http://' . img_domain . '/nav/show.gif" border="0"></a>';
        }
        if ($arena != 1) {
            echo '<a href="http://' . domain_name . '/view/?userid=' . $player["user_id"] . '" target="_blank"><img src="http://' . img_domain . '/nav/i.gif" border=0 alt="Инфо"  title="Инфо" width=12 height=12></a>&nbsp;';
            echo '<a href="act.php?func=pm&pm=write&new&komu=' . htmlentities(urlencode($player["name"])) . '" title="Написать личное сообщение"><img src="http://' . img_domain . '/pm/new_pm.gif" border="0" alt="Написать личное сообщение" width=18 height=12></a>&nbsp;';
            if ($player['clan_id'] != '0') {
                echo '<img src="http://' . img_domain . '/clan/' . $player['clan_id'] . '.gif" alt="' . $player['clan_name'] . '" title="' . $player['clan_name'] . '">&nbsp;';
            }
            print_sklon($player);
        }
        $bold = false;
        if (check_attack($char, $player, 0, $player) == 1) {
            $bold = true;
        }
        if ($bold) {
            echo '<font color=#FFFF80>';
        }
        if ($player['admin_id'] == '1') {
            echo '<span ';
            ?>
onmousemove=movehint(event) onmouseover="showhint('<font color=#003366><center>Статус игрока:</font>','<?php 
            if ($player['clan_id'] == 1) {
                echo ' <font color=#990000><b><center>АДМИНИСТРАТОР игры</center></b></font>';
            } else {
                echo ' <font color=#990000><center>Страж игры</center></font>';
            }
            ?>
',0,1,event)" onmouseout="showhint('','',0,0,event)"<?php 
            echo '>' . $player['name'] . '';
            if ($arena != 1) {
                echo ' (' . mysqlresult(myquery("SELECT name FROM game_har WHERE id=" . $player['race'] . ""), 0, 0) . ' ' . $player['clevel'] . ' уровня)';
            }
            echo '</span>';
        } else {
            echo '' . $player['name'] . ' ';
            if ($arena != 1) {
                echo '(' . $player['race_name'] . ' ' . $player['clevel'] . ' уровня)';
            }
        }
        if ($player['dolina'] == 1 or $arena) {
        } else {
            echo ' x-' . $player['map_xpos'] . ' y-' . $player['map_ypos'] . '';
        }
        if ($bold) {
            echo '</font>';
        }
        //echo' <font size=1 color=ff0000 face=verdana><b>'.get_delay_reason($player['delay_reason']).'</b></font>';
        if ($player['admin_id'] == '1') {
            echo '</b>';
        }
        echo '<br>';
    }
}
コード例 #3
0
function attack_user($char, $player, $type, $turnir_type = 0)
{
    $id = $player['user_id'];
    $user_id = $char['user_id'];
    $l_type = $type;
    $map = mysql_fetch_array(myquery("SELECT * FROM game_maps WHERE id=" . $char['map_name'] . ""));
    if ($l_type != 8 and $l_type != 9) {
        if (check_attack($char, $player, $l_type, $map) != 1) {
            if (function_exists("save_debug")) {
                save_debug();
            }
            return 0;
        }
    }
    if (clans_war == 1 and $map['dolina'] == 1 and clans_war_type > 0) {
        $type = clans_war_type;
    }
    if (chaos_war == 1) {
        $type = 5;
    }
    // Проверка на то, что игрок не нападает на другого более 2-ух раз за последний час
    $kol_attacks = mysql_num_rows(myquery("SELECT count(*) as kol FROM game_combats_log WHERE user1_id = " . $user_id . " AND user2_id = " . $id . " AND time>=" . (time() - 60 * 60) . " HAVING kol>=2"));
    // Создаём бой
    $uid = create_combat($type, $char['map_name'], $char['map_xpos'], $char['map_ypos'], $turnir_type, $user_id, $id);
    $side_char = $char['user_id'];
    $side_player = $player['user_id'];
    switch ($type) {
        case 1:
            $nam = 14;
            break;
        case 2:
            $nam = 15;
            break;
        case 3:
            $nam = 16;
            break;
        case 4:
            $nam = 17;
            $side_char = $char['clan_id'];
            $side_player = $player['clan_id'];
            break;
        case 5:
            $nam = 18;
            break;
        case 6:
            $nam = 49;
            $side_char = $char['sklon'];
            $side_player = $player['sklon'];
            break;
        case 7:
            $nam = 48;
            $side_char = $char['race'];
            $side_player = $player['race'];
            break;
        case 8:
            $nam = 47;
            break;
        case 9:
            $nam = 46;
            break;
    }
    $skill = take_skills($char['user_id']);
    $skill1 = take_skills($player['user_id']);
    //Проверим нет ли на пострадавшем эффекта "Неуязвимости"
    $check_effect = myquery("SELECT * FROM game_obelisk_users WHERE user_id='" . $player['user_id'] . "' AND type=6 AND time_end>" . time() . " ");
    if ($turnir_type == 0 and $map['dolina'] != 1 and ($char['vsadnik'] < $player['vsadnik'] or mysql_num_rows($check_effect) > 0 or $kol_attacks > 0)) {
        $func1 = 2;
        $func2 = 1;
    } else {
        $func1 = 5;
        $func2 = 5;
        if ($type == 4) {
            myquery("INSERT INTO game_log (message,date,FROMm,ob) VALUES ('" . iconv("Windows-1251", "UTF-8//IGNORE", "<span style=\"font-weight:900;font-size:14px;color:red;font-family:Verdana,Tahoma,Arial,Helvetica,sans-serif\"> ВНИМАНИЕ! <img align=\"center\" src=\"http://" . img_domain . "/clan/" . $char['clan_id'] . ".gif\"> " . mysql_result(myquery("SELECT nazv FROM game_clans WHERE clan_id=" . $char['clan_id'] . ""), 0, 0) . " и <img align=\"center\" src=\"http://" . img_domain . "/clan/" . $player['clan_id'] . ".gif\"> " . mysql_result(myquery("SELECT nazv FROM game_clans WHERE clan_id=" . $player['clan_id'] . ""), 0, 0) . " начинают бой: " . $map['name'] . "(" . $char['map_xpos'] . "; " . $char['map_ypos'] . ") </span>'") . "," . time() . ",-1,1)");
        }
        //Если на игрока напали против его воли, то, при наличии соответствующего навыка, выдадим его эффект неуязвимости
        if ($type == 4 and $skill1['HIDE'] > 0 and mysql_num_rows($check_effect) == 0) {
            $time_hide = time() + $skill1['HIDE'] * 3 * 60;
            myquery("INSERT INTO game_obelisk_users (user_id,time_end,type) VALUES (" . $player['user_id'] . "," . $time_hide . ",6)");
        }
    }
    //Снимем с атакующего игрока эффект неуязвимости
    myquery("DELETE FROM game_obelisk_users WHERE user_id=" . $char['user_id'] . " AND type=6");
    $hod = 1;
    //Кидаем в бой игроков
    combat_insert($char, 0, $uid, $type, $side_char, $hod, 0, 0, 0, $map['k_exp'] / 100, $map['k_gp'] / 100, $skill, $func1, $nam, 1);
    combat_insert($player, 0, $uid, $type, $side_player, $hod, 0, 0, 0, $map['k_exp'] / 100, $map['k_gp'] / 100, $skill1, $func2, $nam, 1);
    //Отработаем действие навыка "Убийца" для 1-ого игрока
    if ($skill['SLAYER'] > 0) {
        $r = mt_rand(1, 100);
        if ($r <= $skill['SLAYER'] * 2 + 5) {
            $effect = $skill['SLAYER'] * 5;
            insert_fast_effect($char['user_id'], $player['user_id'], $uid, $hod, 42, $effect);
        }
    }
    if ($l_type != 8 and $l_type != 9) {
        $pismo = iconv("Windows-1251", "UTF-8//IGNORE", "<span style=\"font-style:italic;font-size:12px;color:gold;\">На тебя напал игрок <b>" . $char['name'] . "</b></span>");
        myquery("INSERT INTO game_log (`message`,`date`,`FROMm`,`too`,`ptype`) VALUES ('" . mysql_real_escape_string($pismo) . "'," . time() . ",-1,{$id},1)");
    } else {
        $pismo = iconv("Windows-1251", "UTF-8//IGNORE", "<span style=\"font-style:italic;font-size:12px;color:gold;\">Начинается турнирная дуэль с игроком: <b>" . $char['name'] . "</b></span>");
        myquery("INSERT INTO game_log (`message`,`date`,`FROMm`,`too`,`ptype`) VALUES ('" . mysql_real_escape_string($pismo) . "'," . time() . ",-1," . $player['user_id'] . ",1)");
        $pismo = iconv("Windows-1251", "UTF-8//IGNORE", "<span style=\"font-style:italic;font-size:12px;color:gold;\">Начинается турнирная дуэль с игроком: <b>" . $player['name'] . "</b></span>");
        myquery("INSERT INTO game_log (`message`,`date`,`FROMm`,`too`,`ptype`) VALUES ('" . mysql_real_escape_string($pismo) . "'," . time() . ",-1," . $char['user_id'] . ",1)");
    }
    if ($l_type != 8 and $l_type != 9) {
        save_stat($user_id, '', '', 16, '', '', '', $player['clan_id'], '', '', '');
    }
    setLocation("http://" . domain_name . "/combat.php");
    return '';
}
コード例 #4
0
ファイル: action.php プロジェクト: themiddleearth/RPG.SU
     }
     $player = mysql_fetch_array($result);
     if (!isset($_GET['type'])) {
         $type = 1;
     } else {
         $type = (int) $_GET['type'];
     }
     if ($type < 1 or $type > 7) {
         if (function_exists("save_debug")) {
             save_debug();
         }
         exit;
     }
     $map = mysql_fetch_array(myquery("select * from game_maps where id=" . $char['map_name'] . ""));
     $t = $type;
     $reas = check_attack($char, $player, $t, $map);
     if ($reas == 1) {
         attack_user($char, $player, $type);
     } else {
         $loc = "act.php?errror=" . urlencode($reas) . "";
         setLocation($loc);
         if (function_exists("save_debug")) {
             save_debug();
         }
         exit;
     }
     break;
 case 'join':
     if (isset($_GET['id'])) {
         $id = (int) $_GET['id'];
         $online_range = time() - 300;