Code:
# Heroes 3 of might and Magic UG Edition
#   updated by AKuHAK
# script for QuickBMS http://quickbms.aluigi.org
Get DUMMY long # 04 00 00 00
Get TABLEOFFSET long # start of all offset table
GoTo TABLEOFFSET
Get FILES long # get number of files
For i = 0 < FILES
    SavePos OFFSET_TABLE
    GetCT NAME string 0x00 # name of file
    set NAME_TXT NAME
    string NAME_TXT += ".TXT"
    math OFFSET_TABLE += 20 # after text some code phrase, ignore it
    GoTo OFFSET_TABLE
    Get OFFSET_TXT long # offset of txt file
    Get SIZE_TXT long # size of txt file
    Log NAME_TXT OFFSET_TXT SIZE_TXT
    Get TEXTURES long # number of textures stored in dds
    Get ZSIZE_ALL long
    Get SIZE_ALL long # ZSIZE and SIZE of whole texture pack
    set OFFSET OFFSET_TXT
    math OFFSET += SIZE_TXT # calculating starting offset of whole texture
    set MINIOFSET TEXTURES
    math MINIOFSET *= 4
    SavePos OFFSET_TABLE
    For j = 0 < TEXTURES
        GoTo OFFSET_TABLE
        Get ZSIZE long
        math OFFSET_TABLE += MINIOFSET
        GoTo OFFSET_TABLE
        Get SIZE long
        math OFFSET_TABLE -= MINIOFSET
        math OFFSET_TABLE += 4
        set NAMEI NAME
        string NAMEI += j
        string NAMEI += ".DDS"
        Clog NAMEI OFFSET ZSIZE SIZE
        math OFFSET += ZSIZE
    next j
next i