Exemplo n.º 1
0
function UTF82Base64($var)
{
    return Local2Base64(UTF82Local($var));
}
Exemplo n.º 2
0
function GetRoleEquipByID($var, $gm)
{
    $serverid = intval($var["serverid"]);
    $item_id = mysql_escape_string($var["item_id"]);
    global $tbl_role_equip_info;
    $qs = "select * from tbl_item_static where is_uId = {$item_id}";
    $result = MySQLQuery($qs, "Game", $serverid);
    if ($row = mysql_fetch_row($result)) {
        $item_type = $row[1];
        $item_name = Local2UTF8($row[2]);
    } else {
        return false;
    }
    $style = <<<_style
<style>
.equip {
\twidth: 230px;
\tborder: 1px solid #ccc;
\tpadding:10px;
\tfloat:left;
}
.equip div{
\tfloat:left;
}
.equip .head, .equip .binding, .equip .durability, .equip .armor, .equip .armor .armor_item, .equip .advance, .equip .advance_item, .equip .intensify, .equip .intensify .intensify_item, .equip .equip_info .armor_item, .equip .JingLing {
\twidth: 230px;
}
.equip .head .name {
\tfloat:left;
}
.equip .head .level, .equip .equip_info .weapon_speed, .equip .intensify .intensify_total, .equip .advance .advance_times, .equip .addation, .equip .JingLingSkill {
\tfloat:right;
\ttext-align:right;
\tclear: right;
}
.equip .binding, .equip .durability {
\ttext-align:right;
}
.equip .armor .armor_item .armor_name, .equip .advance .advance_item .advance_name, .equip .intensify .intensify_name, .equip .equip_info .armor_item .armor_name {
\twidth: 80px;
}
.equip .armor .armor_item .armor_value,.equip .advance .advance_item .advance_value,.equip .intensify .intensify_value,.equip .equip_info .armor_item .armor_value {
\twidth: 30px;
}
.equip .armor, .equip .advance, .equip .intensify, .equip .JingLing {
\tmargin-top: 5px;
}
</style>
_style;
    echo $style;
    echo "<div class='equip'>\n";
    switch ($item_type) {
        case 5:
            //weapon
            $qs = "select * from tbl_item_weapon where is_uId = {$item_id}";
            $result = MySQLQuery($qs, "Game", $serverid);
            if ($row = mysql_fetch_row($result)) {
                if ($row[1] != "") {
                    $item_name = $row[1];
                }
                $level = $row[2];
                $intensify = $row[7];
                $inten = $row[8];
                $DPS = $row[4];
                $speed = $row[5];
                $rate = $row[6];
                $min_attack = intval($DPS * $speed * (1 - $rate * 0.01));
                $max_attack = intval($DPS * $speed * (1 + $rate * 0.01));
                $equip_info = "<div class='weapon_attack'>" . sprintf($tbl_role_equip_info[1][0][0], $min_attack, $max_attack) . "<br/>" . sprintf($tbl_role_equip_info[1][0][2], $DPS) . "</div>\n<div class='weapon_speed'>" . sprintf($tbl_role_equip_info[1][0][1], $speed) . "</div>\n";
            }
            break;
        case 6:
            //armor
        //armor
        case 9:
            //Jewelry
            $qs = "select * from tbl_item_armor where is_uId = {$item_id}";
            $result = MySQLQuery($qs, "Game", $serverid);
            if ($row = mysql_fetch_row($result)) {
                if ($row[1] != "") {
                    $item_name = $row[1];
                }
                $level = $row[2];
                $intensify = $row[8];
                $inten = $row[9];
                $equip_info = "<div class='armor_item'><div class='armor_name'>" . $tbl_role_equip_info[1][1][0] . "</div><div class='armor_value'>+" . $row[4] . "</div></div>\n";
                $equip_info .= "<div class='armor_item'><div class='armor_name'>" . $tbl_role_equip_info[1][1][1] . "</div><div class='armor_value'>+" . $row[5] . "</div></div>\n";
                $equip_info .= "<div class='armor_item'><div class='armor_name'>" . $tbl_role_equip_info[1][1][2] . "</div><div class='armor_value'>+" . $row[6] . "</div></div>\n";
            }
            break;
        case 7:
            //shield
            $qs = "select * from tbl_item_shield where is_uId = {$item_id}";
            $result = MySQLQuery($qs, "Game", $serverid);
            if ($row = mysql_fetch_row($result)) {
                if ($row[1] != "") {
                    $item_name = $row[1];
                }
                $level = $row[2];
                $intensify = $row[4];
                $inten = $row[5];
            }
            break;
        case 8:
            //ring
            $qs = "select * from tbl_item_ring where is_uId = {$item_id}";
            $result = MySQLQuery($qs, "Game", $serverid);
            if ($row = mysql_fetch_row($result)) {
                if ($row[1] != "") {
                    $item_name = $row[1];
                }
                $level = $row[2];
                $intensify = $row[6];
                $inten = $row[7];
                $DPS = $row[4];
                $equip_info = "<div class='ring_attack'>" . sprintf($tbl_role_equip_info[1][2][0], $DPS) . "</div>\n";
            }
            break;
    }
    $addation = 0;
    $qs = "select * from tbl_item_equip_superaddation where is_uId = {$item_id}";
    $result = MySQLQuery($qs, "Game", $serverid);
    if ($row = mysql_fetch_row($result)) {
        $addation = $row[1];
    }
    $addation_rate = 0;
    $addation_time = "";
    $addation_desc = "";
    switch ($addation) {
        case 1:
            $addation_rate = 10;
            break;
        case 2:
            $addation_rate = 21;
            break;
        case 3:
            $addation_rate = 33;
            break;
        case 4:
            $addation_rate = 46;
            break;
        case 5:
            $addation_rate = 60;
            break;
        case 6:
            $addation_rate = 75;
            break;
        case 7:
            $addation_rate = 91;
            break;
        case 8:
            $addation_rate = 108;
            break;
    }
    if ($addation > 0) {
        $addation_time = "&nbsp;+" . $addation;
        $addatiom_desc = "<div class='addation'>(" . $tbl_role_equip_info[6] . $addation_rate . "%)</div>\n";
    }
    $inten_times = 0;
    $qs = "select * from tbl_item_equip_intensify where is_uId = {$item_id}";
    $result = MySQLQuery($qs, "Game", $serverid);
    if ($row = mysql_fetch_row($result)) {
        $inten_times = $row[10];
        $inten_totle = $row[14];
        $suit_info = Lan_Equip_GetSuitInfo(Local2UTF8($row[12]), $row[16]);
        $suit_name = $suit_info["name"];
        if ($row[6]) {
            $inten_info .= "<div class='intensify_item'>\n<div class='intensify_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[6])) . "</div>\n<div class='intensify_value'>+" . $row[7] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[7] / 100) . ")</div>\n") . "</div>\n";
        }
        if ($row[8]) {
            $inten_info .= "<div class='intensify_item'>\n<div class='intensify_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[8])) . "</div>\n<div class='intensify_value'>+" . $row[9] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[9] / 100) . ")</div>\n") . "</div>\n";
        }
    }
    if ($suit_name != "") {
        $suit_name .= "<br/>";
    }
    echo "<div class='head'>\n<div class='name'>" . $suit_name . Lan_Item_GetDisplayName($item_name, $item_type, false) . $addation_time . "</div>\n<div class='level'>" . $level . $tbl_role_equip_info[7] . "</div>\n" . $addatiom_desc . "</div>\n";
    $qs = "select * from tbl_item_is_binding where is_uId = {$item_id}";
    $result = MySQLQuery($qs, "Game", $serverid);
    if ($row = mysql_fetch_row($result)) {
        if ($row[1] > 0) {
            global $tbl_item_is_binding;
            echo "<div class='binding'>" . $tbl_item_is_binding[$row[1]] . "</div>\n";
        }
    }
    $qs = "select * from tbl_item_equip_durability where is_uId = {$item_id}";
    $result = MySQLQuery($qs, "Game", $serverid);
    if ($row = mysql_fetch_row($result)) {
        echo "<div class='durability'>" . sprintf($tbl_role_equip_info[0], $row[2], $row[1]) . "</div>\n";
    }
    echo "<div class='equip_info'>\n{$equip_info}</div>\n";
    $qs = "select * from tbl_item_equip_armor where is_uId = {$item_id}";
    $result = MySQLQuery($qs, "Game", $serverid);
    if (mysql_num_rows($result) > 0) {
        echo "<div class='armor'>\n";
        while ($row = mysql_fetch_row($result)) {
            echo "<div class='armor_item'>\n";
            $armor = Lan_Equip_GetArmorPiece(Local2UTF8($row[1]));
            echo "<div class='armor_name'>" . $armor[1] . "</div>\n";
            echo "<div class='armor_value'>+" . $armor[2] * $row[2] . "</div>\n";
            if ($armor[0] > 1) {
                echo "<div class='aromr_time'>(" . $row[2] . "/" . $armor[0] . ")</div>\n";
            }
        }
        echo "</div>\n";
    }
    $qs = "select * from tbl_item_equip_advance where is_uId = {$item_id}";
    $result = MySQLQuery($qs, "Game", $serverid);
    if ($row = mysql_fetch_row($result)) {
        echo "<div class='advance'>\n";
        $advance_name = Local2UTF8($row[15]);
        $advance_cur_tiems = $row[1];
        $advance_tot_tiems = $row[2];
        if ($advance_tot_tiems > 0) {
            echo "<div class='advance_item'>\n<div class='advance_name'>" . sprintf($tbl_role_equip_info[2], $advance_name) . "</div>\n<div class='advance_value'>" . $advance_cur_tiems . "/" . $advance_tot_tiems . "</div>\n<div class='advance_times'>" . sprintf($tbl_role_equip_info[5], $row[10]) . "</div>\n</div>\n";
        }
        if ($row[11] != null) {
            echo "<div class='advance_item'>\n<div class='advance_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[16])) . "</div>\n<div class='advance_value'>+" . $row[11] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[11] / 100) . ")</div>\n") . "</div>\n";
        }
        if ($row[12] != null) {
            echo "<div class='advance_item'>\n<div class='advance_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[17])) . "</div>\n<div class='advance_value'>+" . $row[12] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[12] / 100) . ")</div>\n") . "</div>\n";
        }
        if ($row[13] != null) {
            echo "<div class='advance_item'>\n<div class='advance_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[18])) . "</div>\n<div class='advance_value'>+" . $row[13] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[13] / 100) . ")</div>\n") . "</div>\n";
        }
        if ($row[14] != null) {
            echo "<div class='advance_item'>\n<div class='advance_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[19])) . "</div>\n<div class='advance_value'>+" . $row[14] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[14] / 100) . ")</div>\n") . "</div>\n";
        }
        $JingLingType = Local2UTF8($row[8]);
        $JingLingSkill = $row[7];
        echo "</div>\n";
    }
    global $tbl_item_inten_soul;
    $qs = "select * from tbl_item_equip_intensifyAddAttr where is_uId = {$item_id}";
    $result = MySQLQuery($qs, "Game", $serverid);
    if ($row = mysql_fetch_row($result)) {
        if ($row[1]) {
            $inten_info .= "<div class='intensify_item'>\n<div class='intensify_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[1])) . "</div>\n<div class='intensify_value'>+" . $row[2] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[2] / 100) . ")</div>\n") . "</div>\n";
        }
        if ($row[3]) {
            $inten_info .= "<div class='intensify_item'>\n<div class='intensify_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[3])) . "</div>\n<div class='intensify_value'>+" . $row[4] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[4] / 100) . ")</div>\n") . "</div>\n";
        }
        if ($row[5]) {
            $inten_info .= "<div class='intensify_item'>\n<div class='intensify_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[5])) . "</div>\n<div class='intensify_value'>+" . $row[6] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[6] / 100) . ")</div>\n") . "</div>\n";
        }
        if ($row[7]) {
            $inten_info .= "<div class='intensify_item'>\n<div class='intensify_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[7])) . "</div>\n<div class='intensify_value'>+" . $row[8] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[8] / 100) . ")</div>\n") . "</div>\n";
        }
        if ($row[9]) {
            $inten_info .= "<div class='intensify_item'>\n<div class='intensify_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[9])) . "</div>\n<div class='intensify_value'>+" . $row[10] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[10] / 100) . ")</div>\n") . "</div>\n";
        }
        if ($row[11]) {
            $inten_info .= "<div class='intensify_item'>\n<div class='intensify_name'>" . Lan_Equip_GetPropertyName(Local2UTF8($row[11])) . "</div>\n<div class='intensify_value'>+" . $row[12] . "</div>\n" . ($addation == 0 ? "" : "<div class='addation'>(+" . ceil($addation_rate * $row[12] / 100) . ")</div>\n") . "</div>\n";
        }
    }
    echo "<div class='intensify'>\n";
    echo "<div class='intensify_item'>\n";
    if ($intensify > 0) {
        echo "<div class='intensify_name'>" . sprintf($tbl_role_equip_info[3], $tbl_item_inten_soul[Local2Base64($inten)]) . "</div>\n<div class='intensify_value'>{$inten_times}/{$intensify}</div>\n";
    }
    if ($inten_totle) {
        echo "<div class='intensify_total'>" . sprintf($tbl_role_equip_info[4], $inten_totle) . "</div>\n";
    }
    echo "</div>\n";
    echo $inten_info;
    echo "<div class='intensify_item'>\n";
    if ($suit_info["name"] != null) {
        echo $suit_info["name"] . "\n";
    }
    echo "<div style='margin-left: 10px'>\n";
    if ($suit_info["part"] != null) {
        foreach ($suit_info["part"] as $part) {
            echo $suit_info["name"] . $part . "<br/>\n";
        }
    }
    if ($suit_info["desc"] != null) {
        foreach ($suit_info["desc"] as $i => $desc) {
            printf($tbl_role_equip_info[8], $i);
            echo $desc . "<br/>\n";
        }
    }
    echo "</div>\n";
    if ($suit_info["talent"] != null) {
        echo "<div>" . $tbl_role_equip_info[9] . $suit_info["talent"] . "</div>\n";
    }
    echo "</div>\n";
    echo "</div>\n";
    global $tbl_JingLing_type;
    echo "<div class='JingLing'><div>" . $tbl_JingLing_type[UTF82Base64($JingLingType)] . "</div>";
    if ($JingLingSkill > 0) {
        echo "<div class='JingLingSkill'>" . Lan_Equip_GetSkillName($JingLingType, $JingLingSkill) . "</div>";
    }
    echo "</div>\n";
    echo "</div>";
    return true;
}