function drawContainer($guid, $bag)
{
    $item_data = getItemData($guid);
    if ($item_data == 0 || @$item_data[ITEM_FIELD_TYPE] != TYPE_CONTAINER) {
        return;
    }
    $slot = $item_data[CONTAINER_FIELD_NUM_SLOTS];
    echo "<div style=\"position: relative; width: 185px;\">";
    echo generateBagTable($slot);
    $bagico = getItemIconFromItemId($item_data[ITEM_FIELD_ENTRY]);
    echo "<img src={$bagico} width=38 style=\"position: absolute; left: 3px; top: 3px;\">";
    $sub = $slot & 3 ? 21 : 0;
    foreach ($bag as $id => $container) {
        $pos = $id + ($slot & 3);
        $posx = ($pos & 3) * 41 + 16;
        $posy = ($pos >> 2) * 41 + 49 - $sub;
        show_item_by_guid($container['item'], 'armory', $posx, $posy);
    }
    echo "</div>";
}
Пример #2
0
function renderSocketed($socket, $sock_gem_enchant)
{
    if ($sock_gem_enchant) {
        $sock_enchant = getEnchantment($sock_gem_enchant);
        $desc = '<a href="?enchant=' . $sock_gem_enchant . '">' . $sock_enchant['description'] . '</a>';
        if ($sock_enchant['GemID']) {
            echo '<tr><td class=EnchantSock><img src="' . getItemIconFromItemId($sock_enchant['GemID']) . '"> ' . $desc . '</td></tr>';
        } else {
            echo '<tr><td class=EnchantSock>' . $desc . '</td></tr>';
        }
    } else {
        // Камня нет выводим как обычный сокет
        renderSocket($socket);
    }
}