function dumpRep($depth, $tree, &$rep)
{
    $pre = '';
    if ($depth != 0) {
        for ($i = 0; $i < $depth; $i++) {
            $pre .= '&nbsp;&nbsp;&nbsp;';
        }
    }
    uasort($tree, 'rcmp');
    foreach ($tree as $id => $t) {
        if ($t['details']) {
            $tip = '<table class=skilltip><tr class=top><td>' . $t['name'] . '</td></tr><tr><td>' . $t['details'] . '</td></tr></table>';
            echo '<tr ' . addTooltip($tip, 'STICKY, false, BORDER, false') . '>';
        } else {
            echo '<tr>';
        }
        if (isset($t['childs'])) {
            echo '<td class=teamreputation colspan=3><a id="no_tip" href="?faction=' . $t['id'] . '">' . $pre . $t['name'] . '</a></td></tr>';
            dumpRep($depth + 1, $t['childs'], $rep);
        } else {
            $rep_data = getReputationDataFromReputation($rep[$id]['standing']);
            echo '<td class=reputation><a id="no_tip" href="?faction=' . $id . '">' . $pre . $t['name'] . '</a></td>';
            echo '<td class=rep_value>' . $rep_data['rank_name'] . '</td>';
            echo '<td class=rep_bar><div class=rep_bar><b class=rep' . $rep_data['rank'] . ' style="width: ' . intval($rep_data['rep'] / $rep_data['max'] * 100) . '%;"></b><span>' . $rep_data['rep'] . '/' . $rep_data['max'] . '</span></div></td>';
            echo '</tr>';
        }
    }
}
예제 #2
0
function onlineMapRenderCallback($data, $x, $y)
{
    $imgX = 16;
    $imgY = 16;
    $x = round($x - $imgX / 2, 0);
    $y = round($y - $imgY / 2, 0);
    $gender = $data['gender'];
    $class = $data['class'];
    $race = $data['race'];
    $level = $data['level'];
    $faction = getPlayerFaction($race);
    $map_name = getMapName($data['map']);
    $area_name = getAreaNameFromPoint($data['map'], $data['position_x'], $data['position_y'], $data['position_z']);
    $img = $faction == 0 ? "gps_icon1.png" : "gps_icon.png";
    $text = "<table class=online_map>";
    $text .= "<tr><td class=" . ($faction == 0 ? "aname" : "hname") . ">" . $data['name'] . "</td></<tr>";
    if ($area_name) {
        $text .= "<tr><td align=center>{$area_name}<br>";
    }
    $text .= "<tr><td align=center>";
    $text .= "<img width=20 src=" . getRaceImage($race, $gender) . "> <img width=20 src=" . getClassImage($class) . "><br>";
    $text .= getRace($race) . "<br>";
    $text .= getClass($class) . "<br>";
    $text .= "Level - {$level}<br>";
    $text .= "</td></tr>";
    $text .= "</table>";
    return '<img src="images/map_points/' . $img . '" class=point style="left: ' . $x . '; top: ' . $y . ';" ' . addTooltip($text) . '>' . "\n";
}
예제 #3
0
function showPlayerGuild($guid, $char_data)
{
    global $cDB;
    // Получение разрешений на просмотр
    $currentTabRights = array(0x0, 0x0, 0x0, 0x0, 0x0, 0x0);
    $guildid = $char_data[PLAYER_GUILDID];
    $rank = $char_data[PLAYER_GUILDRANK];
    if ($guildid == 0) {
        echo "Not in guild";
        return;
    }
    $gbrights = $cDB->select("SELECT * FROM `guild_bank_right` WHERE `guildid` = ?d AND `rid` = ?d", $guildid, $rank);
    foreach ($gbrights as $r) {
        $currentTabRights[$r['TabId']] |= $r['gbright'];
    }
    // Получаем данные о табах
    $tabinfo = $cDB->select("SELECT\n  `TabId` AS ARRAY_KEY,\n  `TabName`,\n  `TabIcon`,\n  `TabText`\n  FROM `guild_bank_tab`\n  WHERE guildid = ?d\n  ORDER BY `TabId`", $guildid);
    if ($tabinfo) {
        $bank_tabs = $cDB->select("SELECT\n    `TabId` AS ARRAY_KEY_1,\n    `SlotId` AS ARRAY_KEY_2,\n    `item_guid`,\n    `item_entry`\n    FROM `guild_bank_item`\n    WHERE guildid = ?d\n    ORDER BY `TabId`, `SlotId`", $guildid);
        // Скрипт смены табов в гильдбанке
        echo '<script type="text/javascript" id="guild_script">
     function showTab(tab){
      for(i=0;i<6;i++)
       if (div = document.getElementById("guildtab_" + i))
        div.style.visibility=(i==tab)?"visible":"hidden";
         return false;
     }
    </script>';
        // Отрисовываем гильд банк
        echo '<br><div id=guildbank style="color: #FFFFFF; position: relative; width: 765px; height: 424px;">';
        echo '<img src="images/player_info/bank/guildbank.gif" style="position: absolute; left: 0px; top: 0px;">';
        echo '<div style="position: absolute; left: 0px; top: 2px; width: 725px; text-align: center;"><b>Guild Bank</b></div>';
        $visible = "visible";
        foreach ($tabinfo as $tabid => $tab) {
            // Проверяем права на просмотр
            if ($currentTabRights[$tabid] & GUILD_BANK_RIGHT_VIEW_TAB) {
                // Выводим новый таб
                echo '<div id=guildtab_' . $tabid . ' style="visibility: ' . $visible . ';">';
                $visible = "hidden";
                if ($tabinfo) {
                    echo '<div style="position: absolute; left: 0px; top: 28px; width: 723px;"><b>' . $tab['TabName'] . '</b></div>';
                }
                // Вывод вещей в табе
                if (isset($bank_tabs[$tabid])) {
                    foreach ($bank_tabs[$tabid] as $slot => $tabslot) {
                        show_item_by_guid($tabslot['item_guid'], "guildb", 49 * intval($slot / 7) + 23, 44 * intval($slot % 7) + 61);
                    }
                }
                echo '</div>';
                // Иконка таба
                $img = 'images/icons/' . ($tab['TabIcon'] ? strtolower($tab['TabIcon']) : 'wowunknownitem01') . '.jpg';
                // Описание таба
                $tip = $tab['TabName'] ? addTooltip($tab['TabName']) : '';
                echo '<a href=# onclick="return showTab(' . $tabid . ');">';
                echo '<img src="images/player_info/bank/guildbanktab.gif" style="position: absolute; left: 724px; top: ' . (55 + $tabid * 50) . 'px; border: 0px;">';
                echo '<img width=32px src="' . $img . '" ' . $tip . ' style="position: absolute; left: 727px; top: ' . (66 + $tabid * 50) . 'px;border: 0px;">';
                echo '</a>';
            } else {
                echo '<img src="images/player_info/bank/guildbanktab.gif" ' . addTooltip('no rights') . ' style"position: absolute; left: 724px; top: ' . (55 + $tabid * 50) . 'px; border: 0px;">';
            }
        }
        echo '</div>';
    } else {
        echo "No guild bank present";
    }
}
예제 #4
0
function defaultAreaRenderCallback($area_id, $data, $x, $y)
{
    global $gZoneToAreaImage, $lang;
    $area = getAreaIdFromPoint($data['map'], $data['position_x'], $data['position_y'], $data['position_z']);
    if (!$area) {
        return;
    }
    $area_data = getArea($area);
    $zone = $area_data['zone_id'] ? $area_data['zone_id'] : $area;
    $mapname = getMapName($data['map']);
    $areaname = $area_data['zone_id'] ? getAreaName($area_data['zone_id'], 0) . " (" . $area_data['name'] . ")" : $area_data['name'];
    if ($data['type'] == 'n') {
        $text = getCreatureName($data['id'], 0) . "&nbsp;({$data['guid']})<br>{$mapname}&nbsp;-&nbsp;{$areaname}<br>{$lang['respawn']}&nbsp;" . getTimeText($data['spawntimesecs']);
        if (getCreatureEvent($data['guid']) > 0) {
            $text = substr_replace("<br>{$lang['spawn_at_event']}&nbsp;-&nbsp;" . getGameEventName(getCreatureEvent($data['guid'])), $text, 0, 0);
        }
        if (getCreatureEvent($data['guid']) < 0) {
            $text = substr_replace("<br>{$lang['despawn_at_event']}&nbsp;-&nbsp;" . getGameEventName(abs(getCreatureEvent($data['guid']))), $text, 0, 0);
        }
        if (getCreaturePool($data['guid'])) {
            $text = substr_replace("<br>{$lang['pool']}&nbsp;(" . getCreaturePool($data['guid']) . ")", $text, 0, 0);
        }
        if (getCreaturePoolTemplate($data['id'])) {
            $text = substr_replace("<br>{$lang['pool']}&nbsp;(" . getCreaturePoolTemplate($data['id']) . ")", $text, 0, 0);
        }
    }
    if ($data['type'] == 'o') {
        $text = getGameobjectName($data['id'], 0) . "&nbsp;({$data['guid']})<br>{$mapname}&nbsp;-&nbsp;{$areaname}<br>{$lang['respawn']}&nbsp;" . getTimeText($data['spawntimesecs']);
        if (getGameobjectEvent($data['guid']) > 0) {
            $text = substr_replace("<br>{$lang['spawn_at_event']}&nbsp;-&nbsp;" . getGameEventName(getGameobjectEvent($data['guid'])), $text, 0, 0);
        }
        if (getGameobjectEvent($data['guid']) < 0) {
            $text = substr_replace("<br>{$lang['despawn_at_event']}&nbsp;-&nbsp;" . getGameEventName(abs(getGameobjectEvent($data['guid']))), $text, 0, 0);
        }
        if (getGameobjectPool($data['guid'])) {
            $text = substr_replace("<br>{$lang['pool']}&nbsp;(" . getGameobjectPool($data['guid']) . ")", $text, 0, 0);
        }
        if (getGameobjectPoolTemplate($data['id'])) {
            $text = substr_replace("<br>{$lang['pool']}&nbsp;(" . getGameobjectPoolTemplate($data['id']) . ")", $text, 0, 0);
        }
    }
    if ($data['type'] == 'i') {
        $text = "{$mapname} - {$areaname}";
    }
    if ($data['type'] == 'w') {
        $text = $data['point'];
    }
    if ($gZoneToAreaImage[$zone] == $area_id) {
        $img = "images/map_points/gps_icon.png";
    } else {
        $img = "images/map_points/gps_icon1.png";
    }
    $imgX = 16;
    $imgY = 16;
    $x = round($x - $imgX / 2, 0);
    $y = round($y - $imgY / 2, 0);
    return '<img src="' . $img . '" class=point style="left: ' . $x . 'px; top: ' . $y . 'px;" ' . addTooltip($text) . '>' . "\n";
}
예제 #5
0
function showPlayerSkills($guid)
{
    global $wDB, $lang;
    $skill_category = $wDB->select('-- CACHE: 1h
  SELECT `id` AS ARRAY_KEY, `name`, `order` FROM `wowd_skill_line_category`');
    $skill_rev = array();
    // Put the data on skills in buffer for sotrirovki their class
    $playerSkill = array();
    $skillcount = getCharacterSkills($guid);
    if ($skillcount) {
        foreach ($skillcount as $guid) {
            $skillId = $guid['skill'];
            // skill id
            if ($skillId == 0) {
                continue;
            }
            $skill = $guid['value'];
            // skill
            $maxskill = $guid['max'];
            // max skill
            $skillPerm = 0;
            //  with talent (add and skill, and to maxSkill (zanulil)
            $skillTemp = 0;
            // Temporary BNF, affects only the skill (zanulil yet)
            if ($skillLine = getSkillLine($skillId)) {
                $skill = $skill + $skillPerm;
                $maxskill = $maxskill + $skillPerm;
                $category = $skillLine['Category'];
                // Category 12 hidden
                if ($category == 12) {
                    continue;
                }
                $order = $skill_category[$category]['order'];
                $skill_rev[$order] = $category;
                $playerSkill[$order][] = array('id' => $skillId, 'Name' => $skillLine['Name'], 'Category' => $category, 'Description' => $skillLine['Description'], 'icon' => $skillLine['iconId'], 'Skill' => $skill, 'maxSkill' => $maxskill, 'bonus' => $skillTemp);
            }
        }
    }
    if ($playerSkill) {
        ksort($playerSkill);
        //  Output data to a table
        echo '<table class=report cellSpacing=0 cellPadding=0><TBODY>';
        echo '<tr><td class=head colspan=3>' . $lang['player_skills'] . '</td></tr>';
        foreach ($playerSkill as $id => $skill_data) {
            $id = $skill_rev[$id];
            echo '<tr><td class=skill_category colspan=3> ' . $skill_category[$id]['name'] . '</td></tr>';
            foreach ($skill_data as $skill) {
                if ($skill['Description'] != '') {
                    $tip = '<table class=skilltip><tr class=top><td>' . $skill['Name'] . '</td></tr><tr><td>' . $skill['Description'] . '</td></tr></table>';
                    echo '<tr ' . addTooltip($tip, 'BORDER, false, STICKY, false') . '>';
                } else {
                    echo '<tr>';
                }
                $pct = intval($skill['Skill'] / $skill['maxSkill'] * 100);
                $text = $skill['Skill'];
                if ($skill['bonus'] > 0) {
                    $text .= '<font class=posstat>+' . $skill['bonus'] . '</font>';
                } else {
                    if ($skill['bonus'] < 0) {
                        $text .= '<font class=negstat>' . $skill['bonus'] . '</font>';
                    }
                }
                $text .= ' / ' . $skill['maxSkill'];
                $ico = '';
                if ($skill['icon'] > 1) {
                    $ico = '<img src=' . getSpellIcon($skill['icon']) . '>';
                }
                echo '<td class=skill_ico>' . $ico . '</td>';
                echo '<td class=skill_name><A href="?skill=' . $skill['id'] . '&guid=' . $guid . '">' . $skill['Name'] . '</td>';
                echo '<td class=skill_bar><div class=skill_bar><b class=s1 style="width: ' . $pct . '%;"></b><span>' . $text . '</span></div></td>';
                echo '</tr>';
            }
        }
        echo '</tbody></table>';
    }
}
예제 #6
0
$cname = array(1 => 'warrior', 2 => 'paladin', 3 => 'hunter', 4 => 'rogue', 5 => 'priest', 6 => 'death_knight', 7 => 'shaman', 8 => 'mage', 9 => 'warlock', 11 => 'druid');
foreach ($cname as $c => $name) {
    echo '<a href="?talent=' . $name . '" ' . addTooltip(getClass($c)) . '><img class=item src="' . getClassImage($c) . '"></a>&nbsp;';
    if ($talent == $name) {
        $header = getClass($c);
        $link .= "=" . $name;
        $cid = $c;
    }
}
echo "<br>";
//echo "<br><b>Pets:</b> ";
$list = $wDB->select('SELECT `id`, `category` FROM `wowd_creature_family` WHERE `category` <> -1 ORDER BY `name`');
foreach ($list as $family) {
    $f = $family['id'];
    $c = $family['category'];
    echo '<a href="?talent&pet=' . $c . '" ' . addTooltip(getCreatureFamily($f, 0)) . '><img class=item src="' . getFamilyImage($f) . '"></a>&nbsp;';
    if ($pid == $c) {
        $header = getCreatureFamily($f);
        $link .= "&pet=" . $c;
    }
}
echo '</div><br>';
if ($cid or $pid >= 0) {
    echo '<div id="talent"></div>';
    includeTalentScript($cid, $pid, $config['talent_calc_max_level'], $header);
    if ($bild) {
        echo '<script type="text/javascript">tc_bildFromStr("' . $bild . '");</script>';
    }
    echo '<script type="text/javascript">tc_renderTree("talent");</script>';
}
echo '<div class=faq><center>';