#engine [0x6C370582] Spacer_1
    #patch [Spacer Broad cast fix]
        INT hWindow     = FindWindow(NULL, "[zSpy]")
        INT @0x005CB342 = hWindow
        INT @0x005CC7F4 = hWindow
        INT @0x005CB4A2 = hWindow
    #/patch
    
    #patch [D3DIM700.dll - removes 2048 pixel limit]
        HEX hModuleName = "D3DIM700.dll"
        INT nModuleBase = ModuleBase(hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize(hModuleName)
            FindAndReplace(HEX 'B8 00 08 00 00 39', 'B8 00 80 00 00 39', nModuleBase, nModuleSize)
        END
    #/patch
    
    #patch [AcGenral.dll - Windows 7 rundll32.exe bugfix]
        HEX hModuleName = "AcGenral.dll"
        INT nModuleBase = ModuleBase(hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize(hModuleName)
            FindAndReplace(HEX '68 28 09 00 00', 'C2 04 00 90 90', nModuleBase, nModuleSize)
        END
    #/patch
    
    #patch [Reset spacer window]
        INT impRegOpenKeyExA   = ImportSymbol("Advapi32.dll", "RegOpenKeyExA")
        INT impRegDeleteValueA = ImportSymbol("Advapi32.dll", "RegDeleteValueA")
        INT impRegCloseKey     = ImportSymbol("Advapi32.dll", "RegCloseKey")
        INT key                = 0
        HEX registryPath       = "SOFTWARE\\PIRANHA-BYTES Software GmbH\\Spacer\\Settings\\\0"
        HEX registryValue      = "winMain\0"
        #assembler [ResetSpacerWindow]
            lea     eax, dword ptr [$key]
            push    eax                     ; key
            push    2                       ; access
            push    0                       ; flags
            push    $registryPath           ; path
            push    0x80000001              ; key
            call    $impRegOpenKeyExA
            cmp     eax, 0
            jnz     return
            push    $registryValue
            push    dword ptr [$key]
            call    $impRegDeleteValueA
            push    dword ptr [$key]
            call    $impRegCloseKey
        return:
            ret
        #/assembler
        ResetSpacerWindow()
    #/patch
#/engine

#engine [0xB1B45718] Spacer_2
    #patch [Spacer2 Broad cast fix]
        INT hWindow     = FindWindow(NULL, "[zSpy]")
        INT @0x00606B9A = hWindow
        INT @0x00607F50 = hWindow
        INT @0x00606CEF = hWindow
    #/patch
    
    #patch [D3DIM700.dll - removes 2048 pixel limit]
        HEX hModuleName = "D3DIM700.dll"
        INT nModuleBase = ModuleBase(hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize(hModuleName)
            FindAndReplace(HEX 'B8 00 08 00 00 39', 'B8 00 80 00 00 39', nModuleBase, nModuleSize)
        END
    #/patch
    
    #patch [AcGenral.dll - Windows 7 rundll32.exe bugfix]
        HEX hModuleName = "AcGenral.dll"
        INT nModuleBase = ModuleBase(hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize(hModuleName)
            FindAndReplace(HEX '68 28 09 00 00', 'C2 04 00 90 90', nModuleBase, nModuleSize)
        END
    #/patch
    
    #patch [Reset spacer window]
        INT impRegOpenKeyExA   = ImportSymbol("Advapi32.dll", "RegOpenKeyExA")
        INT impRegDeleteValueA = ImportSymbol("Advapi32.dll", "RegDeleteValueA")
        INT impRegCloseKey     = ImportSymbol("Advapi32.dll", "RegCloseKey")
        INT key                = 0
        HEX registryPath       = "SOFTWARE\\Piranha Bytes\\Spacer\\Settings\\\0"
        HEX registryValue      = "winMain\0"
        #assembler [ResetSpacerWindow]
            lea     eax, dword ptr [$key]
            push    eax                     ; key
            push    2                       ; access
            push    0                       ; flags
            push    $registryPath           ; path
            push    0x80000001              ; key
            call    $impRegOpenKeyExA
            cmp     eax, 0
            jnz     return
            push    $registryValue
            push    dword ptr [$key]
            call    $impRegDeleteValueA
            push    dword ptr [$key]
            call    $impRegCloseKey
        return:
            ret
        #/assembler
        ResetSpacerWindow()
    #/patch
#/engine

#engine [G1]
    #patch [GLOBAL DATA]
        INT Lang_Other = 0
        INT Lang_Rus = 1
        INT Lang_Eng = 2
        INT Lang_Ger = 3
        INT Lang_Pol = 4
        INT Lang_Rou = 5
        INT Lang_Ita = 6
        INT Lang_Cze = 7
        INT Lang_Esp = 8
        INT Language = GetLanguage()
        
        AllocPage(1, 0x10000)  //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(2, 0x10000)  //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(3, 0x20000)  //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(4, 0x100)    //FOV; FPS; DrawDistanceMultiplier; zMouseRotationScale; BorderlessWindow; Interface scaling; TRADE_VALUE_MULTIPLIER; Inventory_Camera_Bugfix; ONE_BUTTON_CONTROL; Items_Insert_Bug; Hit_Check_Angle; GameVersion
        AllocPage(5, 0x100000) //s_posCacheList
        AllocPage(6, 0x100)    //DS for sliding fix and etc
        
        OptionDef(BOOL  @UNION:GAME:SaveGameToASCII,                            0)
        OptionDef(BOOL  @UNION:GAME:SaveDATinASCII,                             1)
        OptionDef(BOOL  @UNION:DEBUG:ReadBinkWithVDFS,                          true)
        OptionDef(BOOL  @UNION:DEBUG:UseErrorVisuals,                           false)
        OptionDef(BOOL  @UNION:DEBUG:FixBink,                                   true)
        OptionDef(BOOL  @Union:Core:CustomDebugWindowPos,                       false)
        OptionDef(BOOL  @Union:Core:DebugWindowPosX,                            0)
        OptionDef(BOOL  @Union:Core:DebugWindowPosY,                            0)
        OptionDef(BOOL  @Union:Core:UseDebugWindowHost,                         0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BorderFix,                            1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:OptimizeVB,                           0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:dwNumVertices,                        8192)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Disable_D3DVBCAPS_WRITEONLY,          1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:SimpleWindow,                         1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BorderlessWindow,                     0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:WindowPosX,                           0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:WindowPosY,                           0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:ZNORESTHREAD,                         1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:MoverBugfix,                          1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:NumLockDisable,                       1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:DisableCacheOut,                      1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:QuickSaveEnable,                      1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:USInternationalKeyboardLayout,        Language != Lang_Ger)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:PfxFix,                               1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BUGFIX_already_deleted_zCObject,      1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Disable_HUMANS_SWIM_MDS,              0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:StrafeBug,                            0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Show_FPS_Counter,                     0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:Cache_Timeout,                        400)
        OptionDef(INT   @SYSTEMPACK:DEBUG:LineCacheSize,                        16384)
        OptionDef(INT   @SYSTEMPACK:DEBUG:ForceFlip,                            0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:DisableOcclusionCulling,              0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:TerminateProcessHotkey,               true)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:Gothic2_Control,                 1)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:FPS_Limit,                       0)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AnisotropicFiltering,            0)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:VerticalFOV,                     67.5)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:NewFOVformula,                   0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:DisableLOD,                      0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:DisableIndoorClipping,           1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTRANGE,               4500)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_REMOVERANGE,               5000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTTIME_MAX,            1000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SmoothAniDistance,               5000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:DrawDistanceMultiplier,          1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:OutDoorPortalDistanceMultiplier, 1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:InDoorPortalDistanceMultiplier,  1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:WoodPortalDistanceMultiplier,    1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:zMouseRotationScale,             0.2)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:EnableShields,                   1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:TRADE_VALUE_MULTIPLIER,          0.5)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:Animated_Inventory,              1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HideFocus,                       1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:ThrowFlag,                       1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:InteractionCollision,            1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:TestHardCollisionsOnLadder,      false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdvancedFloorCheckForInteract,   true)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:RainVobCollision,                1)
        OptionDef(BOOL  @SYSTEMPACK:BARRIER:AlwaysON,                           0)
        OptionDef(BOOL  @SYSTEMPACK:BARRIER:AlwaysOFF,                          0)
        OptionDef(BOOL  @SYSTEMPACK:BARRIER:DisableSound,                       0)
        OptionDef(BOOL  @SYSTEMPACK:BARRIER:DisableDamage,                      0)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:keyDelayRate,                    150)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:keyDelayFirst,                   150)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HighlightMeleeFocus,             1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HighlightInteractFocus,          1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HighlightInteractNoFocus,        1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:Fight_ANI_Interrupt,             0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:Monsters_Block_Damage,           0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:FixRenderItem,                   1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:MultiSlotWeapons,                1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:MultiSlotMagic,                  1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance,           false)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_LowerFPS,  55)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_UpperFPS,  60)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_ShowInfo,  false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:VisualizePerfomance,             false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HeightCorrectionOnLadder,        1)
        OptionDef(FLOAT @SYSTEMPACK:INTERFACE:Scale,                            1)
        OptionDef(BOOL  @SYSTEMPACK:INTERFACE:ForceMenuScale,                   0)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ScaleMenusX,                      640)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ScaleMenusY,                      480)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:DialogBoxX,                       640)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:DialogBoxY,                       480)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:SubtitlesBoxX,                    600)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ShowManaBar,                      1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ShowSwimBar,                      1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:HideHealthBar,                    0)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:NewChapterSizeX,                  640)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:NewChapterSizeY,                  480)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:SaveGameImageSizeX,               320)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:SaveGameImageSizeY,               200)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:InventoryItemNoteSizeX,           450)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:InventoryCellSize,                70)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_DialogChoice_Active,        -1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_DialogChoice_Inactive,      -6316129)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_Talk_Hero,                  -1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_Talk_NPC,                   -256)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_Noise,                      -49408)
        OptionDef(BOOL  @SYSTEMPACK:INTERFACE:Hide_STR_DEX,                     1)
        OptionDef(BOOL  @SYSTEMPACK:SUBTITLES:Control,                          0)
        OptionDef(FLOAT @SYSTEMPACK:SUBTITLES:TimeMultiplier,                   2.0)
        OptionDef(FLOAT @SYSTEMPACK:SUBTITLES:MaxTimePerPhrase,                 30.0)
        OptionDef(FLOAT @SYSTEMPACK:SUBTITLES:TimePerChar,                      100.0)
        OptionDef(FLOAT @UNION:DEBUG:SlidingSize,                               0.05)
    #/patch

    #patch [Load Steam Overlay]
        IF INT @SYSTEMPACK:DEBUG:OptimizeVB == 0
            HEX hSteamDirectory = FindSteamDirectory()
            INT nLength = GetHexSize(hSteamDirectory)
            INT nSteamPID = GetProcessID("Steam.exe")
            IF hSteamDirectory != "" && nSteamPID != INVALID
                LoadLibrary(Concat(hSteamDirectory, "/GameOverlayRenderer.dll.tmp"))
            END
        END
    #/patch
    
    #patch [CodeCave - 1]
        HEX @0x007396FE = 'E9 D0 02 00 00'
        INT begin = 0x00739703
        INT length = 0x007399D3 - begin
        MemSet(begin, '90', length)
    #/patch
    
    #patch [PerceptionCheck - crash fix]
        HEX @0x006B77B3 = '89 F3 90 90'
    #/patch

    #patch [Gothic.ini fixes]
        IF !BOOL @GAME:INTERNAL:extendedMenu
            BOOL @GAME:INTERNAL:extendedMenu = 1
        END
        IF  INT @GAME:VIDEO:zVidResFullscreenBPP != 32
            INT @GAME:VIDEO:zVidResFullscreenBPP = 32
        END
        IF  INT @GAME:ENGINE:zTexCacheSizeMaxBytes < 100000000
            INT @GAME:ENGINE:zTexCacheSizeMaxBytes = 100000000
        END
        IF !BOOL @GAME:INTERNAL:menuShowVersion
            BOOL @GAME:INTERNAL:menuShowVersion = 1
        END
        IF  BOOL @GAME:INTERNAL:gameStartFailed == 1
            BOOL @GAME:INTERNAL:gameStartFailed = 0
        END
        IF  BOOL @GAME:INTERNAL:gameAbnormalExit == 1
            BOOL @GAME:INTERNAL:gameAbnormalExit = 0
        END
    #/patch

    #patch [GameVersion]
        HEX @0x00839C18  = 4x00000070
        HEX @GameVersion = 4x00000070
        HEX @0x004D0625  = '68 64 14 00 00'
        HEX hVersion     = GetUnionVersion()
        GameVersion      = "Union " + hVersion
    #/patch

    #patch [D3DIM700.dll - removes 2048 pixel limit]
        HEX hModuleName = "D3DIM700.dll"
        INT nModuleBase = ModuleBase(hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize (hModuleName)
            FindAndReplace(HEX 'B8 00 08 00 00 39', 'B8 00 80 00 00 39', nModuleBase, nModuleSize)
        END
    #/patch
    
    #patch [AcGenral.dll - Windows 7 rundll32.exe bugfix]
        HEX hModuleName = "AcGenral.dll"
        INT nModuleBase = ModuleBase (hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize (hModuleName)
            FindAndReplace(HEX '68 28 09 00 00', 'C2 04 00 90 90', nModuleBase, nModuleSize)
        END
    #/patch

    #patch [ALPHA_VOB and ALPHA_WORLD_POLY]
        HEX @0x0051828F = 1x00000000
        HEX @0x0051831F = 1x00000000
        HEX @0x0051934A = 1x00000000
        HEX @0x0051BD1E = 1x00000000
        HEX @0x0051BD30 = 1x00000000
        HEX @0x0051BD47 = 1x00000000
        HEX @0x0051D73D = 1x00000000
        HEX @0x0051D77A = 1x00000000
        HEX @0x0051D7A1 = 1x00000000
        HEX @0x0051DE2A = 1x00000000
        HEX @0x0051829B = 1x0000B000
        HEX @0x0051830A = 1x0000B000
        HEX @0x00518318 = 1x0000B000
        HEX @0x00519331 = 1x0000B000
        HEX @0x0051933F = 1x0000B000
        HEX @0x0051BD5F = 1x0000B000
        HEX @0x0051D7C7 = 1x0000B000
        HEX @0x0051DE25 = 1x0000B000
        HEX @0x0051DE37 = 1x0000B000
        HEX @0x0051DE3C = 1x0000B004
        HEX @0x00517D42 = 2x00000000
        HEX @0x00517E6B = 2x00000000
        HEX @0x00517F49 = 2x00000000
        HEX @0x0051AA3E = 2x00000000
        HEX @0x00518046 = 2x0000000C
        HEX @0x0051806D = 2x0000000C
        HEX @0x005180A6 = 2x0000000C
        HEX @0x005180CD = 2x0000000C
        HEX @0x00519A8C = 2x0000000C
        HEX @0x00519AB3 = 2x0000000C
        HEX @0x0051AA37 = 2x0000000C
        HEX @0x00517D3A = '68 00 0C 00 00'
        HEX @0x00517E61 = '68 00 0C 00 00'
        HEX @0x00517E9F = '81 FB 00 0C 00 00'
        HEX @0x0051A9CF = '3D 00 0C 00 00'
        HEX @0x005B1172 = 3x00000000
        HEX @0x005B11EB = 3x00000000
        HEX @0x005B132D = 3x00000000
        HEX @0x005B116A = '68 00 18 00 00'
        HEX @0x005B11E1 = '68 00 18 00 00'
        HEX @0x005B126F = '81 FB 00 18 00 00'
    #/patch
    
    #patch [FOV]
        HEX @0x007CF533 = 'CC CC 51 FF 35 F4 FF E8 02 D9 04 24 D8 35 70 D7 49 00 D9 1D F0 FF E8 02 DF 41 74 DA 71 70 D9 05 F0 FF E8 02 DE F1 D9 E8 D9 F3 D8 0D FC 20 7D 00 D8 0D FC 1E 7D 00 50 D9 1C 24 E8 AE 71 D6 FF 59 C2 04 00'
        HEX @0x007CF538 = 4x00000004
        HEX @0x007CF547 = 4x00000000
        HEX @0x007CF553 = 4x00000000
        HEX @0x0049D774 = 'E8 BC 1D 33 00'
        HEX @0x004B7A15 = 'E8 1B 7B 31 00'
        HEX @0x004B9B1F = 'E8 11 5A 31 00'
        HEX @VFOV = 4x00000004
        VFOV = FLOAT @SYSTEMPACK:PARAMETERS:VerticalFOV
    #/patch

    #patch [MAP - 4:3 aspect ratio]
        HEX @0x00725595 = 'E8 06 9F 0A 00'
        HEX @0x007CF49E = 'CC CC 8B 02 83 EC 0C 85 C0 53 55 56 8B F1 89 46 30 8B 4A 04 57 89 4E 34 BD 01 00 00 00 7F 03 89 6E 30 8B 46 34 85 C0 7F 03 89 6E 34 33 C0 33 C9 89 46 40 89 4E 44 8B 46 4C 85 C0 0F 84 A5 5F F8 FF 8B 56 30 89 56 40 8B 46 34 89 46 44 8B 4E 4C 36 DF 41 44 D8 35 4E 1C 4D 00 50 DB 1C 24 58 8B 56 30 E9 5B 5F F8 FF CC CC'
    #/patch

    #patch [Resolution limit - 25600]
        HEX @0x0042A05B = '3D 00 64 00 00'
        HEX @0x0042A430 = '81 F9 00 64 00 00'
        HEX @0x0042A489 = '81 FD 00 64 00 00'
        HEX @0x0042BCD7 = '3D 00 64 00 00'
    #/patch

    #patch [MARVIN - F8 fix]
        HEX @0x0074CF5F = 'E8 D8 1B EA FF'
    #/patch

    #patch [DrawDistanceMultiplier]
        HEX @0x005C0590 = 'D8 1D 28 26 7D 00'
        HEX @0x00426E8B = 4x0000000C
        HEX @DrawDistanceMultiplier = 4x0000000C
        DrawDistanceMultiplier =  LIM (0.01,(FLOAT @SYSTEMPACK:PARAMETERS:DrawDistanceMultiplier * 0.01), 0.26)
    #/patch

    #patch [zPM_NUM_VBUFFER_VERT 65535]
        HEX @0x005A64F4 = LIM(4096, INT @SYSTEMPACK:DEBUG:dwNumVertices, 65535)
    #/patch

    #patch [DisableLOD]
        IF BOOL @SYSTEMPACK:PARAMETERS:DisableLOD
            FLOAT @0x007D4654 = 0.0
        END
    #/patch

    #patch [DisableIndoorClipping]
        IF BOOL @SYSTEMPACK:PARAMETERS:DisableIndoorClipping
            HEX @0x00537BF4 = '7A 00'
        END
    #/patch

    #patch [SPAWN_INSERTRANGE]
        FLOAT @0x00850FB4 = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTRANGE
    #/patch
    
    #patch [SPAWN_REMOVERANGE]
        FLOAT @0x00850FB8 = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_REMOVERANGE
    #/patch
    
    #patch [SPAWN_INSERTTIME_MAX]
        FLOAT @0x00850FB0 = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTTIME_MAX
    #/patch
    
    #patch [OutDoorPortalDistanceMultiplier]
        FLOAT @0x0051C989 = FLOAT @SYSTEMPACK:PARAMETERS:OutDoorPortalDistanceMultiplier * 3240000
        FLOAT @0x0051C991 = FLOAT @SYSTEMPACK:PARAMETERS:OutDoorPortalDistanceMultiplier * 3240000 - 1800000
    #/patch
    
    #patch [InDoorPortalDistanceMultiplier]
        FLOAT @0x00521059 = FLOAT @SYSTEMPACK:PARAMETERS:InDoorPortalDistanceMultiplier * 3240000
        FLOAT @0x00521061 = FLOAT @SYSTEMPACK:PARAMETERS:InDoorPortalDistanceMultiplier * 3240000 - 1800000
    #/patch

    #patch [WoodPortalDistanceMultiplier]
        FLOAT @0x0051C9BF = FLOAT @SYSTEMPACK:PARAMETERS:WoodPortalDistanceMultiplier * 30250000
        FLOAT @0x0051C9C7 = FLOAT @SYSTEMPACK:PARAMETERS:WoodPortalDistanceMultiplier * 30250000 - 14250000
        FLOAT @0x0052108F = FLOAT @SYSTEMPACK:PARAMETERS:WoodPortalDistanceMultiplier * 30250000
        FLOAT @0x00521097 = FLOAT @SYSTEMPACK:PARAMETERS:WoodPortalDistanceMultiplier * 30250000 - 14250000
    #/patch
    
    #patch [DisableCacheOut]
        IF BOOL @SYSTEMPACK:DEBUG:DisableCacheOut
            HEX @0x00712594 = 'E8 59 2F EA FF'
        END
    #/patch

    #patch [ZNORESTHREAD]
        IF BOOL @SYSTEMPACK:DEBUG:ZNORESTHREAD
            HEX @0x005444BB = '90'
        END
    #/patch

    #patch [MoverBugfix]
        IF BOOL @SYSTEMPACK:DEBUG:MoverBugfix
            HEX @0x005E53E6 = 'EB 0C'
        END
    #/patch
    
    #patch [zMouseRotationScale]
        HEX @zMouseRotationScale = 4x00000010
        zMouseRotationScale = FLOAT @SYSTEMPACK:PARAMETERS:zMouseRotationScale
        HEX @0x00614900 = 4x00000010
        HEX @0x00614A0B = 4x00000010
    #/patch

    #patch [FPS limit in menu]
        HEX @0x004D0E63 = 'E9 21 E7 2F 00 90'
        HEX @0x007CF589 = '8B 0D E4 D3 86 00 6A 08 FF 15 F0 00 7D 00 E9 D2 18 D0 FF'
    #/patch
    
    #patch [SubtitlesBoxX]
        HEX @0x00638C89 = INT @SYSTEMPACK:INTERFACE:SubtitlesBoxX
    #/patch
    
    #patch [NumLockDisable]
        IF BOOL @SYSTEMPACK:DEBUG:NumLockDisable
            HEX @0x0042596F = 'EB 20'
        END
    #/patch

    #patch [Barrier]
        IF BOOL @SYSTEMPACK:BARRIER:AlwaysOFF
            HEX @0x006321A8 = 'EB 57'
        END
        IF BOOL @SYSTEMPACK:BARRIER:AlwaysON
            HEX @0x006321F9 = 'EB 06'
        END
        IF BOOL @SYSTEMPACK:BARRIER:DisableSound
            HEX @0x00630B6A = 'E9 D0 00 00 00 90'
            HEX @0x00630CBE = 'E9 F1 00 00 00 90'
            HEX @0x00630E39 = 'E9 1D 01 00 00 90'
            HEX @0x00630FEC = 'E9 16 01 00 00 90'
        END
        IF BOOL @SYSTEMPACK:BARRIER:DisableDamage
            HEX @0x0069B0E8 = 'E8 E5 27 DD FF'
        END
    #/patch
    
    #patch [Enable QuickSave]
        IF BOOL @SYSTEMPACK:DEBUG:QuickSaveEnable
            HEX @0x004293B5 = '8B 0D E4 E9 85 00 6A 0F EB 7A'
            HEX @0x00429432 = 'EB 81 90 90 90 90'
            HEX @0x004294C5 = '6A 0F'
            HEX @0x004293DC = '43'
            HEX @0x004293F8 = '3E'
        END
    #/patch

    #patch [USInternationalKeyboardLayout]
        IF BOOL @SYSTEMPACK:DEBUG:USInternationalKeyboardLayout
            HEX @0x004C782C = '4E 77 4C 00'
            HEX @0x004C7888 = '45 77 4C 00'
            HEX @0x004C7808 = '7F 77 4C 00'
        END
    #/patch

    #patch [Disable key repeat acceleration in menu]
        HEX @0x004C89BC = 'EB 0C'
    #/patch

    #patch [keyDelayRate]
        FLOAT @0x004C81F5 = FLOAT @SYSTEMPACK:PARAMETERS:keyDelayRate
    #/patch

    #patch [keyDelayFirst]
        FLOAT @0x004C81FA = FLOAT @SYSTEMPACK:PARAMETERS:keyDelayFirst
    #/patch

    #patch [NUM_POS_CACHE 524288]
        HEX @0x005A6B5F = '81 7E 38 00 00 08 00'
    #/patch

    #patch [s_posCacheList]
        HEX s_posCacheList = 5x00000000
        FindAndReplace(HEX 'A0 9A 8B 00', s_posCacheList, ModuleBase(Null), ModuleSize(Null))
    #/patch
    
    #patch [ShowManaBar]
        IF INT @SYSTEMPACK:INTERFACE:ShowManaBar == 0
            HEX @0x006391CC = 'E8 DE 8E 0C 00'
        END
        IF INT @SYSTEMPACK:INTERFACE:ShowManaBar == 2
            HEX @0x006391A6 = '75 00'
        END
    #/patch

    #patch [ShowSwimBar]
        IF INT @SYSTEMPACK:INTERFACE:ShowSwimBar == 0
            HEX @0x0063911D = 'E8 8D 8F 0C 00'
        END
        IF INT @SYSTEMPACK:INTERFACE:ShowSwimBar == 2
            HEX @0x006390EE = 'EB 04 90 90 90 90'
        END
    #/patch

    #patch [HideHealthBar]
        IF INT @SYSTEMPACK:INTERFACE:HideHealthBar == 1
            HEX @0x00639042 = 'E8 68 90 0C 00'
        END
    #/patch

    #patch [Shield]
        IF BOOL @SYSTEMPACK:PARAMETERS:EnableShields
            HEX @0x00830230 = '00 5A 53 5F 4C 45 46 54 41 52 4D 00'
            HEX @0x00696D78 = 'E9 5E 88 13 00'
            HEX @0x00695C3D = 'E9 35 9A 13 00'
            HEX @0x006960B1 = 'E9 F1 95 13 00'
            HEX @0x00694271 = 'E9 66 B4 13 00 90'
            HEX @0x007CF5DB = '60 8B CE 6A 09 68 80 E0 84 00 6A 00 68 E8 06 7D 00 54 E8 8E 5E ED FF 83 C4 10 61 60 8B CE 6A 0A 68 31 02 83 00 6A 00 68 E8 06 7D 00 54 E8 73 5E ED FF 83 C4 10 61 60 68 3B F6 7C 00 8B CE E8 32 5D ED FF 81 F9 00 01 00 00 73 0B 61 68 F4 B3 8D 00 E9 4C 77 EC FF 51 8B CE E8 87 05 EC FF EB EB E8 06 7D 00 00 00 00 00 5C E0 84 00 0C 00 00 00 1F 00 00 00 E8 06 7D 00 00 00 00 00 31 02 83 00 0A 00 00 00 1F 00 00 00 E8 06 7D 00 00 00 00 00 80 E0 84 00 09 00 00 00 1F 00 00 00 68 9C B4 8D 00 60 8B CE E8 6C 53 EC FF 81 F9 00 01 00 00 73 06 61 E9 D1 65 EC FF 61 60 8B CE 68 4F F6 7C 00 68 63 F6 7C 00 E8 8B 0A ED FF EB E5 68 9C B4 8D 00 60 8B CE 68 4F F6 7C 00 E8 97 5C ED FF 81 F9 00 01 00 00 73 06 61 E9 EF 69 EC FF 61 60 8B CE 68 63 F6 7C 00 68 4F F6 7C 00 E8 56 0A ED FF EB E5 8B 86 F0 09 00 00 33 FF 85 C0 7E 35 8D 49 00 8B 96 E8 09 00 00 8B 04 BA 68 53 F6 7C 00 8D 48 04 E8 3F 83 C4 FF 85 C0 74 0D 8B 86 F0 09 00 00 47 3B F8 7C DB EB 0B 8B 86 E8 09 00 00 8B 3C B8 EB 02 33 FF 57 8B CE E8 49 6B ED FF 8B 86 F0 09 00 00 E9 45 4B EC FF'
        END
    #/patch

    #patch [Model Clipping]
        HEX @0x0051D53A = 'C7 44 24 24 F0 23 74 44'
        HEX @0x00536B8D = 'C7 44 24 14 00 00 00 BF'
    #/patch
    
    #patch [D3DVBCAPS_WRITEONLY]
        IF BOOL @SYSTEMPACK:DEBUG:Disable_D3DVBCAPS_WRITEONLY
            HEX @0x0071E656 = '81 4C 24 1C 00 00 00 00'
        END
    #/patch

    #patch [PfxFix]
        IF BOOL @SYSTEMPACK:DEBUG:PfxFix
            HEX @0x0058D7B8 = 'EB 2C'
            HEX @0x0058CD93 = '68 00 00 58 00'
            HEX @0x0058CDB0 = 'BB 00 00 01 00'
            HEX @0x0058CDD8 = 'C7 05 6C 43 87 00 00 00 01 00'
            HEX @0x0058DB31 = '68 00 00 01 00'
            HEX @0x0058DB44 = 'B9 00 00 01 00'
        END
    #/patch
    
    #patch [MAP_Delay_BUGFIX]
        HEX @0x00725944 = 'E8 27 01 00 00'
    #/patch
    
    #patch [Disable assert - refCtr>=-1, "D: OBJ: deleting an already deleted zCObject ?!"]
        IF BOOL @SYSTEMPACK:DEBUG:BUGFIX_already_deleted_zCObject
            HEX @0x00401DBD = 'EB 14'
            HEX @0x005892AD = 'E9 88 00 00 00 90'
        END
    #/patch

    #patch [CollisionBug]
        HEX @0x0053BE7D = 'B8 00 00 00 00'
    #/patch
    
    #patch [LOW_FPS_FIX]
        HEX @0x007CF732 = '81 3B 00 00 C0 FF 0F 84 3B FF D4 FF 81 3B 00 00 C0 7F 0F 84 2F FF D4 FF D9 03 8D 44 8C 1C E9 33 FF D4 FF'
        HEX @0x0051F682 = 'E9 AB 00 2B 00 90'
        HEX @0x007CF755 = '81 7C E4 20 00 00 C0 FF 0F 84 43 F0 D4 FF 81 7C E4 20 00 00 C0 7F 0F 84 35 F0 D4 FF E9 DA EF D4 FF'
        HEX @0x005F0EAA = 'E8 A6 E8 1D 00'
    #/patch
    
    #patch [DEAD_B BUGFIX]
        HEX @0x0084E680 = '54 5F 57 4F 55 4E 44 45 44 5F 32 5F 44 45 41 44 00 00 00 00'
    #/patch

    #patch [Orcs_Remove_Weapon]
        HEX @0x006A93F2 = '0F 85 00 00 00 00'
        HEX @0x006A9944 = '0F 85 00 00 00 00'
        HEX @0x006A97B3 = 'EB 17'
    #/patch

    #patch [Subtitles]
        IF BOOL @SYSTEMPACK:SUBTITLES:Control
            FLOAT @0x007CFAB6 = FLOAT @SYSTEMPACK:SUBTITLES:TimeMultiplier
            FLOAT @0x007CFABE = FLOAT @SYSTEMPACK:SUBTITLES:MaxTimePerPhrase * 1000
            FLOAT @0x007CFABA = FLOAT @SYSTEMPACK:SUBTITLES:TimePerChar
            HEX   @0x006B295F = 'D8 1D F0 1E 7D 00'
            HEX   @0x006B294F = 'E9 6E D1 11 00'
            HEX   @0x007CFAC2 = '8B CD FF 50 30 D8 0D B6 FA 7C 00 E9 82 2E EE FF'
            HEX   @0x006B297D = 'D8 0D BA FA 7C 00'
            HEX   @0x006B2996 = 'D9 05 BE FA 7C 00'
        END
    #/patch

    #patch [NewChapterSizeX]
        HEX @0x00429687 = INT @SYSTEMPACK:INTERFACE:NewChapterSizeX
    #/patch

    #patch [NewChapterSizeY]
        HEX @0x00429698 = INT @SYSTEMPACK:INTERFACE:NewChapterSizeY
    #/patch

    #patch [SaveGameImageSizeX]
        HEX @0x0063815A = INT @SYSTEMPACK:INTERFACE:SaveGameImageSizeX
    #/patch

    #patch [SaveGameImageSizeY]
        HEX @0x0063816E = INT @SYSTEMPACK:INTERFACE:SaveGameImageSizeY
    #/patch

    #patch [InventoryCellSize]
        IF INT @SYSTEMPACK:INTERFACE:InventoryCellSize != 70
            HEX @0x0066818C = 'E9 41 79 16 00 90'
            HEX @0x007CFAD2 = '68 46 00 00 00 8B CF FF 10 E9 B2 86 E9 FF'
            HEX @0x007CFAD3 = LIM(10, INT @SYSTEMPACK:INTERFACE:InventoryCellSize, 9999)
            HEX @0x006681AA = 'E9 31 79 16 00 90 90'
            HEX @0x007CFAE0 = '68 46 00 00 00 8B CF FF 52 04 E9 C2 86 E9 FF'
            HEX @0x007CFAE1 = LIM(10, INT @SYSTEMPACK:INTERFACE:InventoryCellSize, 9999)
            HEX @0x00668243 = 'E9 A7 78 16 00 90'
            HEX @0x007CFAEF = '68 4C 00 00 00 8B CF FF 10 E9 4C 87 E9 FF'
            HEX @0x007CFAF0 = LIM(10, INT @SYSTEMPACK:INTERFACE:InventoryCellSize + 6, 9999)
            HEX @0x00668261 = 'E9 97 78 16 00 90 90'
            HEX @0x007CFAFD = '68 49 00 00 00 8B CF FF 52 04 E9 5C 87 E9 FF'
            HEX @0x007CFAFE = LIM(10, INT @SYSTEMPACK:INTERFACE:InventoryCellSize + 3, 9999)
            HEX @0x00666E5A = LIM(10, INT @SYSTEMPACK:INTERFACE:InventoryCellSize + 6, 9999)
        END
    #/patch

    #patch [BorderlessWindow]
        IF BOOL @SYSTEMPACK:DEBUG:BorderlessWindow
            HEX @0x004F42AE = 'B8 00 00 00 96'
            HEX @0x004F42F1 = '68 00 00 00 00'
            HEX @0x00601A3B = '31 C9 41 90'
            HEX @0x004F42E0 = '90 90 90 90 90'
            INT adrPosX     = 4x00000014
            INT adrPosY     = 4x00000018
            INT @adrPosX    = INT @SYSTEMPACK:DEBUG:WindowPosX
            INT @adrPosY    = INT @SYSTEMPACK:DEBUG:WindowPosY
            INT @0x004F42DA = adrPosX
            INT @0x004F42D3 = adrPosY
            HEX @0x004F25D0 = 'C3'
        END
    #/patch

    #patch [DisableCrawl]
        IF BOOL @SYSTEMPACK:DEBUG:Disable_HUMANS_SWIM_MDS
            HEX @0x00615070 = 'C2 04 00 90 90 90'
        END
    #/patch

    #patch [FOV_New_Formula]
        IF BOOL @SYSTEMPACK:PARAMETERS:NewFOVformula
            HEX @0x007CF53F = 'D8 35 FC 1E 7D 00 D8 35 FC 20 7D 00 D9 F2 DD D8 DF 41 74 DA 71 70 DE F9 D9 E8 D9 F3 D8 0D FC 20 7D 00 D8 0D FC 1E 7D 00 50 D9 1C 24 E8 B0 71 D6 FF 59 C2 04 00 90 90'
        END
    #/patch

    #patch [Not equip a bow/crossbow together]
        HEX @0x005A86F0 = '8B 44 24 04 83 EC 08 83 F8 04 53 55 56 57 8B F9 0F 85 92 01 00 00 8D B7 50 05 00 00 6A 01 8B CE E8 BB 73 0C 00 6A 01 8B CE E8 A2 3D 0C 00 8B E8 33 F6 85 ED 89 6C 24 1C 89 74 24 14 0F 8E 66 01 00 00 56 6A 01 8D 8F 50 05 00 00 E8 D0 3E 0C 00 8B D8 53 8B CF E8 B6 67 0E 00 85 C0 0F 84 17 01 00 00 6A 04 8B CB E8 65 98 0C 00 85 C0 0F 84 06 01 00 00 85 DB 0F 84 FE 00 00 00 68 00 00 00 02 8B CB E8 49 98 0C 00 85 C0 0F 85 01 01 00 00 8B 83 30 02 00 00 68 A0 B6 8D 00 8B CF 89 44 24 14 E8 DB CF 0F 00 85 C0 74 23 8B 70 30 85 F6 74 1C 8B 16 8B CE FF 12 50 68 18 C4 8D 00 E8 7F 79 EC FF 83 C4 08 85 C0 74 04 8B EE EB 02 33 ED 8B 87 F0 09 00 00 33 F6 85 C0 7E 3B 90 8D 64 24 00 8B 87 E8 09 00 00 8B 04 B0 68 80 B9 8D 00 8D 48 04 E8 5B F2 E6 FF 85 C0 74 0F 8B 87 F0 09 00 00 46 3B F0 7C DB 33 F6 EB 1F 8B 8F E8 09 00 00 8B 34 B1 85 F6 75 04 33 F6 EB 0E 8B 76 30 56 E8 6E 24 11 00 83 C4 04 8B F0 85 ED 74 0E 8B 55 00 8B CD FF 52 78 3B 44 24 10 74 57 85 F6 74 0D 8B 06 8B CE FF 50 78 3B 44 24 10 74 46 8B 83 30 02 00 00 8B 97 50 05 00 00 8D 8F 50 05 00 00 6A 01 50 FF 92 A8 00 00 00 F7 D8 1B C0 F7 D8 89 44 24 10 75 1F 8B 74 24 14 8B 6C 24 1C 46 3B F5 89 74 24 14 0F 8C BC FE FF FF 5F 5E 5D 5B 83 C4 08 C2 04 00 68 00 00 00 40 8B CB E8 34 97 0C 00 85 C0 75 08 53 8B CF E8 68 E6 0E 00 5F 5E 5D 5B 83 C4 08 C2 04 00'
        HEX @0x006A226D = 'E8 7E 64 F0 FF'
    #/patch

    #patch [Interface scaling]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @Scale = 4x0000001C
            Scale = LIM(1.0, FLOAT @SYSTEMPACK:INTERFACE:Scale, 9999)
            HEX @0x006E107C = 'E9 21 78 EC FF'
            HEX @0x005A88A2 = '0F B6 54 08 1C 52 DB 04 E4 D8 0D 68 10 6E 00 DB 1C E4 8B 14 E4 89 34 E4 E9 C3 87 13 00'
            HEX @0x005A88AD = 4x0000001C
            HEX @0x006E0200 = 'E9 BA 86 EC FF'
            HEX @0x005A88BF = 'DB 41 14 D8 0D E5 88 5A 00 DB 1D E5 88 5A 00 A1 E5 88 5A 00 C3'
            HEX @0x005A88C4 = 4x0000001C
            HEX @0x005A88CA = 4x00000020
            HEX @0x005A88CF = 4x00000020
            HEX @0x005A88D4 = 'A3 08 00 FD 02 DB 05 08 00 FD 02 D8 0D 00 00 FD 02 DB 1D 08 00 FD 02 A1 08 00 FD 02 C2 04 00'
            HEX @0x005A88D5 = 4x00000024
            HEX @0x005A88DB = 4x00000024
            HEX @0x005A88E1 = 4x0000001C
            HEX @0x005A88E7 = 4x00000024
            HEX @0x005A88EC = 4x00000024
            HEX @0x006E0238 = 'E9 97 86 EC FF'
            HEX @0x006E024A = 'E9 85 86 EC FF'
            HEX @0x005A88F3 = 'DA 0D 3D DD 4C 00 D8 0D 00 00 FD 02 E8 54 EC 1C 00 DB 05 3D DD 4C 00 D8 0D 00 00 FD 02 E9 8D 6A F2 FF'
            HEX @0x004CF397 = 'E9 57 95 0D 00 90 90 90'
            HEX @0x005A88FB = 4x0000001C
            HEX @0x005A890C = 4x0000001C
            HEX @0x005A8915 = 'DB 44 E4 0C DA 35 A7 55 40 00 D8 15 00 00 FC 02 DF E0 F6 C4 41 7F 0C DD D8 68 CD 88 7C 00 E9 FF 74 17 00 D9 1D 00 00 FC 02 EB EE'
            HEX @0x005A8921 = 4x0000001C
            HEX @0x005A893A = 4x0000001C
            HEX @0x0071FE32 = 'E9 DE 8A E8 FF'
            HEX @0x005A8940 = 'DB 44 E4 10 D8 0D 00 00 FC 02 DB 5C E4 10 DB 44 E4 14 D8 0D 00 00 FC 02 DB 5C E4 14 E8 AF CC 1A 00 E9 ED CB 17 00'
            HEX @0x005A8946 = 4x0000001C
            HEX @0x005A8954 = 4x0000001C
            HEX @0x0072554E = 'E9 ED 33 E8 FF'
            HEX @0x005A8966 = 'E8 85 E4 14 00 DB 02 D8 0D 00 00 FB 02 DB 1A E9 C8 5C 0A 00 E8 71 E4 14 00 DB 01 D8 0D 00 00 FB 02 DB 19 E9 CC 5C 0A 00'
            HEX @0x005A896F = 4x0000001C
            HEX @0x005A8983 = 4x0000001C
            HEX @0x0064E63D = 'E9 24 A3 F5 FF'
            HEX @0x0064E655 = 'E9 20 A3 F5 FF'
            HEX @0x005A898E = '68 80 02 00 00 DB 04 E4 D8 0D 00 00 E2 02 DB 1C E4 E9 E7 0C E8 FF 68 E0 01 00 00 DB 04 E4 D8 0D 00 00 E2 02 DB 1C E4 E9 E2 0C E8 FF'
            HEX @0x005A8998 = 4x0000001C
            HEX @0x005A89AE = 4x0000001C
            HEX @0x00429686 = 'E9 03 F3 17 00 FF 12 8B 0D BC E1 8D 00 8B F8 8B 01 E9 08 F3 17 00'
            HEX @0x005A89BA = '68 80 02 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 AB 22 18 00 68 E0 01 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 A4 22 18 00'
            HEX @0x005A89C4 = 4x0000001C
            HEX @0x005A89DA = 4x0000001C
            HEX @0x0072AC76 = 'E9 3F DD E7 FF FF 10 8B 0D BC E1 8D 00 8B 11 E9 46 DD E7 FF'
            HEX @0x005A89E6 = '68 58 02 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 91 02 09 00'
            HEX @0x005A89F0 = 4x0000001C
            HEX @0x00638C88 = 'E9 59 FD F6 FF'
            HEX @0x005A89FC = '68 40 01 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 4C F7 08 00 68 C8 00 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 4A F7 08 00'
            HEX @0x005A8A06 = 4x0000001C
            HEX @0x005A8A1C = 4x0000001C
            HEX @0x00638159 = 'E9 9E 08 F7 FF FF 10 8B 0D BC E1 8D 00 99 2B C2 8B 11 8B F8 E9 A0 08 F7 FF'
            HEX @0x005A8A28 = '68 C2 01 00 00 DB 04 E4 D8 0D 00 00 FA 02 DB 1C E4 E9 A0 E8 0B 00'
            HEX @0x005A8A32 = 4x0000001C
            HEX @0x006672D9 = 'E9 4A 17 F4 FF'
            HEX @0x005A8A3E = 'D8 0D 00 00 F5 02 E9 0F EB 1C 00'
            HEX @0x005A8A40 = 4x0000001C
            HEX @0x0066818C = '6A 46 8B CF FF 10 89 44 24 10 DB 44 24 10 D8 4C 24 08 E8 9B 08 F4 FF A3 3C A9 8D 00 8B 17 6A 46 8B CF FF 52 04 89 44 24 10 DB 44 24 10 D8 4C 24 0C E8 7C 08 F4 FF'
            HEX @0x00668243 = '6A 4C 8B CF FF 10 89 44 24 10 DB 44 24 10 D8 4C 24 08 E8 E4 07 F4 FF A3 94 A9 8D 00 8B 17 6A 49 8B CF FF 52 04 89 44 24 10 DB 44 24 10 D8 4C 24 0C E8 C5 07 F4 FF'
            HEX @0x005A8A49 = 'C7 00 4C 00 00 00 DB 00 D8 0D 00 00 DD 02 DB 18 E9 00 E4 0B 00'
            HEX @0x005A8A53 = 4x0000001C
            HEX @0x00666E58 = 'E9 EC 1B F4 FF 90'
            HEX @0x00668237 = 'E8 02 08 F4 FF'
            HEX @0x00668103 = 'E8 36 09 F4 FF'
            HEX @0x00737555 = 'E9 D5 01 00 00 68 B4 00 00 00 DB 04 E4 D8 0D 67 45 23 01 DB 1C E4 FF 12 8B 0D BC E1 8D 00 A3 28 EE 85 00 8B 01 6A 14 DB 04 E4 D8 0D 67 45 23 01 DB 1C E4 E9 67 26 D0 FF 6A 1E DB 04 E4 D8 0D 67 45 23 01 DB 1C E4 FF 52 04 E9 44 18 F0 FF 68 BE 00 00 00 DB 04 E4 D8 0D 67 45 23 01 DB 1C E4 E9 B6 18 F0 FF'
            HEX @0x00737564 = 4x0000001C
            HEX @0x00737581 = 4x0000001C
            HEX @0x00737594 = 4x0000001C
            HEX @0x007375AD = 4x0000001C
            HEX @0x00439BDE = 'E9 77 D9 2F 00'
            HEX @0x00638DE2 = 'E9 A6 E7 0F 00'
            HEX @0x00638E6A = 'E9 34 E7 0F 00'
            HEX @0x007375B9 = '6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 FF 10 8B 8E 5C 03 00 00 89 86 E0 03 00 00 8B 11 6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 E9 66 F6 D9 FF 6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 FF 50 04 8B 0D BC E1 8D 00 8B 11 50 6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 E9 6B 0D F3 FF 6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 FF 52 04 8B 0D BC E1 8D 00 50 8B 01 6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 E9 E8 0D F3 FF'
            HEX @0x007375C0 = 4x0000001C
            HEX @0x007375DE = 4x0000001C
            HEX @0x007375F1 = 4x0000001C
            HEX @0x0073760B = 4x0000001C
            HEX @0x0073761E = 4x0000001C
            HEX @0x00737638 = 4x0000001C
            HEX @0x004D6C3C = 'E9 78 09 26 00 90 90 90 90 90'
            HEX @0x00668372 = 'E9 73 F2 0C 00'
            HEX @0x0066841C = 'E9 F6 F1 0C 00'
            HEX @0x00737644 = '6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 FF 12 8B 56 6C E9 12 01 F3 FF 6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 FF 10 8B 4E 6C E9 1C 01 F3 FF 8B 0D BC E1 8D 00 6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 E9 60 01 F3 FF 6A 10 DB 04 E4 D8 0D 00 00 FB 02 DB 1C E4 FF 12 8B 4E 6C E9 69 01 F3 FF'
            HEX @0x0073764B = 4x0000001C
            HEX @0x00737663 = 4x0000001C
            HEX @0x00737681 = 4x0000001C
            HEX @0x00737694 = 4x0000001C
            HEX @0x00667767 = 'E9 D8 FE 0C 00 90 90'
            HEX @0x00667789 = 'E9 CE FE 0C 00 90 90'
            HEX @0x006677E5 = 'E9 8A FE 0C 00 90'
            HEX @0x00667807 = 'E9 81 FE 0C 00 90 90'
            HEX @0x007376A5 = '68 2C 01 00 00 DB 04 E4 D8 0D 00 00 54 01 DB 1C E4 E9 28 14 FF FF 68 C8 00 00 00 DB 04 E4 D8 0D 00 00 54 01 DB 1C E4 E9 23 14 FF FF'
            HEX @0x007376AF = 4x0000001C
            HEX @0x007376C5 = 4x0000001C
            HEX @0x00728ADE = 'E9 C2 EB 00 00 FF 12 8B 0D BC E1 8D 00 8B F8 8B 01 E9 C7 EB 00 00'
            FLOAT @0x007D2B14 = FLOAT @SYSTEMPACK:INTERFACE:ScaleMenusX
            FLOAT @0x007D2B18 = FLOAT @SYSTEMPACK:INTERFACE:ScaleMenusY
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale == 1
            HEX @0x005A892A = 'EB 0C'
            HEX @0x005A8919 = 'DA 35 76 E3 42 00'
            HEX @0x005A8A5E = '81 7C E4 0C 00 03 00 00 0F 8D A9 FE FF FF D9 E8 E9 C5 FE FF FF'
            HEX @0x0071FE32 = 'E9 27 8C E8 FF'
        END
        IF BOOL @SYSTEMPACK:INTERFACE:ForceMenuScale
            HEX @0x004CF351 = '74 00'
        END
    #/patch

    #patch [InventoryItemNoteSizeX]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale < 1.0
            HEX @0x006672DA = INT @SYSTEMPACK:INTERFACE:InventoryItemNoteSizeX
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @0x005A8A29 = INT @SYSTEMPACK:INTERFACE:InventoryItemNoteSizeX
        END
    #/patch

    #patch [DialogBoxX]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale < 1.0
            HEX @0x0072AC77 = INT @SYSTEMPACK:INTERFACE:DialogBoxX
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @0x005A89BB = INT @SYSTEMPACK:INTERFACE:DialogBoxX
        END        
    #/patch

    #patch [DialogBoxY]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale < 1.0
            HEX @0x0072AC86 = INT @SYSTEMPACK:INTERFACE:DialogBoxY
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @0x005A89D1 = INT @SYSTEMPACK:INTERFACE:DialogBoxY
        END    
    #/patch

    #patch [No_Strafe_while_fall]
        IF INT @SYSTEMPACK:DEBUG:StrafeBug ==0
            HEX @0x007377F2 = 'E9 EA 03 00 00 8B 86 2C 01 00 00 3B 05 B0 BB 8D 00 75 10 8B 46 68 F6 80 CC 01 00 00 02 0F 85 94 D3 ED FF 8B 0D A0 CC 86 00 E9 4D D2 ED FF'
            HEX @0x00614A67 = 'E9 8B 2D 12 00 90'
            
            #assembler [GetIsFlying]
                CMP ECX,DWORD PTR DS:[8DBBB0h]
                JNE return
                MOV EAX,DWORD PTR SS:[EBP+68h]
                TEST BYTE PTR DS:[EAX+1CCh],02
                JNE 00613F39h
                return:
                CALL 00695820h
                JMP 00613A8Fh
            #/assembler
            JMP(0x00613A8A, GetIsFlying)
        END
    #/patch

    #patch [TRADE_VALUE_MULTIPLIER]
        HEX @0x00729136 = LIM(0.01, FLOAT @SYSTEMPACK:PARAMETERS:TRADE_VALUE_MULTIPLIER, 100.0)
        HEX @0x0072913A = 'E9 88 E9 00 00'
        HEX @0x00737AC7 = '8B 82 0C 01 00 00 3D 00 00 00 3F 7C 0A E8 B7 0E FF FF E9 61 16 FF FF D9 E8 D8 A2 0C 01 00 00 D9 1D F0 FF 9D 00 EB E6'
        HEX @0x00737AE8 = 4x00000030
        HEX @TRADE_VALUE_MULTIPLIER = 4x00000030
        TRADE_VALUE_MULTIPLIER = FLOAT 0.5
        HEX @0x00727672 = 4x00000030
        HEX @0x00727706 = 4x00000030
        HEX @0x00727778 = 4x00000030
        HEX @0x007278A4 = 4x00000030
        HEX @0x007280E4 = 4x00000030
        HEX @0x0072817F = 4x00000030
        HEX @0x00728231 = 4x00000030
        HEX @0x007283A1 = 4x00000030        
    #/patch

    #patch [Disable_Save_Menu_When_Die]
        HEX @0x0042935A = 'E9 C1 E4 30 00'
        HEX @0x00737820 = 'E8 2B 0A F8 FF 85 C0 0F 85 3D 1B CF FF A1 B0 BB 8D 00 8B 88 B4 09 00 00 E8 33 D6 EE FF 85 C0 0F 85 25 1B CF FF B9 01 00 00 00 E9 1D 1B CF FF'
    #/patch

    #patch [Disable_Map_Use]
        HEX @0x0065EFEF = 'E9 5B 88 0D 00'
        HEX @0x0073784F = 'E8 DC 71 F6 FF 85 C0 0F 85 90 78 F2 FF 8B 0D B0 BB 8D 00 E8 D9 08 F8 FF 83 F8 05 0F 84 7C 78 F2 FF 83 F8 07 0F 84 73 78 F2 FF 83 F8 08 0F 84 6A 78 F2 FF 83 F8 09 0F 84 61 78 F2 FF 83 F8 0A 0F 84 58 78 F2 FF 83 F8 17 0F 84 4F 78 F2 FF E9 5A 77 F2 FF'
    #/patch

    #patch [Allow_Throw_Items]
        HEX @0x00617ACD = '0F 84 21 02 00 00 8B 8B A8 00 00 00 3B CD 0F 84 13 02 00 00'
        HEX @0x00617C41 = 'EB 3D 90 90 8A 90 00 01 00 00 80 E2 FE D9 5C 24 2C D9 44 24 18 80 F2 01 88 90 00 01 00 00 D9 5C 24 30 D9 44 24 1C 8D 44 24 2C D9 5C 24 34 50 8B CE E8 29 BB FB FF 8B C8 E8 02 D7 F7 FF EB 74 D9 44 E4 14 D8 8C E4 D8 00 00 00 8A 90 00 01 00 00 80 E2 FE D9 5C 24 2C D9 44 24 18 D8 8C E4 D8 00 00 00 80 F2 01 88 90 00 01 00 00 D9 5C 24 30 D9 44 24 1C D8 8C E4 D8 00 00 00 EB AA'
        HEX @0x00613BC0 = 'EB 12'
        IF INT @SYSTEMPACK:PARAMETERS:ThrowFlag == 0
            HEX @0x0066F401 = '00 00'
        END
    #/patch
    
    #patch [Rotate_Items]
        IF BOOL @SYSTEMPACK:PARAMETERS:Animated_Inventory
            HEX @0x0067303D = 'E9 1F 49 0C 00 90'
            HEX @0x007378A2 = 'D8 1D A4 08 7D 00 DF E0 F6 C4 40 0F 85 A0 B7 F3 FF 80 BF 38 01 00 00 40 74 4D 80 BF 39 01 00 00 02 74 5A 80 BF 38 01 00 00 02 0F 84 63 00 00 00 80 BF 38 01 00 00 04 0F 84 6C 00 00 00 68 00 00 00 40 68 00 00 80 3F 68 00 00 F0 42 68 00 00 00 00 8D 4C E4 2C E8 24 13 CD FF 50 8B CF E8 FC 67 EB FF E9 4A B7 F3 FF 68 00 00 00 C0 68 00 00 F0 42 68 00 00 0C 42 68 00 00 00 00 EB D4 68 00 00 00 40 68 00 00 96 42 68 00 00 70 41 68 00 00 00 00 EB BE 68 00 00 00 C0 68 00 00 00 00 68 00 00 00 00 68 00 00 80 3F EB A8 68 00 00 00 C0 68 00 00 00 00 68 00 00 00 00 68 00 00 80 3F EB 92 81 BF BC 00 00 00 00 00 80 3F 74 0E 81 7F 64 00 00 80 3F 74 05 E9 27 FF FF FF 6A 01 8B CF E8 DC AB F3 FF 83 87 BC 00 00 00 01 83 47 64 01 E9 BF B6 F3 FF'
            HEX @0x007378DF = 'E9 F9 00 00 00'
            HEX @0x007379DD = '80 BF 39 01 00 00 12 0F 84 35 FF FF FF 68 00 00 00 40 E9 F0 FE FF FF'
            HEX @0x0073981D = 'D9 44 E4 08 D8 0D 90 26 7D 00 D8 0D EC F1 8C 00 D9 5C E4 08 E9 CA 48 EB FF'
            HEX @0x007378FF = 'E8 19 1F 00 00'
        END
    #/patch
    
    #patch [Inventory_Camera_Bugfix]
        HEX @0x00617CBD = 'C6 05 10 00 FC 02 01 E9 67 79 0A 00 C6 05 10 00 FC 02 00 E9 0B 18 E8 FF 80 3D 10 00 FC 02 00 0F 84 5E 81 FF FF C2 08 00'
        HEX @0x00617CBF = 4x00000028
        HEX @0x00617CCB = 4x00000028
        HEX @0x00617CD7 = 4x00000028
        HEX @0x006BB260 = 'E8 58 CA F5 FF'
        HEX @0x006BB335 = 'E8 8F C9 F5 FF'
        HEX @0x006965B1 = 'E8 1F 17 F8 FF'
        HEX @0x006A946F = 'E8 61 E8 F6 FF'
    #/patch

    #patch [Spell_Name_Time_Fix]
        HEX @0x0065FC84 = 'E9 0B 7D 0D 00'
        HEX @0x00737994 = 'C7 04 E4 00 00 00 00 68 00 80 BB 44 50 E8 9A 6A FC FF E9 DE 82 F2 FF'
    #/patch

    #patch [Highlight]
        IF INT @SYSTEMPACK:PARAMETERS:HighlightMeleeFocus == 0
            HEX @0x006D479B = 'E9 89 00 00 00 90'
        END
        IF INT @SYSTEMPACK:PARAMETERS:HighlightInteractFocus == 0
            HEX @0x006D4704 = 'E9 20 01 00 00'
        END
        IF INT @SYSTEMPACK:PARAMETERS:HighlightInteractNoFocus == 0
            HEX @0x005AFF6C = 'E9 BA 00 00 00 90'
        END
    #/patch

    #patch [ITM_FLAG_DROPPED]
        HEX @0x006A1272 = 'E9 34 67 09 00'
        HEX @0x007379AB = 'E8 10 A6 F3 FF 85 C0 74 0C 68 00 00 00 40 8B CE E8 20 A6 F3 FF 39 1D B0 BB 8D 00 0F 85 BB 98 F6 FF 68 00 00 00 01 8B CE E8 28 A6 F3 FF E9 AA 98 F6 FF'
    #/patch
    
    #patch [No_interrupt_fight_animation]
        HEX @0x00738E70 = 'E9 F3 05 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90'
        HEX @0x00730967 = 'E9 E9 05 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90'
        HEX @0x00730967 = 'E9 E9 05 00 00 83 EC 10 53 56 8B F1 8B 9E B4 09 00 00 85 DB 89 5C 24 08 0F 84 34 03 00 00 8B 83 4C 01 00 00 83 F8 05 74 0E 83 F8 06 74 09 6A 00 8B CB E8 D2 D2 EF FF 57 8B CB E8 1A 77 EF FF 8B BE 54 09 00 00 85 FF 74 50 8B CF E8 09 01 D4 FF 85 C0 74 1A 8B CF E8 FE 00 D4 FF 8B 40 28 83 B8 5C 03 00 00 03 75 07 8B CF E8 7B 02 D4 FF 8B 86 08 02 00 00 85 C0 7C 05 83 F8 08 7C 0A C7 86 08 02 00 00 00 00 00 00 83 BE 08 02 00 00 07 74 09 6A 01 8B CF E8 B0 FB D3 FF 8B 8E 9C 09 00 00 85 C9 0F 84 86 00 00 00 8B 44 24 20 85 C0 74 2A 8B 86 AC 07 00 00 8B D0 81 E2 80 3F 00 00 C1 E2 0D 85 D2 7F 69 25 00 80 00 00 C1 E0 0D 33 D2 85 C0 0F 9F C2 8B C2 85 C0 74 54 8B 01 56 FF 90 CC 00 00 00 8B BE B0 00 00 00 85 FF 74 2A 8B 17 8B CF FF 12 50 68 18 87 8D 00 E8 CC F6 D3 FF 83 C4 08 85 C0 74 12 8B 86 9C 09 00 00 85 C0 74 08 8B 17 50 8B CF FF 52 3C 8B 8E B4 09 00 00 6A 00 C7 86 9C 09 00 00 00 00 00 00 E8 6C BC EE FF 8B 86 A0 09 00 00 85 C0 74 13 6A 00 8B CE E8 C9 5B F7 FF C7 86 A4 09 00 00 FF FF FF FF 8B BE B8 00 00 00 85 FF 0F 84 DA 00 00 00 8B 07 8B CF FF 10 50 68 10 3B 87 00 E8 60 F6 D3 FF 83 C4 08 85 C0 75 30 68 E8 03 00 00 8B CE E8 ED A1 F5 FF 8B BE B8 00 00 00 85 FF 74 18 8B 17 8B CF FF 12 50 68 10 3B 87 00 E8 32 F6 D3 FF 83 C4 08 85 C0 75 02 33 FF 68 E8 03 00 00 6A 02 8B CF E8 AB 46 E3 FF 8B BE B8 00 00 00 85 FF C7 44 24 10 00 00 80 3F C7 44 24 14 00 00 80 3F C7 44 24 18 00 00 80 3F 74 18 8B 07 8B CF FF 10 50 68 10 3B 87 00 E8 E8 F5 D3 FF 83 C4 08 85 C0 75 30 68 E8 03 00 00 8B CE E8 75 A1 F5 FF 8B BE B8 00 00 00 85 FF 74 18 8B 17 8B CF FF 12 50 68 10 3B 87 00 E8 BA F5 D3 FF 83 C4 08 85 C0 75 02 33 FF 8B 44 24 10 8B 4C 24 14 8B 54 24 18 81 C7 28 01 00 00 89 07 89 4F 04 89 57 08 8B 86 B8 00 00 00 85 C0 74 54 50 E8 07 A1 F8 FF 83 C4 04 85 C0 75 1B 68 E8 03 00 00 8B CE E8 14 A1 F5 FF 8B 86 B8 00 00 00 50 E8 E8 A0 F8 FF 83 C4 04 68 F8 3B 87 00 8B C8 E8 A9 33 E3 FF 85 C0 74 1C 8B 40 08 50 E8 FC A0 F8 FF 83 C4 04 85 C0 74 0C 68 90 B9 8D 00 8B C8 E8 C9 65 E5 FF 8B CE E8 02 2A F0 FF 8B 86 94 07 00 00 33 FF 85 C0 7E 33 8D 9E 8C 07 00 00 57 8B CB E8 F8 80 D9 FF 8B 00 8B 0D 4C EE 8C 00 89 44 24 20 8B 11 8D 44 24 20 50 FF 52 34 8B 86 94 07 00 00 47 3B F8 7C D7 8B 5C 24 0C C7 86 98 07 00 00 00 00 00 00 90 8D 64 24 00 8B CE E8 3D A1 F6 FF 85 C0 74 F5 83 C9 FF 33 C0 BF 80 E5 84 00 F2 AE F7 D1 49 51 8B 8E F0 04 00 00 8D 96 E8 04 00 00 68 80 E5 84 00 51 50 8B CA E8 EF 91 CD FF 85 C0 5F 74 07 8B CE E8 03 31 F0 FF 8B CE E8 7C F9 01 00 8B CB E8 F5 C6 DC FF 8B 8B 50 01 00 00 B8 01 00 00 00 3B C8 EB 0F 50 50 8B CE 89 83 50 01 00 00 E8 E7 C8 01 00 5E 5B 83 C4 10 C2 04 00 CC CC'
        HEX @0x00730CC3 = '89 CB E9 AB 87 00 00 80 B9 AC 07 00 00 0E 74 F0 80 B9 AC 07 00 00 10 74 E7 80 B9 AC 07 00 00 09 74 DE 80 B9 AC 07 00 00 1A 0F 84 D1 FF FF FF 83 B9 08 02 00 00 07 74 05 E9 68 87 00 00 8B 5C 24 64 6A 01 8B CB E8 5F FC FF FF E9 63 87 00 00'
        HEX @0x00738E63 = '53 56 89 4C 24 64 39 0D B0 BB 8D 00 0F 85 F3 05 00 00 E9 50 7E FF FF'
        HEX @0x00744099 = '39 3D B0 BB 8D 00 0F 85 FF 02 00 00 80 BF AC 07 00 00 1A 0F 84 0B 0B 00 00 80 BF AC 07 00 00 0E 0F 84 FE 0A 00 00 80 BF AC 07 00 00 10 0F 84 F1 0A 00 00 80 BF AC 07 00 00 09 0F 84 E4 0A 00 00 83 BF 08 02 00 00 00 0F 84 BE 02 00 00 E9 EC 06 00 00'
        IF INT @SYSTEMPACK:PARAMETERS:Fight_ANI_Interrupt == 0
            HEX @0x007440E6 = '83 BF 08 02 00 00 07 74 05 E9 E3 06 00 00 8B 87 B4 09 00 00 89 C1 6A 01 E8 3D 31 EE FF 8B 00 6A 01 68 24 41 74 00 6A 00 8D 48 24 E8 3A 36 D2 FF 85 C0 0F 8D B9 06 00 00 E9 9A 0A 00 00 CC 4D 41 47 00 CC CC'
        END
        IF INT @SYSTEMPACK:PARAMETERS:Fight_ANI_Interrupt == 1
            HEX @0x00738E63 = '53 56 89 4C 24 64 39 0D B0 BB 8D 00 0F 85 F3 05 00 00 80 B9 AC 07 00 00 0E 74 16 E9 E5 05 00 00 90 90 74 0D 83 B9 08 02 00 00 00 0F 84 D4 05 00 00 89 CB E9 DA 05 00 00'
            HEX @0x007440A5 = '80 BF AC 07 00 00 0E 0F 84 0B 0B 00 00 E9 ED 02 00 00 90 90'
        END
    #/patch

    #patch [Unlock FPS]
        HEX @0x005CE58B = 'EB 0E'
    #/patch
    
    #patch [Hide_Focus_on_EMPTY_DEAD_NPC]
        IF BOOL @SYSTEMPACK:PARAMETERS:HideFocus
            HEX @0x0069111E = 'E9 D1 68 0A 00 90'
            HEX @0x007379F4 = '81 F9 00 00 80 00 74 0B 89 F1 E8 7D BA F5 FF 85 C0 75 0B 8B 0D 48 A6 8D 00 E9 12 97 F5 FF 8D 8E 50 05 00 00 81 39 04 D0 7D 00 75 E7 E8 76 14 00 00 85 C0 74 DE E9 B7 97 F5 FF'
            HEX @0x00738E9B = '83 EC 18 53 55 56 8B F1 57 33 DB 33 FF 8D 8E 18 01 00 00 8D 86 A8 00 00 00 89 74 24 24 89 7C 24 1C 89 4C 24 20 89 44 24 14 8D A4 24 00 00 00 00 3B FB 0F 8C FF 00 00 00 83 FF 09 0F 8D F6 00 00 00 8B 44 24 14 8B 00 33 D2 3B C3 89 54 24 18 74 0C 8B 40 08 42 3B C3 75 F8 89 54 24 18 39 9E 9C 00 00 00 75 07 33 C0 E9 C5 00 00 00 8B 01 33 ED 3B C3 89 5C 24 10 0F 8E B1 00 00 00 3B E8 72 0A BE 00 16 83 00 E9 8B 00 00 00 8B 01 3B C5 8D 71 F8 77 05 E8 9A D3 03 00 8B 46 04 3B C3 74 5A 8A 40 FF 3A C3 74 53 3C FF 74 4F 8B 7E 08 83 FF FD 76 05 E8 4F D1 03 00 8B 46 04 3B C3 74 1F 8A 48 FF 3A CB 74 18 80 F9 FF 74 13 3B FB 75 23 FE C9 88 48 FF 53 8B CE E8 5A A3 CC FF EB 1C 3B FB 75 0B 3B C3 74 14 89 5E 08 88 18 EB 0D 39 7E 0C 73 08 8B CE 57 E8 9C A3 CC FF 8B 46 04 3B C3 74 04 C6 40 FF FF 8B 76 04 8B 4C 24 20 8B 7C 24 1C 8B 54 24 18 03 F5 80 3E 3A 75 04 FF 44 24 10 8B 01 45 3B E8 0F 8C 55 FF FF FF 8B 74 24 24 8B 44 24 10 03 C2 3B C3 7F 39 8B 6C 24 14 47 83 FF 02 75 07 47 83 C5 0C 83 C1 14 83 C5 0C 83 C1 14 83 FF 09 89 7C 24 1C 89 6C 24 14 89 4C 24 20 0F 8C CD FE FF FF 5F 5E'
            HEX @0x00739000 = '5D B8 01 00 00 00 5B 83 C4 18 C3 5F 5E 5D 33 C0 5B 83 C4 18 C3'
        END
    #/patch

    #patch [Disable using of weapons when the hero uses an anvil]
        HEX @0x006A7A60 = 'E8 C9 FF 08 00'
        HEX @0x00737A2E = '80 B9 AC 07 00 00 10 74 05 E9 C4 0A F7 FF B8 01 00 00 00 C2 04 00'
        HEX @0x00611B1D = 'EB 1D'
    #/patch

    #patch [Drop_Throw_Item_Fix]
        HEX @0x006ADEB7 = 'E8 88 9B 08 00'
        HEX @0x00737A44 = '81 FA 00 80 01 00 0F 85 C0 DA EE FF B8 01 00 00 00 C2 04 00'
    #/patch

    #patch [Auto_Scroll_Time]
        HEX @0x006365AC = '00 00 7A 44'
    #/patch
    
    #patch [Block the hero move in the menu]
        HEX @0x00425D2C = 'E8 71 1D 31 00'
        HEX @0x00737AA2 = '81 7C E4 10 6A 3F 47 00 74 0E 81 7C E4 1C 6D F9 4C 00 0F 85 96 D1 F5 FF C7 44 E4 04 01 00 00 00 E9 89 D1 F5 FF'
    #/patch
    
    #patch [Turn_Attack_on_Run]
        HEX @0x006ABF91 = '0F 85 DC BA 08 00 8B 45 4C 85 C0 0F 84 D1 BA 08 00'
        HEX @0x00737A73 = '39 35 B0 BB 8D 00 0F 85 07 46 F7 FF 8B 8E B4 09 00 00 6A 00 E8 74 CD ED FF E9 F5 45 F7 FF'
    #/patch

    #patch [Doubling_Items]
        HEX @0x0067F770 = 'E9 75 9C 0B 00'
        HEX @0x007393EA = '8B 01 FF 50 78 39 35 B0 BB 8D 00 0F 84 7E 63 F4 FF E9 75 63 F4 FF'
    #/patch
    
    #patch [Underwater_Take_Vob]
        HEX @0x00615A35 = 'E9 57 20 12 00'
        HEX @0x00737A91 = 'E8 6A BB ED FF 89 F1 E8 A3 AD ED FF E9 98 DF ED FF'
    #/patch
    
    #patch [Disabled_Mouse_Camera_Fix]
        HEX @0x0049CDF0 = '0F 84 00 00'
    #/patch

    #patch [Arrow_PFX]
        HEX @0x00618B00 = '00 00'
    #/patch

    #patch [SAVE MENU CONFIRM LMB]
        HEX @0x0074084E = 'E9 F8 02 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90'
        HEX @0x004D46AA = 'E9 A4 C1 26 00 90'
        HEX @0x00740853 = '83 3D B8 CC 86 00 01 74 0B 81 FF D3 00 00 00 E9 49 3E D9 FF 66 BF 1C 00 EB EF'
        HEX @0x004D4683 = 'E9 51 C2 26 00'
        HEX @0x007408D9 = 'E8 F2 29 CC FF C7 05 B8 CC 86 00 00 00 00 00 E9 9B 3D D9 FF'
    #/patch

    #patch [ONE_BUTTON_CONTROL]
        IF BOOL @SYSTEMPACK:PARAMETERS:Gothic2_Control
            HEX @0x0066E756 = '6A 0B E8 F3 48 E5 FF 85 C0 0F 84 E2 00 00 00 EB 3A 90 90 90 90'
            HEX @0x0066E7A3 = '0F 84 9E 00 00 00'
            HEX @0x0066EF9D = 'E9 0A 19 0D 00 90'
            HEX @0x007408AC = '81 FE 02 08 00 00 0F 84 2E E8 F2 FF 8B 0D A0 CC 86 00 56 6A 05 E8 8A 27 D8 FF 85 C0 0F 85 18 E8 F2 FF 8B 0D A0 CC 86 00 E9 CA E6 F2 FF'
            HEX @0x00612AC8 = 'C6 05 C0 FF 9D 00 01 90'
            HEX @0x00612ACA = 4x00000034
            HEX @0x0066ECB5 = '0F 84 B9 1D 0D 00'
            HEX @0x00740947 = '81 F9 02 08 00 00 0F 84 68 E3 F2 FF 8B 0D A0 CC 86 00 FF 34 E4 6A 05 E8 ED 26 D8 FF 85 C0 0F 85 50 E3 F2 FF 8B 0D A0 CC 86 00 FF 34 E4 6A 0B E8 D5 26 D8 FF 85 C0 0F 85 38 E3 F2 FF E9 15 E5 F2 FF'
            HEX @0x00740A74 = '8B 44 24 14 85 C0 0F 84 1D E4 F2 FF E9 C2 FE FF FF'
            HEX @0x0066A16C = '0F 84 16 68 0D 00'
            HEX @0x00740988 = '81 FA 02 08 00 00 0F 84 DE 97 F2 FF 8B 0D A0 CC 86 00 FF 34 E4 6A 05 E8 AC 26 D8 FF 85 C0 0F 85 C6 97 F2 FF 8B 0D A0 CC 86 00 FF 34 E4 6A 0B E8 94 26 D8 FF 85 C0 0F 85 AE 97 F2 FF E9 9C 98 F2 FF'
            HEX @0x0066B06A = '0F 84 E0 CA 0C 00'
            HEX @0x00737B50 = '80 3D 34 00 94 04 00 75 1A E9 6B 8E 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 C6 05 34 00 94 04 00 E9 60 36 F3 FF'
            HEX @0x007409C9 = '81 FF 02 08 00 00 0F 84 9B A6 F2 FF 8B 0D A0 CC 86 00 FF 34 E4 6A 05 E8 6B 26 D8 FF 85 C0 0F 85 83 A6 F2 FF 8B 0D A0 CC 86 00 FF 34 E4 6A 0B E8 53 26 D8 FF 85 C0 0F 85 6B A6 F2 FF E9 D5 A7 F2 FF'
            HEX @0x00737B52 = 4x00000034
            HEX @0x00737B75 = 4x00000034
            HEX @0x00729A0A = 'E9 FB 6F 01 00'
            HEX @0x00739015 = '81 FF 02 08 00 00 74 10 83 FF 38 74 41 8B 0D A0 CC 86 00 E9 E3 09 FF FF 83 BD 0C 01 00 00 03 0F 84 0C 0B FF FF 83 BD 0C 01 00 00 02 0F 84 9E 0A FF FF 83 BD 0C 01 00 00 01 0F 84 F2 0A FF FF 83 BD 0C 01 00 00 00 0F 84 84 0A FF FF EB BF 83 BD 0C 01 00 00 03 74 1D 83 BD 0C 01 00 00 02 74 1B 83 BD 0C 01 00 00 01 74 0B 83 BD 0C 01 00 00 00 74 09 EB 99 89 E9 E9 07 0B FF FF 89 E9 E9 9F 0A FF FF'
            HEX @0x00740A0A = '81 FF 02 08 00 00 0F 84 17 86 FF FF 8B 0D A0 CC 86 00 FF 34 E4 6A 05 E8 2A 26 D8 FF 85 C0 0F 85 FF 85 FF FF 8B 0D A0 CC 86 00 FF 34 E4 6A 0B E8 12 26 D8 FF 85 C0 0F 85 1D 86 FF FF E9 D7 85 FF FF'
            HEX @0x0066A7A6 = 'E9 D4 D3 0C 00 90'
            HEX @0x00737B7F = '80 3D 34 00 05 06 00 75 17 E9 BE 8E 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 C6 05 34 00 05 06 00 8B 0D A0 CC 86 00 E9 FB 2B F3 FF'
            HEX @0x00740A4B = '81 FF 02 08 00 00 0F 84 B6 9D F2 FF 8B 0D A0 CC 86 00 FF 34 E4 6A 05 E8 E9 25 D8 FF 85 C0 0F 85 9E 9D F2 FF E9 32 71 FF FF'
            HEX @0x00737B81 = 4x00000034
            HEX @0x00737BA1 = 4x00000034
            HEX @0x0066A827 = '00 00'
            HEX @0x00611F1F = '89 4C E4 18 8B 06 53 6A 04 89 44 24 1C FF 52 04 E9 7D 5C 12 00'
            HEX @0x00737BB1 = 'E8 A2 F9 03 00 83 3D C0 CC 86 00 01 0F 85 D4 14 00 00 C7 44 E4 1C 00 00 00 00 E9 64 A3 ED FF'
            HEX @0x00739097 = '85 C0 0F 84 95 8E ED FF 83 BE D4 01 00 00 00 0F 85 88 8E ED FF 31 C0 89 44 E4 1C E9 7D 8E ED FF'
            HEX @0x00611E3C = 'B8 01 00 00 00'
            HEX @0x00611E82 = 'E9 06 73 12 00'
            HEX @0x007390B7 = '83 7C E4 08 01 0F 84 7D 8E ED FF 83 3D C0 CC 86 00 01 0F 84 70 8E ED FF 83 BE D4 01 00 00 00 0F 85 63 8E ED FF C7 04 E4 01 00 00 00 83 BE E8 01 00 00 FF 0F 85 4F 8E ED FF C7 04 E4 00 00 00 00 E9 43 8E ED FF C7 04 E4 01 00 00 00 83 BE DC 01 00 00 01 74 17 83 BE D4 01 00 00 01 74 0E 83 BE E8 01 00 00 FF 74 05 E9 1C 8E ED FF C7 04 E4 00 00 00 00 C7 44 E4 04 00 00 00 00 E9 08 8E ED FF C7 04 E4 01 00 00 00 83 BE DC 01 00 00 00 0F 84 2B 00 00 00 8A 8E DC 01 00 00 02 8E D4 01 00 00 80 F9 02 74 0C C7 04 E4 00 00 00 00 E9 D7 8D ED FF 83 BE E8 01 00 00 FF 74 EB E9 C9 8D ED FF 83 BE D4 01 00 00 01 74 DD 83 BE E8 01 00 00 FF 74 D4 E9 B2 8D ED FF 81 3E E4 D9 7D 00 0F 84 1E FF FF FF 81 3E FC D3 7D 00 0F 84 12 FF FF FF 81 3E B4 DD 7D 00 0F 85 2E 00 00 00 83 BE 0C 01 00 00 05 0F 85 3E FF FF FF 8B 8E 08 01 00 00 81 39 57 48 45 45 0F 85 2C FF FF FF 80 79 04 4C 0F 85 22 FF FF FF E9 58 FF FF FF 81 3E E4 D2 7D 00 0F 84 4C FF FF FF 81 3E AC D8 7D 00 0F 85 12 00 00 00 83 BE 0C 01 00 00 03 0F 84 F8 FE FF FF E9 2E FF FF FF 81 3E 7C D6 7D 00 75 12 83 BE 0C 01 00 00 03 0F 84 DE FE FF FF E9 14 FF FF FF E9 D4 FE FF FF'
            HEX @0x00613804 = '00'
            HEX @0x006130F0 = 'E9 15 01 00 00 90'
            HEX @0x00613220 = '00 00'
            HEX @0x00613808 = 'E9 A2 CA 12 00 90'
            HEX @0x007402AF = '83 3D BC 88 8D 00 0F 74 0B 8B 96 14 10 00 00 E9 4B 35 ED FF C6 05 F0 FF 9D 00 01 E9 E8 35 ED FF E8 7C 8A CE FF 80 3D F0 FF 9D 00 01 0F 85 09 92 CE FF C6 05 F0 FF 9D 00 00 E9 03 92 CE FF'
            HEX @0x004294E5 = 'E9 E5 6D 31 00'
            HEX @0x007402C5 = 4x00000080
            HEX @0x007402D6 = 4x00000080
            HEX @0x007402E3 = 4x00000080
        END
    #/patch

    #patch [MOUSE_BUFFER_SIZE 50]
        HEX @0x004C7C64 = '31 C0 31 C0'
    #/patch

    #patch [FindNextFightAction_Workaround_1]
        HEX @0x00748FCB = 'E9 30 04 FF FF'
        HEX @0x00739400 = '83 3F 04 0F 85 88 FC 00 00 80 BE A6 07 00 00 20 74 39 C7 07 06 00 00 00 E9 74 FC 00 00 C7 07 08 00 00 00 E9 69 FC 00 00'
        HEX @0x0073944B = '80 BE 08 02 00 00 01 74 C9 EB BC'
    #/patch

    #patch [Text Color]
        HEX @0x00758957 = '90 90 B9 9F 9F 9F FF BA FF FF FF FF'
        HEX @0x006899C0 = 'C7 05 48 B5 8D 00 FF FF FF FF C3 90'
        HEX @0x006899E0 = 'C7 05 78 B4 8D 00 00 FF FF FF C3 90'
        HEX @0x00689A40 = 'C7 05 80 B4 8D 00 00 3F FF FF C3 90 90 90'
        HEX @0x0075895A = INT @SYSTEMPACK:INTERFACE:Color_DialogChoice_Inactive
        HEX @0x0075895F = INT @SYSTEMPACK:INTERFACE:Color_DialogChoice_Active
        HEX @0x006899C6 = INT @SYSTEMPACK:INTERFACE:Color_Talk_Hero
        HEX @0x006899E6 = INT @SYSTEMPACK:INTERFACE:Color_Talk_NPC
        HEX @0x00689A46 = INT @SYSTEMPACK:INTERFACE:Color_Noise
    #/patch
    
    #patch [Close_Inventory_In_NPC]
        HEX @0x00737A37 = 'E9 74 19 00 00'
        HEX @0x007393B0 = '39 35 B0 BB 8D 00 0F 85 44 F1 F6 FF 83 3D 24 BC 8D 00 01 75 0C E8 D6 26 F8 FF 89 F1 E9 2F F1 F6 FF 83 3D 24 BC 8D 00 02 0F 85 22 F1 F6 FF E8 7D 24 F8 FF 89 F1 E9 16 F1 F6 FF'
    #/patch

    #patch [Show_FPS]
        IF BOOL @SYSTEMPACK:DEBUG:Show_FPS_Counter
            HEX @0x0042605A = 'E9 40 33 31 00'
            HEX @0x0073939F = 'A3 BC A6 8D 00 C6 80 A4 00 00 00 01 E9 AF CC CE FF'
        END
    #/patch

    #patch [Items_Insert_Bug]
        HEX @0x0068E08E = 'E8 83 1E 0B 00'
        HEX @0x0073FF11 = 'E9 FC 08 00 00 64 A1 00 00 00 00 6A FF 68 B8 F8 7B 00 50 64 89 25 00 00 00 00 83 EC 14 53 55 56 8B 74 24 30 33 DB 3B F3 8B E9 75 16 5E 5D 33 C0 5B 8B 4C 24 14 64 89 0D 00 00 00 00 83 C4 20 C2 04 00 8B CE E8 06 A2 E4 FF 8D 48 04 A1 24 B5 8D 00 3B C3 75 05 B8 A8 08 7D 00 8B 15 28 B5 8D 00 57 52 50 8B 41 08 50 53 E8 F2 9E CC FF 85 C0 0F 85 A8 00 00 00 8A 4C 24 34 88 4C 24 14 53 8D 4C 24 18 E8 38 33 CC FF 83 C9 FF 33 C0 BF 90 CE 84 00 F2 AE F7 D1 49 51 68 90 CE 84 00 8D 4C 24 1C E8 5A 30 CC FF BF E8 06 7D 00 89 7C 24 10 8B 0D BC A6 8D 00 8B 01 8D 54 24 10 52 68 81 00 00 00 89 5C 24 34 FF 90 8C 00 00 00 8B C8 E8 AE 61 F9 FF 8B F0 8B 44 24 18 3B C3 C7 44 24 2C FF FF FF FF 89 7C 24 10 74 28 8A 48 FF 48 3A CB 74 17'
        HEX @0x00740000 = '80 F9 FF 74 12 FE C9 88 08 89 5C 24 18 89 5C 24 1C 89 5C 24 20 EB 1A 50 E8 93 EB E0 FF 83 C4 04 89 5C 24 18 89 5C 24 1C 89 5C 24 20 EB 03 FF 46 04 8B BE A8 00 00 00 3B FB 74 23 8B 17 8B CF FF 12 3B C3 74 19 90 3D 28 C5 8D 00 74 09 8B 40 3C 3B C3 75 F2 EB 08 8B 07 56 8B CF FF 50 70 8B 95 50 05 00 00 8D 8D 50 05 00 00 56 81 7A 30 D0 C7 66 00 74 32 FF 52 30 8B 4E 04 49 8B F8 8B C1 3B C3 89 4E 04 7F 09 8B 06 6A 01 8B CE FF 50 0C 8B 4C 24 24 8B C7 5F 5E 5D 5B 64 89 0D 00 00 00 00 83 C4 20 C2 04 00 E8 02 00 00 00 EB CA A3 C0 FF 9D 00 89 0D C4 FF 9D 00 89 15 C8 FF 9D 00 E8 3D 03 F3 FF A1 C0 FF 9D 00 8B 0D C4 FF 9D 00 8B 15 C8 FF 9D 00 E9 F7 C6 F2 FF'
        HEX @0x007400AE = 4x00000040
        HEX @0x007400C4 = 4x00000040
        HEX @0x007400B4 = 4x00000044
        HEX @0x007400CA = 4x00000044
        HEX @0x007400BA = 4x00000048
        HEX @0x007400D0 = 4x00000048
    #/patch
    
    #patch [F6_Windowed_FreeLook]
        HEX @0x00479E99 = '75 00'
    #/patch

    #patch [JUMP_ANIM_Bug (s_ledgeCache?)]
        HEX @0x004FCB55 = '68 C8 00 00 00 EB 06 90 90 90 90 EB F3'
        HEX @0x004FCB56 = INT @SYSTEMPACK:DEBUG:Cache_Timeout
    #/patch

    #patch [EV_Parade_fix]
        HEX @0x006AC956 = 'E9 AA 00 00 00 90'
    #/patch
    
    #patch [Hit_Check_Angle]
        HEX @0x0074010C = '8B 86 2C 01 00 00 D9 40 48 D9 1D 24 FD 9D 00 D9 40 58 D9 1D 28 FD 9D 00 D9 40 68 D9 1D 2C FD 9D 00 68 20 FD 9D 00 68 30 FD 9D 00 68 24 FD 9D 00 89 E9 E8 BD BB 00 00 D9 05 30 FD 9D 00 E8 0A 74 03 00 99 33 C2 2B C2 83 F8 5A 0F 8F B2 77 EE FF D9 83 A8 01 00 00 E9 51 77 EE FF'
        HEX @0x006278B2 = 'E9 55 88 11 00 90'
        HEX @0x00740117 = 4x00000054
        HEX @0x00740120 = 4x00000058
        HEX @0x00740129 = 4x0000005C
        HEX @0x0074012E = 4x00000050
        HEX @0x00740133 = 4x00000060
        HEX @0x00740138 = 4x00000054
        HEX @0x00740145 = 4x00000060
    #/patch

    #patch [Parade_fix]
        IF BOOL @SYSTEMPACK:PARAMETERS:Gothic2_Control
            HEX @0x0062789F = '68 E1 00 74 00 6A 00 8D 48 24 E9 39 88 11 00'
            HEX @0x007400D9 = '48 50 41 52 41 44 45 00 48 4A 55 4D 50 00 E8 64 76 D2 FF 85 C0 7D 1C 8B 07 6A 01 68 D9 00 74 00 6A 00 8D 48 24 E8 4D 76 D2 FF 85 C0 7D 05 E9 02 78 EE FF'
        END
        HEX @0x0074015C = '89 E9 E8 2D E9 F5 FF 85 C0 74 3B 8B 8E 2C 01 00 00 E8 1E E9 F5 FF 85 C0 75 2C 8B 07 6A 01 68 72 42 83 00 6A 00 8D 48 24 E8 C7 75 D2 FF 83 F8 FF 75 14 8B 8E 2C 01 00 00 E8 87 56 F5 FF 83 F8 01 0F 84 6C 77 EE FF 8B 07 6A 01 68 72 42 83 00 6A 00 8D 48 24 E8 9B 75 D2 FF 83 F8 FF 74 15 89 E9 E8 5F 56 F5 FF 83 F8 03 74 09 83 F8 04 0F 85 3F 77 EE FF D9 83 A8 01 00 00 E9 DE 76 EE FF'
        HEX @0x0074019C = '0F 84 75 00 00 00'
        HEX @0x00740217 = '83 B9 E8 01 00 00 20 74 82 83 B9 E8 01 00 00 13 0F 84 75 FF FF FF E9 DC 76 EE FF 83 B8 E8 01 00 00 20 74 13 83 B8 E8 01 00 00 13 74 0A E8 F7 2C E8 FF E9 58 87 EE FF C6 44 E4 0C 02 C6 44 E4 04 01 E8 E3 2C E8 FF E9 44 87 EE FF'
        HEX @0x006289A1 = 'E9 8C 78 11 00'
    #/patch

    #patch [Monsters_Block_Damage]
        IF BOOL @SYSTEMPACK:PARAMETERS:Monsters_Block_Damage
            HEX @0x007400F4 = '68 DA 00 74 00'
            HEX @0x007401CB = '00 00 00 00'
            HEX @0x00628988 = 'EB 37 90 90'
            HEX @0x006289C1 = '8B 4C E4 34 85 C9 75 C3 41 41 EB BF'
        END
    #/patch

    #patch [Hide strength and dexterity values in character screen after /]
        IF BOOL @SYSTEMPACK:INTERFACE:Hide_STR_DEX
            HEX @0x007401DA = 'E8 61 45 CC FF 83 7C E4 1C 02 0F 8F CF 6A D3 FF C7 45 0C 00 00 00 00 83 68 0C 01 E9 BF 6A D3 FF'
            HEX @0x00476CB4 = 'E9 21 95 2C 00'
        END
    #/patch
    
    #patch [Anisotropic_Filtering]
        IF BOOL @SYSTEMPACK:PARAMETERS:AnisotropicFiltering != 0
            HEX @0x007401FA = '8B 45 00 68 10 00 00 00 6A 14 57 8B CD FF 90 48 01 00 00 8B 45 00 6A 03 E9 DE 0C FD FF'
            HEX @0x00710ED3 = '6A 05 6A 0F 57 8B CD FF 90 48 01 00 00 8B 55 00 6A 03 6A 10 57 8B CD FF 92 48 01 00 00 E9 05 F3 02 00'
            HEX @0x00719D33 = '6A 05 6A 0F 6A 00 FF 90 48 01 00 00 8B 16 6A 03'
            HEX @0x007401FE = LIM(2, INT @SYSTEMPACK:PARAMETERS:AnisotropicFiltering, 16)
        END
    #/patch
    
    #patch [Pyro_fix]
        HEX @0x0048E14E = 'E9 0F 21 2B 00'
        HEX @0x00740262 = '83 7C E4 04 0D 74 0A E8 82 63 F7 FF E9 E0 DE D4 FF E8 1C 66 F7 FF E9 D6 DE D4 FF'
        HEX @0x0061585D = 'E9 1B AA 12 00 90'
        HEX @0x0074027D = 'E8 9E 55 F5 FF 83 F8 07 0F 85 0F 00 00 00 E8 50 99 F5 FF 83 F8 0D 74 10 83 F8 28 74 0B 8B 8E 2C 01 00 00 E9 BE 55 ED FF E8 B7 0A F5 FF E9 B9 55 ED FF'
    #/patch
    
    #patch [Disable endless VISEME after getting hit]
        HEX @0x00745F78 = '68 00 00 80 BF 68 00 00 00 40'
    #/patch
    
    #patch [SaveGameToASCII]
        IF BOOL @UNION:GAME:SaveGameToASCII
            HEX @0x0063B1C2 = '00'
        END
    #/patch

    #patch [SendMessage - BroadCast fix]
        INT hWindow     = FindWindow(NULL, "[zSpy]")
        IF INT @0x00447F5A != INT '90 90 90 90'
            INT @0x00447F5A = hWindow
            INT @0x00449280 = hWindow
            INT @0x004480AF = hWindow
        END
    #/patch

    #patch [Magic_Collision_Fix]    
        HEX @0x007402ED = '83 EC 20 53 8B 5C 24 2C 55 8B 6C 24 2C 56 8B F3 57 8B D5 33 FF 2B F1 C7 44 24 14 FF FF 7F FF C7 44 24 10 FF FF 7F 7F 2B D1 8D A4 24 00 00 00 00 D9 04 0E D9 E1 D8 1D 88 26 7D 00 DF E0 F6 C4 05 7A 1F D9 01 D9 04 0A DE D9 DF E0 F6 C4 05 0F 8B E3 00 00 00 D9 04 0A D9 41 0C DE D9 E9 98 00 00 00 D9 04 0E D8 3D 3C 0D 7D 00 D9 01 D8 24 0A D8 C9 D9 5C 24 38 D9 41 0C D8 24 0A DE C9 D9 44 24 38 D8 D9 DF E0 F6 C4 05 7A 28 D9 44 24 38 D8 5C 24 14 DF E0 F6 C4 41 75 08 8B 44 24 38 89 44 24 14 D8 54 24 10 DF E0 F6 C4 05 7A 32 D9 5C 24 10 EB 2E D8 54 24 14 DF E0 F6 C4 41 75 06 D9 5C 24 14 EB 02 DD D8 D9 44 24 38 D8 5C 24 10 DF E0 F6 C4 05 7A 0C 8B 44 24 38 89 44 24 10 EB 02 DD D8 D9 44 24 14 D8 5C 24 10 DF E0 F6 C4 41 74 48 D9 44 24 10 D8 1D A4 08 7D 00 DF E0 F6 C4 05 7B 37 47 83 C1 04 83 FF 03 0F 8C 23 FF FF FF D9 44 24 14 D8 1D A4 08 7D 00 DF E0 F6 C4 05 7A 06 D9 44 24 10 EB 04 D9 44 24 14 D8 15 3C 0D 7D 00 DF E0 F6 C4 41 EB 0E DD D8 5F 5E 5D 33 C0 5B 83 C4 20 C2 0C 00 D9 C0 8B 4C 24 3C D8 0B 5F 5E D9 5C 24 1C D9 C0 D8 4B 04 D9 5C 24 20 D8 4B 08 D9 44 24 1C D8 45 00 D9 5C 24 10 D9 44 24 20 8B 54 24 10 D8 45 04 D9 5C 24 14 8B 44 24 14 D8 45 08 89 11 89 41 04 5D D9 5C 24 14 8B 54 24 14 89 51 08 B8 01 00 00 00 5B 83 C4 20 C2 0C 00'
        HEX @0x0053A121 = 'E8 C7 61 20 00'
    #/patch
    
    #patch [Simple Window]    
        IF BOOL @SYSTEMPACK:DEBUG:SimpleWindow
            HEX @0x004F42AE = 'B8 00 00 00 96'
            HEX @0x004F42F1 = '68 00 00 00 00'
            HEX @0x004F42E0 = '90 90 90 90 90'
            HEX @0x004F25D0 = 'C3'
        END
    #/patch
    
    #patch [CollisionVolumeScaler]
        HEX @0x0053DAF7 = 'D9 05 80 12 7D 00'
    #/patch

    #patch [BarrierIgnoreSkyEffectsSetting]
        HEX @0x00632152 = '0F 84 00 00 00 00'
    #/patch

    #patch [SmoothAniDistance]
        IF FLOAT @SYSTEMPACK:PARAMETERS:SmoothAniDistance > 2000.0
            HEX @0x00562CC1 = LIM(2000.0 , FLOAT @SYSTEMPACK:PARAMETERS:SmoothAniDistance, 1000000.0)
            HEX @0x00562D58 = 'D8 1D C1 2C 56 00'
            HEX @0x00562D9B = 'D8 1D C1 2C 56 00'
        END
    #/patch

    #patch [Lootfix Unconscious]
        HEX @0x00740488 = 'C6 86 D8 09 00 00 00 E9 1C 99 CC FF'
        HEX @0x00692CFD = 'E8 86 D7 0A 00'
        HEX @0x007404D8 = '64 A1 00 00 00 00 6A FF 68 54 12 7C 00 50 64 89 25 00 00 00 00 83 EC 28 53 55 56 57 8B D9 8B 81 AC 07 00 00 25 00 08 00 00 85 C0 0F 85 B5 AB F7 FF B8 01 00 00 00 E9 B0 AB F7 FF 90 90 90 90 90 90 90'
        HEX @0x006BB95B = 'E8 78 4B 08 00'
        HEX @0x0073FECE = '0F 84 3E 09 00 00'
    #/patch

    #patch [DrawItemInfo]
        HEX @0x00740494 = 'FF 92 98 00 00 00 8B 46 68 8B 4C 24 10 8B 16 50 51 8B CE C7 05 80 00 C4 07 01 00 00 00 FF 92 98 00 00 00 C7 05 80 00 C4 07 00 00 00 00 E9 EC 73 F2 FF 83 3D 80 00 C4 07 00 0F 84 A6 2C F3 FF E9 98 2A F3 FF'
        HEX @0x006678AC = 'E9 E3 8B 0D 00 90'
        HEX @0x00667392 = 'E8 2F 91 0D 00'
        HEX @0x007404A9 = 4x00000090
        HEX @0x007404B9 = 4x00000090
        HEX @0x007404C8 = 4x00000090
        HEX @0x0074051A = 'A1 BC E1 8D 00 83 EC 38 55 56 8B F1 3B F0 57 0F 84 80 02 00 00 83 7E 0C 01 0F 84 76 02 00 00 8B 0D D0 5E 8C 00 8B 01 FF 50 68 8B 0D D0 5E 8C 00 8B 11 6A 00 8B E8 FF 52 6C 8B 0D D0 5E 8C 00 8B 01 FF 50 70 8B 0D D0 5E 8C 00 89 44 24 30 8D 44 24 24 C7 44 24 24 00 00 00 00 8B 11 50 FF 52 74 8B 46 50 8B 4E 54 8B 56 58 89 44 24 24 DB 44 24 24 89 4C 24 24 8D 44 02 FF 8B 56 5C D9 5C 24 3C DB 44 24 24 89 44 24 24 8D 44 0A FF 8D 4C 24 34 D9 5C 24 40 51 DB 44 24 28 89 44 24 28 8D 54 24 40 52 D9 5C 24 3C 8B CE DB 44 24 2C D9 5C 24 40 E8 D1 CD FB FF 8B 44 24 3C D9 44 24 3C D8 1D A4 08 7D 00 8B 4C 24 40 8B 54 24 34 89 44 24 18 8B 44 24 38 89 44 24 24 DF E0 89 4C 24 14 F6 C4 05 89 54 24 1C 7A 08 C7 44 24 18 00 00 00 00 8B 3D D0 5E 8C 00 8B 4F 0C 49 89 4C 24 10 DB 44 24 10 D9 5C 24 0C D9 44 24 3C D8 5C 24 0C DF E0 F6 C4 41 0F 84 7E 01 00 00 D9 44 24 40 D8 1D A4 08 7D 00 DF E0 F6 C4 05 7A 08 C7 44 24 14 00 00 00 00 8B 57 10 4A 89 54 24 10 DB 44 24 10 D9 5C 24 10 D9 44 24 40 D8 5C 24 10 DF E0 F6 C4 41 0F 84 42 01 00 00 D9 44 24 34 D8 1D A4 08 7D 00 DF E0 F6 C4 05 0F 8B 2D 01 00 00 D9 44 24 34 D8 5C 24 0C DF E0 F6 C4 41 75 08 8B 44 24 0C 89 44 24 1C D9 44 24 38 D8 1D A4 08 7D 00 DF E0 F6 C4 05 0F 8B 01 01 00 00 D9 44 24 38 D8 5C 24 10 DF E0 F6 C4 41 75 08 8B 4C 24 10 89 4C 24 24 D9 44 24 1C D8 64 24 18 D9 5C 24 1C D9 44 24 24 D8 64 24 14 D9 5C 24 24 D9 44 24 1C D8 1D A4 08 7D 00 DF E0 F6 C4 41 0F 8B BD 00 00 00 D9 44 24 24 D8 1D A4 08 7D 00 DF E0 F6 C4 41 0F 8B A8 00 00 00 D9 44 24 24 53 8B 1F E8 45 6E 03 00 D9 44 24 20 50 E8 3B 6E 03 00 D9 44 24 1C 50 E8 31 6E 03 00 D9 44 24 24 50 E8 27 6E 03 00 50 8B CF FF 93 34 01 00 00 8B 0D D0 5E 8C 00 8B 11 FF 92 8C 00 00 00 8B 0D D0 5E 8C 00 89 44 24 30 8B 01 8D 7E 1C 57 FF 90 88 00 00 00 8B 46 3C 85 C0 8A 4E 24 88 4E 23 8B 0D D0 5E 8C 00 8B 01 57 FF 90 88 00 00 00 8B CE E8 31 C0 FB FF 8B 0D D0 5E 8C 00 8B 11 8D 44 24 30 50 FF 92 88 00 00 00 8B 0D D0 5E 8C 00 8B 11 55 FF 52 6C 8B 0D D0 5E 8C 00 8B 01 8D 54 24 34 52 FF 50 74 5B 5F 5E 5D 83 C4 38 C3'
        HEX @0x00667621 = 'E9 9A 91 0D 00'
        HEX @0x007407B6 = 'FF 52 24 85 DB E9 66 6E F2 FF 83 3D 80 00 C6 07 00 74 ED E8 4C FD FF FF 85 DB E9 51 6E F2 FF'
        HEX @0x007407C2 = 4x00000090
    #/patch

    #patch [MobInterCollision]    
        IF BOOL @SYSTEMPACK:PARAMETERS:InteractionCollision
            BOOL laddersTestHardCollisions = BOOL @SYSTEMPACK:PARAMETERS:TestHardCollisionsOnLadder
            #assembler [MobInterCollision]
                mov     edx, [ebx+84h]              ; vob
                mov     eax, [edx+160]              ; type
                cmp     eax, 130
                jnz     detectCollisions
                mov     eax, dword ptr [edx+99Ch]   ; interactMob
                test    eax, eax
                jz      detectCollisions
                push    eax
                mov     eax, $laddersTestHardCollisions
                test    eax, eax
                pop     eax
                jz      return
                cmp     dword ptr [eax], 7DD794h    ; oCMobLadder vftable
                jnz     return
            detectCollisions:
                mov     eax, [ebx]
                push    esi
                mov     edx, edi
                mov     ecx, ebx
                jmp     00538904h
            return:
                jmp     00538907h
            #/assembler
            JMP(0x005388FD, MobInterCollision)
            CALL(0x0067D0A9, 0x006D43C0)
            CALL(0x0067D116, 0x006D43C0)
            MemSet(0x0067FCEF, '90', 0x0067FD01 - 0x0067FCEF)
        END
    #/patch
    
    #patch [Rain particle collisions]
        IF BOOL @SYSTEMPACK:PARAMETERS:RainVobCollision
            INT @0x005B90A5 = 736
        END
    #/patch

    #patch [REMOVE OVERLAYMDS fix]    
        HEX @0x00644CE7 = '74 34'
    #/patch

    #patch [Exit VDFS]
        HEX @0x004249B1 = 'FF 15 C0 04 7D 00 6A 00 E8 C 2F 35 00'
    #/patch
  
    #patch [Hide original splash]
        INT nBegin1  = 0x0042593A
        INT nEnd1    = 0x00425957
        INT nLength1 = nEnd1 - nBegin1
        MemSet(nBegin1, '90', nLength1)
    
        INT nBegin2  = 0x004259E9
        INT nEnd2    = 0x004259FA
        INT nLength2 = nEnd2 - nBegin2
        MemSet(nBegin2, '90', nLength2)
    #/patch

    #patch [Inventory KEY 9 fix]
        HEX @0x0066EFC8 = 'E8 08 18 0D 00'
        HEX @0x007407D5 = '8B 44 E4 0C 89 44 E4 08 E9 6E 28 D8 FF'
    #/patch

    #patch [DialogChoice start from KEY 1]
        HEX @0x00758B11 = 'E9 CC 7C FE FF 90'
        HEX @0x007407E2 = '0F 87 92 82 01 00 83 F8 00 0F 84 2D 83 01 00 83 E8 01 E9 1E 83 01 00'
    #/patch

    #patch [Optimize VB]
        IF BOOL @SYSTEMPACK:DEBUG:OptimizeVB != 1
            HEX @0x0071EB50 = 'EB 2D'
        END
    #/patch

    #patch [VISEME at 60Hz fix]
        HEX @0x0074086D = 'D9 05 EC F1 8C 00 D8 05 10 11 7D 00 E9 4B 66 E4 FF D9 05 EC F1 8C 00 D8 05 10 11 7D 00 E9 6A 66 E4 FF'
        HEX @0x00586EC3 = 'E9 A5 99 1B 00 90'
        HEX @0x00586EF3 = 'E9 86 99 1B 00 90'
    #/patch

    #patch [Allow undeclarated instances]
        HEX @0x0058B3ED = 'E9 99 00 00 00 90'
    #/patch

    #patch [Timed Overlay Mds Fix 'SetFightAnis after InitAnimations']
        HEX @0x0069B25C = 'E9 2E 56 0A 00'
        HEX @0x0074088F = 'E8 5C B1 ED FF 89 F1 E8 85 4F F5 FF 8B 8E B4 09 00 00 50 E8 59 1B EE FF E9 B5 A9 F5 FF'
    #/patch

    #patch [Line cache size]
        INT CacheSize = INT @SYSTEMPACK:DEBUG:LineCacheSize
        INT @0x004FB8F8 = CacheSize
        INT @0x004FB8F2 = CacheSize * 20
    #/patch

    #patch [UnequipItem]
        HEX @0x0068FC00 = '68 00 00 00 40 8B CE E8 D4 23 FE FF 56 8B CF E8 BC FB FF FF'
        HEX @0x0068F3A0 = '68 00 00 00 40 8B CE E8 14 2C FE FF 85 C0 74 21 56 8B CF E8 48 FB FF FF 85 C0 75 15'
    #/patch

    #patch [SAVEDAT IN ASCII]
        IF BOOL @UNION:GAME:SaveDATinASCII
            HEX @0x0063B3A5 = '01'
        END
    #/patch

    #patch [oCNpc::SetFlag Fix]
        HEX @0x0068E13A = '0B'
    #/patch

    #patch [Dialog Starvation Fix]
        HEX @0x007540A5 = 'D9 EA 90 90 90 90'
        HEX @0x00754117 = 'D9 EA 90 90 90 90'
        HEX @0x00754195 = 'D9 EA 90 90 90 90'
        HEX @0x00754212 = 'D9 EA 90 90 90 90'
    #/patch

    #patch [prolog]
        HEX @0x007CFFCD = '6A FF 68 81 E0 7B 00 64 A1 00 00 00 00 50 64 89 25 00 00 00 00 83 EC 1C 53 55 56 8B F1 57 8D AE E8 09 00 00 31 DB E9 F7 B5 EB FF'
        HEX @0x007CFFA3 = '6A FF 68 88 B2 7B 00 64 A1 00 00 00 00 50 64 89 25 00 00 00 00 51 55 56 8B F1 57 89 74 24 0C E8 05 00 00 00 E9 28 B4 E9 FF C3'
    #/patch

    #patch [F3 - SetForegroundWindow]
        HEX @0x006413B4 = 'FF 35 B8 F4 86 00 E9 2E F5 0F 00'
        HEX @0x007408ED = 'FF 15 20 04 7D 00 C3'
    #/patch

    #patch [bink_v_1_5]
        HEX @0x0043A942 = 'E9 AD 5F 30 00'
        HEX @0x007408F4 = '68 00 00 01 00 6A 00 E9 47 A0 CF FF'
    #/patch

    #patch [IsDead check T_RUNSTRAFEL and T_RUNSTRAFER]
        HEX @0x00625094 = 'E9 67 B8 11 00 90'
        HEX @0x00740900 = '0F 85 0E 49 EE FF 8B 96 30 10 00 00 52 8B CF E8 CC C8 D2 FF 50 8B CF E8 04 C9 D2 FF 85 C0 0F 85 F0 48 EE FF 8B 96 34 10 00 00 52 8B CF E8 AE C8 D2 FF 50 8B CF E8 E6 C8 D2 FF 85 C0 0F 85 D2 48 EE FF E9 53 47 EE FF'
    #/patch

    #patch [FIX T_MAGJUMPB (InvestedMana == 0)]
        HEX @0x0046CCA4 = 'E9 29 05 00 00'
        HEX @0x0046D1D2 = '8B 4C E4 18 C7 41 48 00 00 00 00 EB D9'
    #/patch

    #patch [Disable slow code segment in zCTexConGeneric::Unlock]
        INT slowBegin = 0x00722C96
        INT slowEnd = 0x00722E47
        INT jumpLength = slowEnd - slowBegin - 5
        HEX @slowBegin = 'E9' + HEX jumpLength
    #/patch

    #patch [CS Player crash fix]
        INT begin = 0x0041F160
        INT length = 0x0041F36A - begin
        MemSet(begin, '90', length)
    #/patch
  
    #patch [Sliding fix]
      FLOAT @6x00000000 = FLOAT @UNION:DEBUG:SlidingSize
      INT   @0x0059459C = 6x00000000
    #/patch

    #patch [Fix 1px cutline in zCView objects]
        HEX @0x006FC9B7 = '41'
        HEX @0x006FC9F3 = '42'
        HEX @0x006FC938 = '00'
        HEX @0x006FC94B = '00'
        HEX @0x005AF1EA = '42'
        HEX @0x005AF1F6 = '41'
    #/patch

    #patch [CastSpecificSpell - SetAsPlayer fix]
        HEX @0x0047F0A2 = '90 90 90 90 90 90'
        HEX @0x0047F0E7 = 'E9 99 19 2C 00'
        HEX @0x00740A85 = 'E8 D6 DC EA FF 8B 4E 34 E8 4E E0 F5 FF 8B 4E 40 E8 86 12 F6 FF E9 4D E6 D3 FF'
    #/patch
    
    #patch [CheckInsertNpc - NPC spawn fix]
        HEX @0x006CFDE0 = 'E9 46 0D 07 00 90'
        HEX @0x00740B2B = '89 0D 56 34 12 00 64 A1 00 00 00 00 E9 AA F2 F8 FF'
        HEX @0x006D01E9 = 'E9 B1 08 07 00'
        HEX @0x00740A9F = '83 C4 74 56 57 8B 3D 56 34 12 00 33 F6 39 77 08 7E 49 8B 07 8B 0C B0 85 C9 74 40 F3 0F 10 41 10 0F 57 C9 0F 2F C8 72 20 8D 41 04 50 FF 31 8B CF E8 29 00 00 00 85 C0 74 1C 8B 07 8B CF FF 34 B0 E8 30 00 00 00 4E EB 0D F3 0F 5C 05 B0 0F 85 00 F3 0F 11 41 10 46 3B 77 08 7C B7 5F 5E C3 55 8B EC 51 89 4D FC 8B E5 5D B8 50 02 6D 00 FF E0 8B E5 5D C2 08 00 55 8B EC 51 89 4D FC 8B E5 5D B8 70 F7 6C 00 FF E0 8B E5 5D C2 04 00'
        HEX @0x00740B2D = 6x00000010
        HEX @0x00740AA6 = 6x00000010
    #/patch

    #patch [Fix double spawn for summons]
        HEX @0x006D0425 = '90 90 90 90 90 90 90 90 90 90'
    #/patch

    #patch [GetSpellItem leak fix]
        HEX @0x0074AEDB = '90 90 90'
    #/patch

    #patch [Spawn anim fix]
        HEX @0x00739703 = '55 8B EC 83 EC 20 89 4D FC 68 D0 C3 84 00 8D 4D E0 E8 87 7C CC FF 8D 45 E0 50 8B 4D FC E8 DB BB F5 FF 8B C8 E8 24 55 D4 FF 89 45 F4 8D 4D E0 E8 29 7B CC FF 8B 4D F4 51 8B 4D FC E8 BD BB F5 FF 8B C8 E8 96 3A D3 FF 89 45 F8 83 7D F8 00 74 1B 8B 55 F8 52 8B 4D FC E8 A1 BB F5 FF 8B C8 E8 BA 3A D3 FF 85 C0 74 04 33 C0 EB 12 8B 4D FC 83 C4 20 5D 53 56 8B 74 24 0C E9 86 50 01 00 8B E5 5D C2 04 00'
        HEX @0x0074E800 = 'E9 FE AE FE FF 90'
    #/patch

    #patch [CopyDamage to arrow/bolt]
        HEX @0x006A4487 = 'E9 FA 52 09 00 90'
        HEX @0x00739786 = '81 C4 FC 00 00 00 55 50 8B EC 83 EC 2C 56 C7 45 00 00 00 00 00 83 BB 08 02 00 00 06 75 27 68 44 E0 84 00 8D 75 E8 89 F1 E8 ED 7B CC FF 8D 55 E8 52 89 D9 E8 32 5D F5 FF 89 45 00 8D 4D E8 E8 97 7A CC FF EB 2E 83 BB 08 02 00 00 05 75 41 68 48 24 83 00 8D 75 D4 89 F1 E8 BD 7B CC FF 8D 55 D4 52 89 D9 E8 02 5D F5 FF 89 45 00 8D 4D D4 E8 67 7A CC FF 89 D9 E8 F0 AB F5 FF 89 45 FC 83 7D FC 00 74 0C 8B 45 00 50 8B 4D FC E8 DB 84 F3 FF 5E 8B E5 58 5D C2 04 00'
    #/patch

    #patch [Disable portal in the swamp]
        HEX @0x00521086 = 'E9 B5 87 21 00'
        HEX @0x0051C9B6 = 'E9 B4 CE 21 00'
        HEX @0x00739836 = '8D 4C 24 78 51 E9 4B 78 DE FF 8B 4D 08 81 39 50 53 55 30 75 EB 8D 4C 24 78 51 C7 44 E4 34 45 3E 10 4E C7 44 E4 28 85 D8 0C 4E E9 36 78 DE FF 8D 4C 24 5C 51 E9 4C 31 DE FF 8B 4E 18 8B 49 18 81 79 04 53 55 30 31 75 E7 81 39 50 3A 5F 50 75 DF 8D 4C 24 5C 51 C7 44 E4 2C 45 3E 10 4E C7 44 E4 24 85 D8 0C 4E E9 2B 31 DE FF'
    #/patch

    #patch [zCView::PrintCY fix]
        HEX @0x007003D4 = '90'
        HEX @0x007003D5 = Call(0x007003D5, 0x006E0200)
    #/patch
    
    #patch [Transform crashfix]
        HEX @0x0062787D = 'E8 35 20 11 00'
        HEX @0x007398B7 = '8B 81 B4 09 00 00 85 C0 74 01 C3 C7 81 84 01 00 00 00 00 00 00 8B 0D B0 BB 8D 00 89 8E C4 01 00 00 8B 81 B4 09 00 00 C3'
    #/patch

    #patch [Regen mana without hp]
        INT @0x0069E453 += 4
    #/patch
    
    #patch [forceFlip]
        IF BOOL @SYSTEMPACK:DEBUG:ForceFlip
            HEX @0x0071EF30 = 'EB'
        END
    #/patch
    
    #patch [Disable occlusion culling]
        IF BOOL @SYSTEMPACK:DEBUG:DisableOcclusionCulling
            HEX @0x0051CE32 = '90 90'
        END
    #/patch

    #patch [DrawItemInfo - render item on the right side]
        INT @0x00667368 = 6400
    #/patch

    #patch [StopInteraction fix]
        float delay = 100.0

        #assembler [0x006804D3]
            cmp     dword ptr [esi], 7DD794h ; oCMobLadder vftable
            jnz     return
            mov     [esi+208h], edi          ; inUseVob
            push    edi                      ; npc
            push    $delay                   ; float
            mov     ecx, esi                 ; this
            call    67F5D0h                  ; MarkAsUsed
        return:
            orgcode
        #/assembler
        
        HEX @0x0067F645 = '90 90'
    #/patch
    
    #patch [Aligning npc by ladder]
        HEX vector = '00 00 00 00 00 00 00 00 00 00 00 00'
        
        #assembler [0x00685DEA]
            cmp     dword ptr [esi], 7DD794h ; oCMobLadder vftable
            jnz     return
            mov     ecx, esi                 ; ladder
            lea     eax, [$vector]       
            push    eax                      ; vector
            call    0051B3E0h                ; GetAtVectorWorld
            mov     ecx, [esp+40h]           ; npc
            test    ecx, ecx
            jz      return
            push    eax      
            call    005EF640h                ; SetHeadingAtWorld
        return:
            orgcode
        #/assembler
        
        #assembler [0x005EF837]
            orgcode
            test    eax, eax
            jz      0x005EF8BC
        #/assembler
        
        #assembler [0x005F0601]
            orgcode
            test    eax, eax
            jz      0x005F067B
        #/assembler
    #/patch
    
    #patch [Fall down from the mobInter fix]
        #assembler [0x0053F216]
            mov     eax, [ecx+160]          ; type
            cmp     eax, 130
            jnz     phyEnable
            mov     eax, [ecx+99Ch]         ; interactMob
            test    eax, eax
            jnz     return
        phyEnable:
            orgcode
        return:
        #/assembler
    #/patch
    
    #patch [Barrier kill monsters and in water]
        FLOAT damageNormal = 5.0
        FLOAT damageKill   = 9999.0
        
        #assembler [0x0046E766]
            push    eax
            push    edx
            push    ecx
            push    esi
            mov     edx, [esi+8]
            mov     ecx, edx        ; npc
            call    691A00h         ; GetAnictrl
            mov     ecx, eax        ; aniCtrl
            call    62F1D0h         ; GetWaterLevel
            cmp     eax, 0
            jnz     damKill
        testMonster:
            mov     ecx, edx        ; npc
            call    0069EA30h       ; IsMonster
            cmp     eax, 0
            jz      damNormal
        damKill:
            pop     esi
            pop     ecx
            pop     edx
            pop     eax
            push    $damageKill
            jmp     return
        damNormal:
            pop     esi
            pop     ecx
            pop     edx
            pop     eax
            push    $damageNormal
        return:
        #/assembler
    #/patch
    
    #patch [Disable form return after death]
        #assembler [0x0046C2B7]
            mov     ecx, [edi+12Ch]
            mov     edx, [ecx+184h]
            cmp     edx, 0
            jg      return
            jmp     46C326h
        return:
            orgcode
        #/assembler
    #/patch
    
    #patch [Inventory freeze at spell cast fix]
        #assembler [checkIsAniActive] //IsAniActive(s_cast) in RemoveWeapon1
            CMP EAX,1
            JE 629E8Fh
            MOV EAX,DWORD PTR DS:[ESI+11E0h]    ; s_cast
            MOV EDI,DWORD PTR DS:[ESI+68h]
            PUSH EAX
            MOV ECX,EDI
            CALL 46D1E0h                        ; GetAniFromAniID
            PUSH EAX
            MOV ECX,EDI
            CALL 46D220h                        ; IsAniActive
            CMP EAX,1
            JE 629E8Fh
            JMP 629FB8h
        #/assembler
        JMP(0x00629E87, checkIsAniActive)
        HEX @0x00629E8C = '90 90 90'        
    #/patch

    /*
    #patch [Don't open inventory when spell casting]
        #assembler [LockInventory]
            call    691A00h             ; GetAnictrl
            mov     ecx, eax
            call    62F060h             ; IsInCastAni
            cmp     eax, 0
            mov     ecx, ds:[8DBBB0h]   ; player
            jnz     65F92Dh
        return:
            call    6BB0A0h             ; OpenInventory
            jmp     65F0D5h
        #/assembler
        JMP(0x0065F0D0, LockInventory)
    #/patch
    */
    
    #patch [Skip AI in non-game worlds]
        INT gameWorld = 0
        #assembler [0x005F3F59]
            push    eax
            push    ecx
            mov     ecx, ds:[8DA6BCh]   ; ogame
            mov     edx, [ecx]          ; oCGame `vftable'
            call    [edx+8Ch]           ; GetGameWorld
            mov     [$gameWorld], eax
            pop     ecx
            pop     eax
            cmp     esi, [$gameWorld]   ; check game world
            jz      return
            push    edi
            jmp     5F3F78h
        return:
            orgcode
        #/assembler
        #assembler [0x005F3FBA]
            cmp     esi, [$gameWorld]   ; check game world
            jz      return
            jmp     5F3FE1h
        return:
            orgcode
        #/assembler
        #assembler [0x005F405A]
            cmp     esi, [$gameWorld]   ; check game world
            jz      return
            jmp     5F409Ch
        return:
            orgcode
        #/assembler
    #/patch
    
    #patch [Step sounds in more actions]
        #assembler [0x00614F13]
            mov     eax, 100Ch          ; _t_walk_2_walkl
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1010h          ; _t_walkl_2_walk
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1014h          ; _s_walkl
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1040h          ; _s_walkbl
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1060h          ; _t_jumpb
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1064h          ; _t_stand_2_jump
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 106Ch          ; t_jump_2_stand
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1030h          ; _t_strafel
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1034h          ; _t_strafer
            call    aniIsActive
        return:
            jmp     614F18h
        aniIsActive:
            mov     ecx, [esi+68h]      ; model
            push    ecx
            push    dword ptr [esi+eax]
            call    46D1E0h             ; GetAniFromAniID
            pop     ecx
            push    eax
            call    46D220h             ; IsAniActive
            ret
        #/assembler
        
        #assembler [0x0074E9BD]
            orgcode
            push    0
            mov     ecx, [edi+9B4h]
            call    614F00h         ; CreateFootStepSound
            jmp     74E9C2h
        #/assembler
    #/patch
    
    #patch [Change BodyState in strafe]
        #assembler [0x0074E93B]
            orgcode
            mov     eax, [edi+9B8h]     ; anictrl
            mov     eax, [eax+160h]     ; walkmode
            cmp     eax, 3
            jge     return
            cmp     eax, 0
            jnz     setBodyState
            mov     eax, 1
        setBodyState:
            mov     ecx, edi
            push    eax
            call    6B8000h
        return:
            jmp     74E940h
        #/assembler
    #/patch
    
    #patch [Create draw and remove weapon perceptions on run]
        INT this = 0
        #assembler [0x006A8508]
            mov     [$this], ecx
            orgcode
        #/assembler
        #assembler [0x006A8B5C]
            test    eax, eax
            jz      returnFalse
            mov     ecx, [$this]
            mov     eax, [ecx]
            mov     eax, [eax+100h] ; IsAPlayer
            call    eax
            test    eax, eax
            jz      returnTrue
            push    0
            push    ecx
            push    24              ; NPC_PERC_DRAWWEAPON
            call    6B49C0h         ; CreatePassivePerception
        returnTrue:
            mov     eax, 1
        returnFalse:
            orgcode
        #/assembler
        MemSet(0x006A938F, '90', 0x006A939B - 0x006A938F)
        
        #assembler [0x006A93C8]
            mov     [$this], ecx
            orgcode
        #/assembler
        #assembler [0x006A9774]
            test    eax, eax
            jz      returnFalse
            mov     ecx, [$this]
            mov     eax, [ecx]
            mov     eax, [eax+100h] ; IsAPlayer
            call    eax
            test    eax, eax
            jz      returnTrue
            push    0
            push    ecx
            push    11              ; NPC_PERC_ASSESSREMOVEWEAPON
            call    6B49C0h         ; CreatePassivePerception
        returnTrue:
            mov     eax, 1
        returnFalse:
            orgcode
        #/assembler
        MemSet(0x006A9C4C, '90', 0x006A9C58 - 0x006A9C4C)
    #/patch
    
    #patch [Close alpha-lines on multipage documents]
        #assembler [0x00725B12]
            mov     ebx, [edi+48h]
            imul    ebx, -2
            add     eax, ebx
            orgcode
        #/assembler
    #/patch
    
    #patch [Unpack inventory before trade]
        #assembler [0x0072E139]
            push    ecx
            mov     eax, [esi+20h]      ; npc
            lea     ecx, [eax+550h]     ; inventory
            call    670400h             ; UnpackAllItems
            pop     ecx
            orgcode
        #/assembler
    #/patch
    
    #patch [CompatData fix]
        IF BOOL @SYSTEMPACK:DEBUG:BorderFix
            INT address = ImportSymbol("ddraw.dll", "SetAppCompatData")
            IF address != 0
                HEX @impSetAppCompatData = address 
                impSetAppCompatData(12, 0)
            END
        END
    #/patch
    
    #patch [Lost sound fix in DirectSound3D provider]
        INT impSetSampleCone = ImportSymbol("Mss32.dll", "_AIL_set_3D_sample_cone@16")
        IF impSetSampleCone
            FLOAT inner = 360.0
            FLOAT outer = 0.0
            #assembler [impSetSampleCone]
                mov     dword ptr [esp+8h], $inner
                mov     dword ptr [esp+0Ch], $outer
                orgcode
            #/assembler
        END
    #/patch

    #patch [Double swim_2_dive fix]
        #assembler [0x0062C40C]
            orgcode
            MOV DWORD PTR DS:[0x008D88E4],0x1
        #/assembler
    #/patch
    
    #patch [Dont reset active npcs at midnight]
        #assembler [0x0069E543]
            orgcode
            mov     eax, [ebx+00A8h]
            test    eax, eax
            jnz     69E75Eh
        #/assembler
    #/patch
    
    #patch [Close inventory when dialog starts]
        #assembler [0x0072BD70]
            orgcode
            call    0x006BB2F0      ; CloseInventory
        #/assembler
    #/patch

    #patch [Disable inventory key in dialogs]
        #assembler [0x0065F0D0]
            push    ecx
            call    0x0072ABD0      ; GetInformationManager
            mov     eax, [eax+2Ch]  ; IsDone
            test    eax, eax
            pop     ecx
            jz      return
            call    0x006BB0A0
        return:
        #/assembler
    #/patch
    
    #patch [Transform teleportation through the walls fix]
        BOOL checkEnoughSpace = True
        #assembler [0x0047F270]
            mov     dword ptr ds:[$checkEnoughSpace], 0
            orgcode
            mov     dword ptr ds:[$checkEnoughSpace], 1
        #/assembler
        #assembler [0x0047F2BD]
            mov     dword ptr ds:[$checkEnoughSpace], 0
            orgcode
            mov     dword ptr ds:[$checkEnoughSpace], 1
        #/assembler
        #assembler [0x0047F696]
            mov     dword ptr ds:[$checkEnoughSpace], 0
            orgcode
            mov     dword ptr ds:[$checkEnoughSpace], 1
        #/assembler
        
        CALL(0x0047F122, 0x006D4410)
        CALL(0x0047F588, 0x006D4410)
        
        #assembler [0x006A20AC]
            mov     eax, dword ptr ds:[$checkEnoughSpace]
            test    eax, eax
            jnz     searchPosition
            call    0x006D4410
            jmp     return
        searchPosition:
            call    0x006D3B10
        return:
        #/assembler
    #/patch

    #patch [Fix crash while transforming in water]
        #assembler [0x004FEE84]
            push ecx
            mov ecx, [ecx+00A8h] ; homeWorld
            cmp ecx, 0
            pop ecx
            je 0x004FF788
            orgcode
        #/assembler
    #/patch
#/engine

#engine [G1A]
    #patch [GLOBAL DATA]
        AllocPage(1, 0x10000) //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(2, 0x10000) //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(3, 0x20000) //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(4, 0x100)   //FOV
        AllocPage(5, 0x100)   //DS for sliding fix and etc
        
        OptionDef(BOOL  @UNION:GAME:SaveGameToASCII,                           0)
        OptionDef(BOOL  @UNION:GAME:SaveDATinASCII,                            1)
        OptionDef(BOOL  @UNION:DEBUG:ReadBinkWithVDFS,                         true)
        OptionDef(BOOL  @UNION:DEBUG:UseErrorVisuals,                          false)
        OptionDef(BOOL  @UNION:DEBUG:FixBink,                                  true)
        OptionDef(BOOL  @Union:Core:CustomDebugWindowPos,                      false)
        OptionDef(BOOL  @Union:Core:DebugWindowPosX,                           0)
        OptionDef(BOOL  @Union:Core:DebugWindowPosY,                           0)
        OptionDef(BOOL  @Union:Core:UseDebugWindowHost,                        0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BorderFix,                           1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BorderlessWindow,                    0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:WindowPosX,                          0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:WindowPosY,                          0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:ZNORESTHREAD,                        1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Disable_D3DVBCAPS_WRITEONLY,         1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:NumLockDisable,                      1)
        OptionDef(INT   @SYSTEMPACK:DEBUG:LineCacheSize,                       16384)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:TerminateProcessHotkey,              true)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AnisotropicFiltering,           0)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:VerticalFOV,                    67.5)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTRANGE,              4500)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_REMOVERANGE,              5000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTTIME_MAX,           1000)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:RainVobCollision,               1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance,          false)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_LowerFPS, 55)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_UpperFPS, 60)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_ShowInfo, false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:VisualizePerfomance,            false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HeightCorrectionOnLadder,       1)
        OptionDef(FLOAT @UNION:DEBUG:SlidingSize,                              0.05)
    #/patch

    #patch [Gothic.ini fixes]
        IF !BOOL @GAME:INTERNAL:extendedMenu
            BOOL @GAME:INTERNAL:extendedMenu = 1
        END
        IF  INT @GAME:VIDEO:zVidResFullscreenBPP != 32
            INT @GAME:VIDEO:zVidResFullscreenBPP  = 32
        END
        IF  INT @GAME:ENGINE:zTexCacheSizeMaxBytes < 100000000
            INT @GAME:ENGINE:zTexCacheSizeMaxBytes = 100000000
        END
        IF !BOOL @GAME:INTERNAL:menuShowVersion
            BOOL @GAME:INTERNAL:menuShowVersion = 1
        END
        IF  BOOL @GAME:INTERNAL:gameStartFailed == 1
            BOOL @GAME:INTERNAL:gameStartFailed =  0
        END
        IF  BOOL @GAME:INTERNAL:gameAbnormalExit == 1
            BOOL @GAME:INTERNAL:gameAbnormalExit =  0
        END
    #/patch
    
    #patch [GameVersion]
        HEX @0x0087F7F4  = 4x00000070
        HEX @GameVersion = 4x00000070
        HEX hVersion     = GetUnionVersion()
        GameVersion      = "Union " + hVersion
    #/patch

    #patch [BorderlessWindow]
        INT adrPosX = 4x00000014
        INT adrPosY = 4x00000018
        INT @adrPosX = INT @SYSTEMPACK:DEBUG:WindowPosX
        INT @adrPosY = INT @SYSTEMPACK:DEBUG:WindowPosY
        INT @0x00506F6F = adrPosX
        INT @0x00506F68 = adrPosY
        IF BOOL @SYSTEMPACK:DEBUG:BorderlessWindow
            HEX @0x00506F43 = 'B8 00 00 00 96'
            HEX @0x00506F87 = '68 00 00 00 00'
            HEX @0x006237F9 = '31 C9 41 90'
            HEX @0x00505BE4 = '68 00 00 00 96'
            HEX @0x00505CAE = '00'
            HEX @0x00506F7B = '90 90 90 90 90'
            HEX @0x00504F30 = 'C3'
        END
    #/patch
    
    #patch [Allow all windowed resolutions]
        HEX @0x00501844 = '00'
        HEX @0x00501850 = '00'
    #/patch
    
    #patch [D3DIM700.dll - removes 2048 pixel limit]
        HEX hModuleName = "D3DIM700.dll"
        INT nModuleBase = ModuleBase(hModuleName, True)

        IF nModuleBase !=0
            INT nModuleSize = ModuleSize(hModuleName)
            FindAndReplace(HEX 'B8 00 08 00 00 39', 'B8 00 80 00 00 39', nModuleBase, nModuleSize)
        END
    #/patch
    
    #patch [AcGenral.dll - Windows 7 rundll32.exe bugfix]
        HEX hModuleName = "AcGenral.dll"
        INT nModuleBase = ModuleBase(hModuleName, True)
        
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize (hModuleName)
            FindAndReplace (HEX '68 28 09 00 00', 'C2 04 00 90 90', nModuleBase, nModuleSize)
        END
    #/patch

    #patch [ALPHA_VOB and ALPHA_WORLD_POLY]
        HEX FIX_1 = 1x00000000
        FindAndReplace(HEX 'F8 6C 8B 00', FIX_1, ModuleBase(Null), ModuleSize(Null))
        HEX FIX_2 = 1x0000B000
        FindAndReplace(HEX 'F8 7C 8B 00', FIX_2, ModuleBase(Null), ModuleSize(Null))
        HEX FIX_3 = 2x00000000
        FindAndReplace(HEX 'F0 58 8B 00', FIX_3, ModuleBase(Null), ModuleSize(Null))
        HEX FIX_4 = 2x0000000C
        FindAndReplace(HEX 'FC 58 8B 00', FIX_4, ModuleBase(Null), ModuleSize(Null))
        HEX FIX_5 = 3x00000000
        FindAndReplace(HEX 'B8 F7 90 00', FIX_5, ModuleBase(Null), ModuleSize(Null))
        HEX @0x0052D74A = '68 00 0C 00 00'
        HEX @0x0052D871 = '68 00 0C 00 00'
        HEX @0x0052D8AF = '81 FB 00 0C 00 00'
        HEX @0x00530698 = '3D 00 0C 00 00'
        HEX @0x005CE32A = '68 00 18 00 00'
        HEX @0x005CE3A1 = '68 00 18 00 00'
        HEX @0x005CE42F = '81 FB 00 18 00 00'
    #/patch
    
    #patch [Unlock FPS]
        HEX @0x005ED33A = 'EB 0E'
    #/patch

    #patch [D3DVBCAPS_WRITEONLY]
        IF BOOL @SYSTEMPACK:DEBUG:Disable_D3DVBCAPS_WRITEONLY
            HEX @0x0075AD87 = '81 4C 24 1C 00 00 00 00'
        END
    #/patch

    #patch [Unlock_Resolution]
        HEX @0x0042CE30 = '7F 00'
        HEX @0x0042D25B = '7F 00'
        HEX @0x0042D2B4 = '7F 00'
        HEX @0x0042ED21 = '0F 8F 00 00 00 00'
    #/patch

    #patch [MARVIN - F8 fix]
        HEX @0x0078EB08 = 'E8 C2 09 E8 FF'
    #/patch

    #patch [FOV]
        HEX @0x00812636 = '51 FF 35 F4 FF F7 02 D9 04 24 D8 35 DF AE 4A 00 D9 1D F0 FF F7 02 DF 41 74 DA 71 70 D9 05 F0 FF F7 02 DE F1 D9 E8 D9 F3 D8 0D D4 50 81 00 D8 0D DC 4E 81 00 50 D9 1C 24 E8 8D B0 D3 FF 59 C2 04 00'
        HEX @0x00812639 = 4x00000004
        HEX @0x00812648 = 4x00000000
        HEX @0x00812654 = 4x00000000
        HEX @0x004AAEE3 = 'E8 4E 77 36 00'
        HEX @0x004C6CA9 = 'E8 88 B9 34 00'
        HEX @0x004C8E7E = 'E8 B3 97 34 00'
        HEX @VFOV = 4x00000004
        VFOV = FLOAT @SYSTEMPACK:PARAMETERS:VerticalFOV
    #/patch

    #patch [SPAWN_INSERTRANGE]
        FLOAT @0x008972FC = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTRANGE
    #/patch
    
    #patch [SPAWN_REMOVERANGE]
        FLOAT @0x00897300 = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_REMOVERANGE
    #/patch
    
    #patch [SPAWN_INSERTTIME_MAX]
        FLOAT @0x008972F8 = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTTIME_MAX
    #/patch

    #patch [ZNORESTHREAD]
        IF BOOL @SYSTEMPACK:DEBUG:ZNORESTHREAD
            HEX @0x0055BEB5 = '90'
        END
    #/patch
    
    #patch [SaveGameToASCII]
        IF BOOL @UNION:GAME:SaveGameToASCII
            HEX @0x00661B36 = '00'
        END
    #/patch
    
    #patch [SendMessage - BroadCast fix]    
        INT hWindow     = FindWindow(NULL, "[zSpy]")
        INT @0x0044DF72 = hWindow
        INT @0x0044F494 = hWindow
        INT @0x0044E0CE = hWindow
    #/patch
    
    #patch [NumLockDisable]
        IF BOOL @SYSTEMPACK:DEBUG:NumLockDisable
            HEX @0x0042832C = 'EB 20'
        END
    #/patch

    #patch [Rain particle collisions]
        IF BOOL @SYSTEMPACK:PARAMETERS:RainVobCollision
            INT @0x005D6AD5 = 736
        END
    #/patch

    #patch [REMOVE OVERLAYMDS fix]    
        HEX @0x0066C5C6 = '74 49'
    #/patch

    #patch [Exit VDFS]
        HEX @0x0042748C = 'FF 15 AC 34 81 00 6A 00 E8 F1 41 39 00'
    #/patch
  
    #patch [Hide original splash]
        INT nBegin1  = 0x00506892
        INT nEnd1    = 0x005068AF
        INT nLength1 = nEnd1 - nBegin1
        MemSet(nBegin1, '90', nLength1)
        
        INT nBegin2  = 0x004283A1
        INT nEnd2    = 0x004283A6
        INT nLength2 = nEnd2 - nBegin2
        MemSet(nBegin2, '90', nLength2)
    #/patch

    #patch [Allow undeclarated instances]
        HEX @0x005A690C = 'E9 A1 00 00 00 90'
    #/patch

    #patch [Line cache size]
        INT CacheSize = INT @SYSTEMPACK:DEBUG:LineCacheSize
        INT @0x0050EA48 = CacheSize
        INT @0x0050EA42 = CacheSize * 20
    #/patch
    
    #patch [UnequipItem]
        HEX @0x006C08FC = '68 00 00 00 40 8B CE E8 38 F0 FD FF 56 8B CB E8 60 FB FF FF'
        HEX @0x006C0041 = '68 00 00 00 40 8B CE E8 D3 F8 FD FF 85 C0 74 21 56 8B CF E8 F7 FA FF FF 85 C0 75 15'
    #/patch

    #patch [SAVEDAT IN ASCII]
        IF BOOL @UNION:GAME:SaveDATinASCII
            HEX @0x00661D5A = '01'
        END
    #/patch

    #patch [oCNpc::SetFlag Fix]
        HEX @0x006BEAFA = '0B'
    #/patch

    #patch [Dialog Starvation Fix]
        HEX @0x00796575 = 'D9 EA 90 90 90 90'
        HEX @0x007965E6 = 'D9 EA 90 90 90 90'
        HEX @0x00796665 = 'D9 EA 90 90 90 90'
        HEX @0x007966CF = 'D9 EA 90 90 90 90'
    #/patch

    #patch [prolog]
        HEX @0x00812F90 = '6A FF 68 61 0F 80 00 64 A1 00 00 00 00 50 64 89 25 00 00 00 00 83 EC 1C 53 55 56 8B F1 57 8D 9E F0 09 00 00 31 ED E9 53 8C EA FF'
        HEX @0x00812FBB = '6A FF 68 98 E0 7F 00 64 A1 00 00 00 00 50 64 89 25 00 00 00 00 51 55 56 8B F1 57 89 74 24 0C E8 05 00 00 00 E9 D0 5A E8 FF C3'
    #/patch
    
    #patch [F3 - SetForegroundWindow]
        HEX @0x00668554 = 'FF 35 D4 50 8B 00 E9 86 AA 1A 00'
        HEX @0x00812FE5 = 'FF 15 50 34 81 00 C3'
    #/patch

    #patch [Anisotropic_Filtering]
        IF BOOL @SYSTEMPACK:PARAMETERS:AnisotropicFiltering !=0
            HEX @0x00812F70 = '8B 45 00 68 10 00 00 00 6A 14 57 8B CD FF 90 48 01 00 00 8B 45 00 6A 03 E9 BB 98 F3 FF 90 90 90'
            HEX @0x0074C826 = '6A 05 6A 0F 57 8B CD FF 90 48 01 00 00 8B 55 00 6A 03 6A 10 57 8B CD FF 92 48 01 00 00 E9 28 67 0C 00'
            HEX @0x00755F13 = '6A 05 6A 0F 6A 00 FF 90 48 01 00 00 8B 16 6A 03'
            HEX @0x00812F74 = LIM(2,INT @SYSTEMPACK:PARAMETERS:AnisotropicFiltering,16)
        END
    #/patch

    #patch [CS Player crash fix]
        INT begin = 0x004213A0
        INT length = 0x00421626 - begin
        MemSet(begin, '90', length)
    #/patch
  
    #patch [Sliding fix]
        FLOAT @5x00000000 = FLOAT @UNION:DEBUG:SlidingSize
        INT   @0x005B0326 = 5x00000000
    #/patch

    #patch [Fix 1px cutline in zCView objects]
        HEX @0x00736D77 = '41'
        HEX @0x00736DB3 = '42'
        HEX @0x00736CF8 = '00'
        HEX @0x00736D0B = '00'
        HEX @0x005CC0F0 = '40'
        HEX @0x005CC0F7 = '41'
    #/patch

    #patch [CastSpecificSpell - SetAsPlayer fix]
        HEX @0x00489B87 = '90 90 90 90 90 90'
        HEX @0x00489BCE = 'E9 A4 8A 38 00'
        HEX @0x00812677 = 'E8 B4 C9 DF FF 8B 4D 34 E8 3C E8 EB FF 8B 4D 40 E8 84 1E EC FF E9 42 75 C7 FF'
    #/patch

    #patch [Fix double spawn for summons]
        HEX @0x00706F15 = '90 90 90 90 90 90 90 90 90 90'
    #/patch

    #patch [GetSpellItem leak fix]
        HEX @0x0078C3CA = '90 90 90'
    #/patch

    #patch [zCView::PrintCY fix]
        HEX @0x0073A9FB = '90'
        HEX @0x0073A9FC = Call(0x0073A9FC, 0x00718810)
    #/patch

    #patch [CompatData fix]
        IF BOOL @SYSTEMPACK:DEBUG:BorderFix
            INT address = ImportSymbol("ddraw.dll", "SetAppCompatData")
            IF address != 0
                HEX @impSetAppCompatData = address 
                impSetAppCompatData(12, 0)
            END
        END
    #/patch

    #patch [Fix crash while transforming in water]
        #assembler [0x00512316]
            push ecx
            mov ecx, [ecx+00A8h] ; homeWorld
            cmp ecx, 0
            pop ecx
            je 0x00512CA8
            orgcode
        #/assembler
    #/patch
#/engine

#engine [G2]

    #patch [GLOBAL DATA]
        AllocPage(1, 0x10000)  //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(2, 0x30000)  //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(3, 0x10000)  //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(4, 0x100)    //FOV; DrawDistanceMultiplier; Interface scaling
        AllocPage(5, 0x100000) //s_posCacheList
        AllocPage(6, 0x1000)   //Polish
        AllocPage(7, 0x100)    //DS for sliding fix and etc
        
        OptionDef(BOOL  @UNION:GAME:SaveGameToASCII,                            0)
        OptionDef(BOOL  @UNION:GAME:SaveDATinASCII,                             1)
        OptionDef(BOOL  @UNION:DEBUG:ReadBinkWithVDFS,                          true)
        OptionDef(BOOL  @UNION:DEBUG:UseErrorVisuals,                           false)
        OptionDef(BOOL  @UNION:DEBUG:FixBink,                                   true)
        OptionDef(BOOL  @Union:Core:CustomDebugWindowPos,                       false)
        OptionDef(BOOL  @Union:Core:DebugWindowPosX,                            0)
        OptionDef(BOOL  @Union:Core:DebugWindowPosY,                            0)
        OptionDef(BOOL  @Union:Core:UseDebugWindowHost,                         0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BorderFix,                            1)
        OptionDef(INT   @SYSTEMPACK:DEBUG:dwNumVertices,                        8192)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Disable_D3DVBCAPS_WRITEONLY,          1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:SimpleWindow,                         1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BorderlessWindow,                     0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:WindowPosX,                           0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:WindowPosY,                           0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:ZNORESTHREAD,                         1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Game_InitEngIntl,                     1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:StrafeBug,                            0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Show_FPS_Counter,                     0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:Cache_Timeout,                        400)
        OptionDef(INT   @SYSTEMPACK:DEBUG:LineCacheSize,                        16384)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Polish_version,                       0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:TerminateProcessHotkey,               true)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AnisotropicFiltering,            0)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:VerticalFOV,                     67.5)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:NewFOVformula,                   0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:DisableLOD,                      0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:DisableIndoorClipping,           1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTRANGE,               4500)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_REMOVERANGE,               5000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTTIME_MAX,            1000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SmoothAniDistance,               5000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:DrawDistanceMultiplier,          1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:OutDoorPortalDistanceMultiplier, 1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:InDoorPortalDistanceMultiplier,  1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HideFocus,                       1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:InteractionCollision,            1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:RainVobCollision,                1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AbortMenuSound,                  1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance,           false)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_LowerFPS,  55)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_UpperFPS,  60)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_ShowInfo,  false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:VisualizePerfomance,             false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HeightCorrectionOnLadder,        1)
        OptionDef(FLOAT @SYSTEMPACK:INTERFACE:Scale,                            1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:DialogBoxX,                       800)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:DialogBoxY,                       600)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:SubtitlesBoxX,                    600)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ShowManaBar,                      1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ShowSwimBar,                      1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:HideHealthBar,                    0)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:NewChapterSizeX,                  800)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:NewChapterSizeY,                  600)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:SaveGameImageSizeX,               320)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:SaveGameImageSizeY,               200)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:InventoryCellSize,                70)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_DialogChoice_Active,        -1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_DialogChoice_Inactive,      -6316129)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_Talk_Hero,                  -1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_Talk_NPC,                   -256)
        OptionDef(BOOL  @SYSTEMPACK:INTERFACE:Hide_STR_DEX,                     1)
        OptionDef(FLOAT @SYSTEMPACK:SUBTITLES:TimeMultiplier,                   1.0)
        OptionDef(FLOAT @UNION:DEBUG:SlidingSize,                               0.05)
    #/patch
    
    #patch [PerceptionCheck - crash fix]
        HEX @0x006FF163 = '89 F3 90 90'
    #/patch

    #patch [SendMessage - BroadCast fix]
        INT hWindow     = FindWindow(NULL, "[zSpy]")
        INT @0x0044BE8A = hWindow
        INT @0x0044D250 = hWindow
        INT @0x0044BFDF = hWindow
    #/patch

    #patch [Gothic.ini fixes]
        IF !BOOL @GAME:INTERNAL:extendedMenu
            BOOL @GAME:INTERNAL:extendedMenu = 1
        END
        IF  INT @GAME:VIDEO:zVidResFullscreenBPP != 32
            INT @GAME:VIDEO:zVidResFullscreenBPP = 32
        END
        IF  INT @GAME:ENGINE:zTexCacheSizeMaxBytes < 100000000
            INT @GAME:ENGINE:zTexCacheSizeMaxBytes = 100000000
        END
        IF !BOOL @GAME:INTERNAL:menuShowVersion
            BOOL @GAME:INTERNAL:menuShowVersion = 1
        END
        IF  BOOL @GAME:INTERNAL:gameStartFailed == 1
            BOOL @GAME:INTERNAL:gameStartFailed = 0
        END
        IF  BOOL @GAME:INTERNAL:gameAbnormalExit == 1
            BOOL @GAME:INTERNAL:gameAbnormalExit = 0
        END
    #/patch

    #patch [GameVersion]
        HEX @0x0088F748  = 4x00000024
        HEX @GameVersion = 4x00000024
        HEX hVersion     = GetUnionVersion()
        GameVersion      = "Union " + hVersion
    #/patch
    
    #patch [D3DIM700.dll - removes 2048 pixel limit]
        HEX hModuleName = "D3DIM700.dll"
        INT nModuleBase = ModuleBase (hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize (hModuleName)
            FindAndReplace (HEX 'B8 00 08 00 00 39', 'B8 00 80 00 00 39', nModuleBase, nModuleSize)
        END
    #/patch
    
    #patch [AcGenral.dll - Windows 7 rundll32.exe bugfix]
        HEX hModuleName = "AcGenral.dll"
        INT nModuleBase = ModuleBase (hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize (hModuleName)
            FindAndReplace (HEX '68 28 09 00 00', 'C2 04 00 90 90', nModuleBase, nModuleSize)
        END
    #/patch
    
    #patch [ALPHA_VOB and ALPHA_WORLD_POLY]
        HEX @0x00525DCA = '68 00 0C 00 00'
        HEX @0x00525EF1 = '68 00 0C 00 00'
        HEX @0x0052A33C = '3D 00 0C 00 00'
        HEX @0x00525F2F = '81 FB 00 0C 00 00'
        HEX @0x00525DD2 = 1x00000000
        HEX @0x00525EFB = 1x00000000
        HEX @0x00525FED = 1x00000000
        HEX @0x0052A3BB = 1x00000000
        HEX @0x00526196 = 1x0000000C
        HEX @0x005261BD = 1x0000000C
        HEX @0x005261F6 = 1x0000000C
        HEX @0x0052621D = 1x0000000C
        HEX @0x00528F7C = 1x0000000C
        HEX @0x00528FA3 = 1x0000000C
        HEX @0x0052A3B4 = 1x0000000C
        HEX @0x005D032A = '68 00 26 00 00'
        HEX @0x005D03A1 = '68 00 26 00 00'
        HEX @0x005D042F = '81 FB 00 26 00 00'
        HEX @0x005D0332 = 2x00000000
        HEX @0x005D03AB = 2x00000000
        HEX @0x005D04ED = 2x00000000
        HEX @0x005263D0 = 3x00000000
        HEX @0x00526467 = 3x00000000
        HEX @0x005275EA = 3x00000000
        HEX @0x0052B739 = 3x00000000
        HEX @0x0052B74E = 3x00000000
        HEX @0x0052B765 = 3x00000000
        HEX @0x0052D03F = 3x00000000
        HEX @0x0052D064 = 3x00000000
        HEX @0x0052D08B = 3x00000000
        HEX @0x0052D83D = 3x00000000
        HEX @0x005263DC = 3x0000B000
        HEX @0x00526452 = 3x0000B000
        HEX @0x00526460 = 3x0000B000
        HEX @0x005275D1 = 3x0000B000
        HEX @0x005275DF = 3x0000B000
        HEX @0x0052B77D = 3x0000B000
        HEX @0x0052D0B7 = 3x0000B000
        HEX @0x0052D838 = 3x0000B000
        HEX @0x0052D84A = 3x0000B000
        HEX @0x0052D84F = 3x0000B004
    #/patch
    
    #patch [FOV]
        HEX @0x0081FEA6 = 'CC CC DF 44 24 44 DA 74 24 40 D9 1D 00 00 F6 02 55 89 5C 24 08 E9 80 BE F4 FF CC CC'
        HEX @0x0081FF5B = '51 FF 35 04 00 F6 02 D9 04 24 D8 35 EE 4F 54 00 D9 1D 08 00 F6 02 D9 05 00 00 F6 02 D9 05 08 00 F6 02 DE F1 D9 E8 D9 F3 D8 0D 8C 22 82 00 D8 0D 84 20 82 00 50 D9 1C 24 E8 A8 57 D2 FF 59 C2 04 00'
        HEX @0x0081FEB2 = 4x00000000
        HEX @0x0081FF5E = 4x00000004
        HEX @0x0081FF6D = 4x00000008
        HEX @0x0081FF73 = 4x00000000
        HEX @0x0081FF79 = 4x00000008
        HEX @0x0076BD3B = 'E9 68 41 0B 00'
        HEX @0x004BE753 = 'E8 03 18 36 00'
        HEX @0x004C09F5 = 'E8 61 F5 35 00'
        HEX @0x00544FF4 = 'E8 62 AF 2D 00'
        HEX @VFOV = 4x00000004
        VFOV = FLOAT @SYSTEMPACK:PARAMETERS:VerticalFOV
    #/patch

    #patch [MAP - 4:3 aspect ratio]
        HEX @0x0081FEF3 = 'CC CC 8B 02 83 EC 0C 85 C0 53 55 56 8B F1 89 46 30 8B 4A 04 57 89 4E 34 BD 01 00 00 00 7F 03 89 6E 30 8B 46 34 85 C0 7F 03 89 6E 34 33 C0 33 C9 89 46 40 89 4E 44 8B 46 4C 85 C0 0F 84 F0 22 F8 FF 8B 56 30 89 56 40 8B 46 34 89 46 44 8B 4E 4C 8B 56 30 DF 41 44 D8 35 8F 65 66 00 50 DB 1C 24 58 E9 A7 22 F8 FF CC CC'
        HEX @0x007719CC = 'E8 24 E5 0A 00'
    #/patch

    #patch [DrawDistanceMultiplier]
        HEX @0x005E30F0 = 'D8 1D D4 26 82 00'
        HEX @0x0042808A = 4x0000000C
        HEX @DrawDistanceMultiplier = 4x0000000C
        DrawDistanceMultiplier = LIM(0.01, (FLOAT @SYSTEMPACK:PARAMETERS:DrawDistanceMultiplier * 0.01), 0.26)
    #/patch

    #patch [zPM_NUM_VBUFFER_VERT 65535]
        HEX @0x005C2E43 = LIM(4096, INT @SYSTEMPACK:DEBUG:dwNumVertices, 65535)
    #/patch

    #patch [DisableLOD]
        IF BOOL @SYSTEMPACK:PARAMETERS:DisableLOD
            FLOAT @0x00824A0C = 0.0
        END
    #/patch

    #patch [D3DVBCAPS_WRITEONLY]
        IF BOOL @SYSTEMPACK:DEBUG:Disable_D3DVBCAPS_WRITEONLY
            HEX @0x0076A407 = '4C 24 1C 00 00 00 00'
        END
    #/patch
    
    #patch [ZNORESTHREAD]
        IF BOOL @SYSTEMPACK:DEBUG:ZNORESTHREAD
            HEX @0x00553B19 = '90'
        END
    #/patch

    #patch [Game_InitEnglish to Game_InitEngIntl]
        IF BOOL @SYSTEMPACK:DEBUG:Game_InitEngIntl
            HEX @0x008A06A4 = '47 61 6D 65 5F 49 6E 69 74 45 6E 67 49 6E 74 6C'
        END
    #/patch

    #patch [Model Clipping]
        HEX @0x0052CE21 = 'C7 44 24 24 F0 23 74 44'
        HEX @0x00545DFF = 'C7 44 24 20 00 00 00 BF'
    #/patch

    #patch [s_posCacheList]
        HEX s_posCacheList = 5x00000000
        FindAndReplace(HEX '78 03 95 00', s_posCacheList, ModuleBase(Null), ModuleSize(Null))
    #/patch
    
    #patch [NUM_POS_CACHE 524288]
        HEX @0x005C36EF = '81 7E 38 00 00 08 00'
    #/patch

    #patch [DisableIndoorClipping]
        IF BOOL @SYSTEMPACK:PARAMETERS:DisableIndoorClipping
            HEX @0x00546F54 = '7A 00'
        END
    #/patch

    #patch [SPAWN_INSERTRANGE]
        FLOAT @0x008A6EB8 = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTRANGE
    #/patch
    
    #patch [SPAWN_REMOVERANGE]
        FLOAT @0x008A6EBC = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_REMOVERANGE
    #/patch
    
    #patch [SPAWN_INSERTTIME_MAX]
        FLOAT @0x008A6EB4 = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTTIME_MAX
    #/patch
    
    #patch [OutDoorPortalDistanceMultiplier]
        FLOAT @0x0052C30E = FLOAT @SYSTEMPACK:PARAMETERS:OutDoorPortalDistanceMultiplier * 3240000
        FLOAT @0x0052C316 = FLOAT @SYSTEMPACK:PARAMETERS:OutDoorPortalDistanceMultiplier * 3240000 - 1800000
    #/patch
    
    #patch [InDoorPortalDistanceMultiplier]
        FLOAT @0x00531549 = FLOAT @SYSTEMPACK:PARAMETERS:InDoorPortalDistanceMultiplier * 3240000
        FLOAT @0x00531551 = FLOAT @SYSTEMPACK:PARAMETERS:InDoorPortalDistanceMultiplier * 3240000 - 1800000
    #/patch
    
    #patch [SubtitlesBoxX]
        HEX @0x00666339 = INT @SYSTEMPACK:INTERFACE:SubtitlesBoxX
    #/patch

    #patch [ShowManaBar]
        IF INT @SYSTEMPACK:INTERFACE:ShowManaBar == 0
            HEX @0x0066692A = 'E8 B0 58 0E 00'
        END
        IF INT @SYSTEMPACK:INTERFACE:ShowManaBar == 2
            HEX @0x006668EC = 'EB 14'
        END
    #/patch

    #patch [ShowSwimBar]
        IF INT @SYSTEMPACK:INTERFACE:ShowSwimBar == 0
            HEX @0x00666873 = 'E8 67 59 0E 00'
        END
        IF INT @SYSTEMPACK:INTERFACE:ShowSwimBar == 2
            HEX @0x00666844 = 'EB 04 90 90 90 90'
        END
    #/patch

    #patch [HideHealthBar]
        IF INT @SYSTEMPACK:INTERFACE:HideHealthBar == 1
            HEX @0x0066676C = 'E8 6E 5A 0E 00'
        END
    #/patch

    #patch [NewChapterSizeX]
        HEX @0x0042AFEB = INT @SYSTEMPACK:INTERFACE:NewChapterSizeX
    #/patch

    #patch [NewChapterSizeY]
        HEX @0x0042AFFC = INT @SYSTEMPACK:INTERFACE:NewChapterSizeY
    #/patch

    #patch [SaveGameImageSizeX]
        HEX @0x0066582D = INT @SYSTEMPACK:INTERFACE:SaveGameImageSizeX
    #/patch

    #patch [SaveGameImageSizeY]
        HEX @0x00665841 = INT @SYSTEMPACK:INTERFACE:SaveGameImageSizeY
    #/patch
    
    #patch [InventoryCellSize]
        IF INT @SYSTEMPACK:INTERFACE:InventoryCellSize != 70
            HEX @0x006AACFC = 'E9 CA B6 F1 FF 90'
            HEX @0x006AAD1A = 'E9 BA B6 F1 FF 90 90'
            HEX @0x005C63CB = '68 46 00 00 00 8B CF FF 12 E9 29 49 0E 00 68 46 00 00 00 8B CF FF 50 04 E9 39 49 0E 00'
            HEX @0x005C63CC = LIM(10, INT @SYSTEMPACK:INTERFACE:InventoryCellSize, 9999)
            HEX @0x005C63DA = LIM(10, INT @SYSTEMPACK:INTERFACE:InventoryCellSize, 9999)
        END
    #/patch

    #patch [Subtitles]
        IF BOOL @SYSTEMPACK:SUBTITLES:Control
            FLOAT @0x0081FFAD = FLOAT @SYSTEMPACK:SUBTITLES:TimeMultiplier
            HEX   @0x006F9858 = 'E9 54 67 12 00'
            HEX   @0x0081FFB1 = '8B CD FF 50 30 D8 0D AD FF 81 00 E9 9C 98 ED FF'
        END
    #/patch

    #patch [Disable endless VISEME after getting hit]
        HEX @0x00790E03 = '68 00 00 80 BF 68 00 00 00 40'
    #/patch

    #patch [MAP_Delay_BUGFIX]
        HEX @0x00771D1E = 'E8 11 01 00 00'
    #/patch

    #patch [Not equip a bow/crossbow together]
        HEX @0x006E752F = 'E8 0C EE ED FF'
        HEX @0x005C6340 = '8B 44 24 04 83 F8 04 53 55 56 57 8B F9 75 75 8D AF DC 05 00 00 8B CD E8 34 B7 0E 00 8B CD E8 FD 84 0E 00 33 DB 85 C0 89 44 24 14 7E 57 53 8B CD E8 FB 85 0E 00 8B F0 56 8B CF E8 81 D1 10 00 85 C0 74 19 6A 04 8B CE E8 94 E5 0E 00 85 C0 74 0C 56 8B CF E8 78 7B 11 00 85 C0 75 10 8B 44 24 14 43 3B D8 7C C8 5F 5E 5D 5B C2 04 00 8B CE 68 00 00 00 40 E8 68 E5 0E 00 85 C0 75 08 8B CF 56 E8 8C 57 11 00 5F 5E 5D 5B C2 04 00'
    #/patch

    #patch [BorderlessWindow]
        IF BOOL @SYSTEMPACK:DEBUG:BorderlessWindow
            HEX @0x0050052F = '68 00 00 00 90'
            HEX @0x00500544 = '68 00 00 00 00'
            HEX @0x00629456 = '31 C9 41 90'
            HEX @0x00500527 = 'E9 1F 4B 28 00'
            HEX @0x0078504B = '05 40 01 00 00 50 68 00 00 00 00 68 00 00 00 00 E9 CF B4 D7 FF'
            HEX @0x00785057 = INT @SYSTEMPACK:DEBUG:WindowPosX
            HEX @0x00785052 = INT @SYSTEMPACK:DEBUG:WindowPosY
            HEX @0x004FDE90 = 'C3'
        END
    #/patch

    #patch [FOV_New_Formula]
        IF BOOL @SYSTEMPACK:PARAMETERS:NewFOVformula
            HEX @0x0081FF65 = 'D8 35 84 20 82 00 D8 35 8C 22 82 00 D9 F2 DD D8 D8 35 04 00 3B 01 D9 E8 D9 F3 D8 0D 8C 22 82 00 D8 0D 84 20 82 00 50 D9 1C 24 E8 AC 57 D2 FF 59 C2 04 00 90 90 90 90'
            HEX @0x0081FF77 = 4x00000000
        END
    #/patch

    #patch [Interface scaling]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @Scale = 4x00000014
            Scale = LIM (1.0,FLOAT @SYSTEMPACK:INTERFACE:Scale,9999)
            HEX @0x0077DE60 = 'E9 10 03 00 00 DB 44 E4 0C DA 35 21 57 40 00 D8 15 00 00 F1 02 DF E0 F6 C4 41 7F 0C DD D8 68 1D 9A 81 00 E9 9F DE FE FF D9 1D 00 00 F1 02 EB EE'
            HEX @0x0076BD22 = 'E9 3E 21 01 00'
            HEX @0x0077DE71 = 4x00000014
            HEX @0x0077DE8A = 4x00000014
            HEX @0x0077DE90 = '0F B6 54 08 1C 52 DB 04 E4 D8 0D 00 00 F9 02 DB 1C E4 8B 14 E4 89 34 E4 E9 B5 CA FA FF'
            HEX @0x0072A95C = 'E9 2F 35 05 00'
            HEX @0x0077DE9B = 4x00000014
            HEX @0x0077DEAD = 'DB 41 14 D8 0D 00 00 F9 02 DB 1D 04 00 F9 02 A1 04 00 F9 02 C3 A3 04 00 F9 02 DB 05 04 00 F9 02 D8 0D 00 00 F9 02 DB 1D 04 00 F9 02 A1 04 00 F9 02 C2 04 00'
            HEX @0x00729AA0 = 'E9 08 44 05 00'
            HEX @0x00729AD8 = 'E9 E5 43 05 00'
            HEX @0x00729AEA = 'E9 D3 43 05 00'
            HEX @0x0077DEB2 = 4x00000014
            HEX @0x0077DEB8 = 4x00000018
            HEX @0x0077DEBD = 4x00000018
            HEX @0x0077DEC3 = 4x00000018
            HEX @0x0077DEC9 = 4x00000018
            HEX @0x0077DECF = 4x00000014
            HEX @0x0077DED5 = 4x00000018
            HEX @0x0077DEDA = 4x00000018
            HEX @0x0077DEE1 = 'D8 0D 00 00 FA 02 E9 9C 6B 04 00'
            HEX @0x0077DEE3 = 4x00000014
            HEX @0x004D9A47 = 'E9 A0 44 2A 00 90 90 90'
            HEX @0x0077DEEC = 'DA 0D BD 82 4D 00 E8 EA FF FF FF DB 05 BD 82 4D 00 D8 0D 00 00 F9 02 E9 4A BB D5 FF'
            HEX @0x0077DEFF = 4x00000014
            HEX @0x0077DF08 = '83 EC 24 56 8B F1 8B 46 60 85 C0 57 74 75 8D 48 54 8B 01 8D 54 24 10 52 FF 50 18 8B 78 10 8B 46 60 8D 48 54 8B 01 8D 54 24 10 52 FF 50 18 8B 4E 4C 85 C9 8B 40 14 74 4B 85 FF 8B 51 40 8B 49 44 7E 41 3B FA 7D 3D 85 C0 7E 39 3B C1 7D 35 8D 54 24 08 8B CE 89 7C 24 08 89 44 24 0C DB 44 E4 08 D8 0D 00 00 C5 07 DB 5C E4 08 DB 44 E4 0C D8 0D 00 00 C5 07 DB 5C E4 0C E8 2B 44 02 00 5F 5E 83 C4 24 C3 E9 47 40 FF FF'
            HEX @0x0077DF6A = 4x00000014
            HEX @0x0077DF78 = 4x00000014
            HEX @0x00771998 = 'E8 6B C5 00 00'
            HEX @0x0077DF90 = 'E8 8B 2D FC FF DB 02 D8 0D 00 00 E2 02 DB 1A E9 4E EF EF FF E8 77 2D FC FF DB 01 D8 0D 00 00 E2 02 DB 19 E9 52 EF EF FF'
            HEX @0x0077DF99 = 4x00000014
            HEX @0x0077DFAD = 4x00000014
            HEX @0x0067CEED = 'E9 9E 10 10 00 8D 44 24 10 50 8B CE E8 22 3E 0C 00 8D 4C 24 0C 51 8B CE E9 9A 10 10 00'
            HEX @0x0077DFB8 = '68 80 02 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 21 D0 CA FF 68 E0 01 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 1C D0 CA FF 68 80 02 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 41 86 FF FF 68 E0 01 00 00'
            HEX @0x0077DFFF = 'DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 3A 86 FF FF 68 58 02 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 17 83 EE FF 68 40 01 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 F5 77 EE FF 68 C8 00 00 00 DB 04 E4 D8 0D 00 00 FE 02 DB 1C E4 E9 F3 77 EE FF'
            HEX @0x0077DFC2 = 4x00000014
            HEX @0x0077DFD8 = 4x00000014
            HEX @0x0077DFEE = 4x00000014
            HEX @0x0077E004 = 4x00000014
            HEX @0x0077E01A = 4x00000014
            HEX @0x0077E030 = 4x00000014
            HEX @0x0077E046 = 4x00000014
            HEX @0x0042AFEA = 'E9 C9 2F 35 00'
            HEX @0x0042AFFB = 'E9 CE 2F 35 00'
            HEX @0x0066582C = 'E9 F5 87 11 00'
            HEX @0x00665840 = 'E9 F7 87 11 00'
            HEX @0x00666338 = 'E9 D3 7C 11 00'
            HEX @0x00776636 = 'E9 A9 79 00 00'
            HEX @0x00776645 = 'E9 B0 79 00 00'
            HEX @0x006AACD1 = 'E8 0B 32 0D 00 A3 A0 1A 98 00 8B 07 6A 46 8B CF FF 50 04 89 44 24 10 DB 44 24 10 D8 4C 24 0C E8 93 9D 11 00 A3 9C 1A 98 00 8B 17 6A 46 8B CF FF 12 89 44 24 10 DB 44 24 10 D8 4C 24 08 E8 CE 31 0D 00 A3 F4 1A 98 00 8B 07 6A 46 8B CF FF 50 04 89 44 24 10 DB 44 24 10 D8 4C 24 0C E8 AF 31 0D 00'
            HEX @0x0077E052 = '68 B4 00 00 00 DB 04 E4 D8 0D 00 00 B5 07 DB 1C E4 FF 12 8B 0D B0 5F 98 00 A3 5C 4A 8B 00 8B 01 6A 14 DB 04 E4 D8 0D 00 00 B5 07 DB 1C E4 E9 BF EF CB FF 6A 1E DB 04 E4 D8 0D 00 00 55 01 DB 1C E4 FF 52 04 E9 FC 83 EE FF 68 BE 00 00 00 DB 04 E4 D8 0D 00 00 55 01 DB 1C E4 E9 6E 84 EE FF 6A 10 DB 04 E4 D8 0D 00 00 55 01 DB 1C E4 FF 10 8B 8E 8C 03 00 00 89 86 14 04 00 00 8B 11 6A 10 DB 04 E4 D8 0D 00 00 55 01 DB 1C E4 E9 1E 33 D6 FF'
            HEX @0x0077E05C = 4x00000014
            HEX @0x0077E079 = 4x00000014
            HEX @0x0077E08C = 4x00000014
            HEX @0x0077E0A5 = 4x00000014
            HEX @0x0077E0B8 = 4x00000014
            HEX @0x0077E0D6 = 4x00000014
            HEX @0x0043D02E = 'E9 1F 10 34 00'
            HEX @0x004E13EC = 'E9 C0 CC 29 00 90 90 90 90 90'
            HEX @0x00666492 = 'E9 EE 7B 11 00'
            HEX @0x0066651A = 'E9 7C 7B 11 00'
            HEX @0x0077DFE4 = '68 20 03 00 00'
            HEX @0x0077DFFA = '68 58 02 00 00'
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale ==1
            HEX @0x0076BD22 = 'E9 BB 23 01 00'
            HEX @0x0077E0E2 = '81 7C E4 0C 00 03 00 00 0F 8D 75 FD FF FF D9 E8 E9 91 FD FF FF'
            HEX @0x0077DE7A = 'EB 0C'
            HEX @0x0077DE69 = 'DA 35 E4 17 41 00'
        END
    #/patch

    #patch [DialogBoxX]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale < 1.0
            HEX @0x00776637 = INT @SYSTEMPACK:INTERFACE:DialogBoxX
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @0x0077DFE5 = INT @SYSTEMPACK:INTERFACE:DialogBoxX
        END        
    #/patch

    #patch [DialogBoxY]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale < 1.0
            HEX @0x00776646 = INT @SYSTEMPACK:INTERFACE:DialogBoxY
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @0x0077DFFB = INT @SYSTEMPACK:INTERFACE:DialogBoxY
        END
    #/patch
    
    #patch [Disable using map when the hero has become a monster]
        HEX @0x0069EABD = 'E8 2E 51 04 00'
    #/patch
    
    #patch [Disable using of weapons when the hero uses an anvil]
        HEX @0x006ED467 = 'E8 8B 0C 09 00'
        HEX @0x0077E0F7 = '80 B9 E0 06 00 00 10 74 05 E9 EB FD F6 FF B8 01 00 00 00 C2 04 00'
        HEX @0x0063BA8D = 'EB 1F'
    #/patch

    #patch [The last used scroll gives full damage]
        HEX @0x0077E18C = 'E9 7C FF FF FF'
        HEX @0x0077E10D = 'E8 EE C3 F5 FF 83 F8 00 0F 84 10 0B 00 00 EB 74'
    #/patch

    #patch [No_Interrupt_Interact_ANI]
        HEX @0x007855B2 = 'E9 E0 F9 FF FF'
        HEX @0x00784F92 = 'E9 0B 06 00 00 80 B9 E0 06 00 00 0E 0F 84 2F 06 00 00 E8 57 55 F5 FF E9 09 06 00 00 90 90'
    #/patch

    #patch [AttackRun_fix]
        HEX @0x006F2B77 = 'E8 34 24 09 00'
        HEX @0x00784FB0 = '39 35 DC 31 98 00 0F 84 34 91 EB FF C2 04 00'
    #/patch

    #patch [Block the hero move in the menu]
        HEX @0x004268BD = 'E8 52 E7 35 00'
        HEX @0x00785014 = '81 7C E4 14 1A 9A 47 00 74 0E 81 7C E4 20 36 A0 4D 00 0F 85 44 49 F5 FF C7 44 E4 04 01 00 00 00 E9 37 49 F5 FF'
    #/patch

    #patch [FIST mode turns off correctly by pressing "1" button]
        HEX @0x0069F074 = 'E9 61 5F 0E 00'
        HEX @0x00784FDA = 'E8 71 09 E2 FF 83 C4 0C 89 74 24 14 C6 84 24 B8 00 00 00 05 3B F3 0F 84 F2 A0 F1 FF 53 53 6A 03 8B CE'
        HEX @0x00784FFC = 'E8 8F 22 F8 FF 89 C6 E9 CF A8 F1 FF'
    #/patch

    #patch [Dropped arrows, bolts and torches will be removed after loading save]
        HEX @0x00785008 = '8B 47 30 89 44 E4 04 E9 2C 13 F6 FF'
        HEX @0x006D8EDC = 'E8 27 C1 0A 00'
        HEX @0x006D8F32 = 'E8 D1 C0 0A 00'
    #/patch

    #patch [MOUSE_BUFFER_SIZE 100]
        HEX @0x004D1212 = 'E9 22 3E 2B 00'
        HEX @0x00785039 = 'A1 10 37 8C 00 C7 44 E4 2C 64 00 00 00 E9 CC C1 D4 FF'
    #/patch

    #patch [Hide_Focus_on_EMPTY_DEAD_NPC]
        IF BOOL @SYSTEMPACK:PARAMETERS:HideFocus
            HEX @0x006AF6D4 = '74 05'
            HEX @0x006D5982 = 'E9 93 F7 0A 00'
            HEX @0x0078511A = '81 3F 4C E6 82 00 74 0B 8B 0D 90 12 98 00 E9 5B 08 F5 FF 83 BF A4 01 00 00 00 75 EC 8D 8F DC 05 00 00 E8 3F DC F2 FF 8D 8F DC 05 00 00 6A 01 E8 62 A5 F2 FF 85 C0 74 D0 E9 F2 08 F5 FF'
        END
    #/patch

    #patch [Text Color]
        HEX @0x007A5807 = '90 90 B9 9F 9F 9F FF BA FF FF FF FF'
        HEX @0x006CDD10 = 'C7 05 34 2B 98 00 FF FF FF FF C3 90'
        HEX @0x006CDD30 = 'C7 05 E8 29 98 00 00 FF FF FF C3 90'
        HEX @0x007A580A = INT @SYSTEMPACK:INTERFACE:Color_DialogChoice_Inactive //9F9F9FFF // FF9F9F9F
        HEX @0x007A580F = INT @SYSTEMPACK:INTERFACE:Color_DialogChoice_Active   //FFFFFFFF // FFFFFFFF
        HEX @0x006CDD16 = INT @SYSTEMPACK:INTERFACE:Color_Talk_Hero             //FFFFFFFF // FFFFFFFF
        HEX @0x006CDD36 = INT @SYSTEMPACK:INTERFACE:Color_Talk_NPC              //00FFFFFF // FFFFFF00
    #/patch

    #patch [Close_Inventory_In_NPC]
        HEX @0x0077E100 = 'E9 78 6F 00 00'
        HEX @0x0078507D = '39 35 DC 31 98 00 0F 85 67 8E F6 FF 83 3D 20 33 98 00 01 75 0C E8 69 E5 F7 FF 89 F1 E9 52 8E F6 FF 83 3D 20 33 98 00 02 0F 85 45 8E F6 FF E8 60 E3 F7 FF 89 F1 E9 39 8E F6 FF'
    #/patch

    #patch [Show_FPS]
        IF BOOL @SYSTEMPACK:DEBUG:Show_FPS_Counter
            HEX @0x00424FE9 = 'E9 C9 00 36 00'
            HEX @0x007850B7 = 'A3 DC 13 98 00 C6 80 A4 00 00 00 01 E9 26 FF C9 FF'
        END
    #/patch

    #patch [No_Strafe_while_fall]
        IF BOOL @SYSTEMPACK:DEBUG:StrafeBug
            HEX @0x0063E477 = '00 00'
        END
    #/patch

    #patch [WASD_Menu]
        HEX @0x007850C8 = '83 F8 1F 0F 84 D3 44 D5 FF 83 F8 11 0F 84 97 44 D5 FF 83 F8 1E 0F 84 F4 44 D5 FF 83 F8 20 0F 84 F9 44 D5 FF 83 F8 0F 0F 84 45 44 D5 FF E9 24 44 D5 FF'
        HEX @0x004D9519 = 'E9 AA BB 2A 00'
    #/patch
    
    #patch [F6_Windowed_FreeLook]
        HEX @0x004801F9 = '75 00'
    #/patch

    #patch [JUMP_ANIM_Bug (s_ledgeCache?)]
        HEX @0x005097D5 = '68 C8 00 00 00 EB 06 90 90 90 90 EB F3'
        HEX @0x005097D6 = INT @SYSTEMPACK:DEBUG:Cache_Timeout
    #/patch

    #patch [Unlock armor in trade, in npc]
        HEX @0x006AD45B = '0F 85 00 00 00 00'
        HEX @0x006ADBCC = '75 00'
    #/patch

    #patch [Hide strength and dexterity values in character screen after /]
        IF BOOL @SYSTEMPACK:INTERFACE:Hide_STR_DEX
            HEX @0x007850FA = '8D 54 E4 34 83 7C E4 24 02 52 0F 8F C6 7B CF FF C7 42 0C 00 00 00 00 83 68 0C 01 E9 B6 7B CF FF'
            HEX @0x0047CCCB = 'E9 2A 84 30 00'
        END
    #/patch

    #patch [Anisotropic_Filtering]
        IF BOOL @SYSTEMPACK:PARAMETERS:AnisotropicFiltering !=0
            HEX @0x0075BE9F = '68 10 00 00 00 6A 14 57 FF 92 7C 01 00 00 8B 55 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90'
            HEX @0x0075BEA0 = LIM(2,INT @SYSTEMPACK:PARAMETERS:AnisotropicFiltering,16)
        END
    #/patch

    #patch [SaveGameToASCII]
        IF BOOL @UNION:GAME:SaveGameToASCII
            HEX @0x00668A12 = '00'
        END
    #/patch

    #patch [Polish]
        IF BOOL @SYSTEMPACK:DEBUG:Polish_version
            HEX @POLISH_DATA = 6x00000000
            POLISH_DATA = '00 00 31 32 33 34 35 36 37 38 39 30 2D 3D 00 00 71 77 65 72 74 79 75 69 6F 70 5B 5D 00 00 61 73 64 66 67 68 6A 6B 6C 3B 27 60 00 5C 7A 78 63 76 62 6E 6D 2C 2E 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 21 40 23 24 25 5E 26 2A 28 29 5F 2B 00 00 51 57 45 52 54 59 55 49 4F 50 7B 7D 00 00 41 53 44 46 47 48 4A 4B 4C 3A 22 7E 00 7C 5A 58 43 56 42 4E 4D 3C 3E 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EA 00 00 00 00 00 F3 00 00 00 00 00 B9 9C 00 00 00 00 00 00 B3 00 00 00 00 00 BF 9F E6 00 00 F1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CA 00 00 00 00 00 D3 00 00 00 00 00 A5 8C 00 00 00 00 00 00 A3 00 00 00 00 00 AF 8F C6 00 00 D1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 32 33 34 35 36 37 38 39 30 2D 3D 00 00 51 57 45 52 54 59 55 49 4F 50 5B 5D 00 00 41 53 44 46 47 48 4A 4B 4C 3B 27 60 00 5C 5A 58 43 56 42 4E 4D 2C 2E 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 21 40 23 24 25 5E 26 2A 28 29 5F 2B 00 00 71 77 65 72 74 79 75 69 6F 70 7B 7D 00 00 61 73 64 66 67 68 6A 6B 6C 3A 22 7E 00 7C 7A 78 63 76 62 6E 6D 3C 3E 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CA 00 00 00 00 00 D3 00 00 00 00 00 A5 8C 00 00 00 00 00 00 A3 00 00 00 00 00 AF 8F C6 00 00 D1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EA 00 00 00 00 00 F3 00 00 00 00 00 B9 9C 00 00 00 00 00 00 B3 00 00 00 00 00 BF 9F E6 00 00 F1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
            HEX @0x005C63CB = '4D 59 53 5A 2D 58 00 00 4D 59 53 5A 2D 59 00 00 4B D3 A3 4B 4F 20 57 20 47 D3 52 CA 00 00 00 00 4B D3 A3 4B 4F 20 57 20 44 D3 A3 00 4D 59 53 5A 20 2D 20 4C 45 57 59 00 4D 59 53 5A 20 2D 20 50 52 41 57 59 00 00 00 00 4D 59 53 5A 20 2D 20 8C 52 4F 44 4B 4F 57 59 00 4D 59 53 5A 20 58 31 00 4D 59 53 5A 20 58 32 00 4D 59 53 5A 20 58 33 00 4D 59 53 5A 20 58 34 00 4D 59 53 5A 20 58 35 00 45 53 43 00 46 31 00 00 46 32 00 00 46 33 00 00 46 34 00 00 46 35 00 00 46 36 00 00 46 37 00 00 46 38 00 00 46 39 00 00 46 31 30 00 46 31 31 00 46 31 32 00 46 31 33 00 46 31 34 00 46 31 35 00 50 52 49 4E 54 20 53 43 52 45 45 4E 00 00 00 00 53 43 52 4F 4C 4C 20 4C 4F 43 4B 00 50 41 55 53 45 2F 42 52 45 41 4B 00 49 4E 53 45 52 54 00 00 48 4F 4D 45 00 00 00 00 50 41 47 45 20 55 50 00 44 45 4C 45 54 45 00 00 45 4E 44 00 50 41 47 45 20 44 4F 57 4E 00 00 00 47 D3 52 41 00 00 00 00 4C 45 57 4F 00 00 00 00 44 D3 A3 00 50 52 41 57 4F 00 00 00 4E 55 4D 20 4C 4F 43 4B 00 00 00 00 4E 55 4D 20 55 4B 4F 8C 4E 49 4B 00 4E 55 4D 20 47 57 49 41 5A 44 4B 41 00 00 00 00 4E 55 4D 20 4D 49 4E 55 53 00 00 00 4E 55 4D 20 45 4E 54 45 52 00 00 00 4E 55 4D 20 44 45 4C 00 4E 55 4D 20 30 00 00 00 4E 55 4D 20 31 00 00 00 4E 55 4D 20 32 00 00 00 4E 55 4D 20 33 00 00 00 4E 55 4D 20 34 00 00 00 4E 55 4D 20 35 00 00 00 4E 55 4D 20 36 00 00 00 4E 55 4D 20 37 00 00 00 4E 55 4D 20 38 00 00 00 4E 55 4D 20 39 00 00 00 42 41 43 4B 53 50 41 43 45 00 00 00 54 41 42 00 45 4E 54 45 52 00 00 00 43 41 50 53 20 4C 4F 43 4B 00 00 00 4C 45 57 59 20 53 48 49 46 54 00 00 50 52 41 57 59 20 53 48 49 46 54 00 4C 45 57 59 20 43 54 52 4C 00 00 00 4C 45 57 59 20 57 49 4E 44 4F 57 53 00 00 00 00 4C 45 57 59 20 41 4C 54 00 00 00 00 53 50 41 43 4A 41 00 00 50 52 41 57 59 20 41 4C 54 00 00 00 50 52 41 57 59 20 57 49 4E 44 4F 57 53 00 00 00 43 4F 4E 54 45 58 54 00 50 52 41 57 59 20 43 54 52 4C 00 00 54 59 4C 44 41 00 00 00 31 00 00 00 32 00 00 00 33 00 00 00 34 00 00 00 35 00 00 00 36 00 00 00 37 00 00 00 38 00 00 00 39 00 00 00 30 00 00 00 4D 49 4E 55 53 00 00 00 52 D3 57 4E 41 20 53 49 CA 00 00 00 51 00 00 00 57 00 00 00 45 00 00 00 52 00 00 00 54 00 00 00 59 00 00 00 55 00 00 00 49 00 00 00 4F 00 00 00 50 00 00 00 4E 41 57 2E 20 4B 57 2E 20 4C 45 57 59 00 00 00 4E 41 57 2E 20 4B 57 2E 20 50 52 41 57 59 00 00 41 00 00 00 53 00 00 00 44 00 00 00 46 00 00 00 47 00 00 00 48 00 00 00 4A 00 00 00 4B 00 00 00 4C 00 00 00 8C 52 45 44 4E 49 4B 00 41 50 4F 53 54 52 4F 46 00 00 00 00 57 54 59 A3 43 49 41 43 48 00 00 00 5A 00 00 00 58 00 00 00 43 00 00 00 56 00 00 00 42 00 00 00 4E 00 00 00 4D 00 00 00 50 52 5A 45 43 49 4E 45 4B 00 00 00 4B 52 4F 50 4B 41 00 00 55 4B 4F 8C 4E 49 4B 00 44 AF 2E 20 57 20 4C 45 57 4F 00 00 44 AF 2E 20 57 20 50 52 41 57 4F 00 44 AF 2E 20 57 20 47 D3 52 CA 00 00 44 AF 2E 20 57 20 44 D3 A3 00 00 00 54 48 52 4F 54 54 4C 45 20 55 50 00 54 48 52 4F 54 54 4C 45 20 44 4F 57 4E 00 00 00 52 55 44 44 45 52 20 4C 45 46 54 00 52 55 44 44 45 52 20 52 49 47 48 54 00 00 00 00 50 4F 56 2D 4C 45 46 54 00 00 00 00 50 4F 56 2D 52 49 47 48 54 00 00 00 50 4F 56 2D 55 50 00 00 50 4F 56 2D 44 4F 57 4E 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 33 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 34 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 35 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 36 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 37 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 38 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 39 00 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 30 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 31 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 32 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 33 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 34 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 35 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 36 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 37 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 38 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 31 39 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 30 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 31 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 32 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 33 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 34 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 35 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 36 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 37 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 38 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 32 39 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 33 30 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 33 31 00 00 00 44 AF 2E 20 50 52 5A 59 43 2E 20 33 32 00 00 00 50 41 55 5A 41'
            HEX @0x004CA1A2 = 'E9 4B 02 00 00 90'
            HEX @0x004CA3F2 = 'BF CB 63 5C 00'
            HEX @0x004CA3FD = '68 CB 63 5C 00'
            HEX @0x004CA41F = 'BF D3 63 5C 00'
            HEX @0x004CA42A = '68 D3 63 5C 00'
            HEX @0x004CA453 = 'BF DB 63 5C 00'
            HEX @0x004CA45E = '68 DB 63 5C 00'
            HEX @0x004CA487 = 'BF E3 63 5C 00'
            HEX @0x004CA492 = '68 E3 63 5C 00'
            HEX @0x004CA4BB = 'BF F7 63 5C 00'
            HEX @0x004CA4C6 = '68 F7 63 5C 00'
            HEX @0x004CA4EF = 'BF 03 64 5C 00'
            HEX @0x004CA501 = '68 03 64 5C 00'
            HEX @0x004CA523 = 'BF 13 64 5C 00'
            HEX @0x004CA52E = '68 13 64 5C 00'
            HEX @0x004CA557 = 'BF 23 64 5C 00'
            HEX @0x004CA562 = '68 23 64 5C 00'
            HEX @0x004CA58B = 'BF 2B 64 5C 00'
            HEX @0x004CA596 = '68 2B 64 5C 00'
            HEX @0x004CA5BF = 'BF 33 64 5C 00'
            HEX @0x004CA5CA = '68 33 64 5C 00'
            HEX @0x004CA5F3 = 'BF 3B 64 5C 00'
            HEX @0x004CA5FE = '68 3B 64 5C 00'
            HEX @0x004CA627 = 'BF 43 64 5C 00'
            HEX @0x004CA632 = '68 43 64 5C 00'
            HEX @0x004CA9A4 = 'E9 2D 14 00 00 90'
            HEX @0x004CBDD6 = 'BF 8B 64 5C 00'
            HEX @0x004CBDE1 = '68 8B 64 5C 00'
            HEX @0x004CBE03 = 'BF 9B 64 5C 00'
            HEX @0x004CBE0E = '68 9B 64 5C 00'
            HEX @0x004CBE37 = 'BF A7 64 5C 00'
            HEX @0x004CBE42 = '68 A7 64 5C 00'
            HEX @0x004CBFA3 = 'BF E3 64 5C 00'
            HEX @0x004CBFAE = '68 E3 64 5C 00'
            HEX @0x004CBFD7 = 'BF EB 64 5C 00'
            HEX @0x004CBFE2 = '68 EB 64 5C 00'
            HEX @0x004CC00B = 'BF F3 64 5C 00'
            HEX @0x004CC016 = '68 F3 64 5C 00'
            HEX @0x004CC03F = 'BF F7 64 5C 00'
            HEX @0x004CC04A = '68 F7 64 5C 00'
            HEX @0x004CC073 = 'BF FF 64 5C 00'
            HEX @0x004CC07E = '68 FF 64 5C 00'
            HEX @0x004CC0A7 = 'BF 0B 65 5C 00'
            HEX @0x004CC0B2 = '68 0B 65 5C 00'
            HEX @0x004CC0DB = 'BF 17 65 5C 00'
            HEX @0x004CC0E6 = '68 17 65 5C 00'
            HEX @0x004CC10D = 'BF 27 65 5C 00'
            HEX @0x004CC121 = '68 27 65 5C 00'
            HEX @0x004CC51B = 'BF BB 65 5C 00'
            HEX @0x004CC549 = 'BE BB 65 5C 00'
            HEX @0x004CC575 = 'BF C7 65 5C 00'
            HEX @0x004CC5A3 = 'BE C7 65 5C 00'
            HEX @0x004CC5CF = 'BF D3 65 5C 00'
            HEX @0x004CC5FD = 'BE D3 65 5C 00'
            HEX @0x004CC629 = 'BF DF 65 5C 00'
            HEX @0x004CC657 = 'BE DF 65 5C 00'
            HEX @0x004CC683 = 'BF EF 65 5C 00'
            HEX @0x004CC6B1 = 'BE EF 65 5C 00'
            HEX @0x004CC6DD = 'BF FB 65 5C 00'
            HEX @0x004CC70B = 'BE FB 65 5C 00'
            HEX @0x004CC737 = 'BF 03 66 5C 00'
            HEX @0x004CC765 = 'BE 03 66 5C 00'
            HEX @0x004CC791 = 'BF 0F 66 5C 00'
            HEX @0x004CC7BF = 'BE 0F 66 5C 00'
            HEX @0x004CC840 = '68 27 66 5C 00'
            HEX @0x004CC855 = '68 27 66 5C 00'
            HEX @0x004CC872 = '68 33 66 5C 00'
            HEX @0x004CCA22 = '68 6B 66 5C 00'
            HEX @0x004CCBAE = '68 9F 66 5C 00'
            HEX @0x004CCBD2 = '68 AF 66 5C 00'
            HEX @0x004CCD3A = '68 E3 66 5C 00'
            HEX @0x004CCD5E = '68 EB 66 5C 00'
            HEX @0x004CCD82 = '68 F7 66 5C 00'
            HEX @0x004CCEA2 = '68 1F 67 5C 00'
            HEX @0x004CCEC6 = '68 2B 67 5C 00'
            HEX @0x004CCEEA = '68 33 67 5C 00'
            HEX @0x004CCF0E = '68 3B 67 5C 00'
            HEX @0x004CCF32 = '68 47 67 5C 00'
            HEX @0x004CCF56 = '68 53 67 5C 00'
            HEX @0x004CCF7A = '68 5F 67 5C 00'
            HEX @0x005C69D5 = '55 8B EC 81 7D 08 00 01 00 00 73 37 68 14 00 00 00 FF 15 AC 03 82 00 83 E0 01 C1 E0 0A 83 7D 0C 00 74 05 05 00 01 00 00 83 7D 10 00 74 05 05 00 02 00 00 03 45 08 0F B6 80'
            HEX @0x005C6A0E = 6x00000000
            HEX @0x005C6A12 = '0A C0 74 02 5D C3 5D 81 EC 0C 01 00 00 E9 52 91 F0 FF'
            HEX @0x004CFB70 = 'E9 60 6E 0F 00 90'
            HEX @0x0066BEE0 = 'BF CF 69 5C 00'
            HEX @0x0066BF07 = 'BE CF 69 5C 00'
        END
    #/patch

    #patch [Magic_Collision_Fix]    
        HEX @0x00785157 = '83 EC 20 53 8B 5C 24 2C 55 8B 6C 24 2C 56 8B F3 57 8B D5 33 FF 2B F1 C7 44 24 14 FF FF 7F FF C7 44 24 10 FF FF 7F 7F 2B D1 8D A4 24 00 00 00 00 D9 04 0E D9 E1 D8 1D 44 27 82 00 DF E0 F6 C4 05 7A 1F D9 01 D9 04 0A DE D9 DF E0 F6 C4 05 0F 8B E3 00 00 00 D9 04 0A D9 41 0C DE D9 E9 98 00 00 00 D9 04 0E D8 3D 70 0D 82 00 D9 01 D8 24 0A D8 C9 D9 5C 24 38 D9 41 0C D8 24 0A DE C9 D9 44 24 38 D8 D9 DF E0 F6 C4 05 7A 28 D9 44 24 38 D8 5C 24 14 DF E0 F6 C4 41 75 08 8B 44 24 38 89 44 24 14 D8 54 24 10 DF E0 F6 C4 05 7A 32 D9 5C 24 10 EB 2E D8 54 24 14 DF E0 F6 C4 41 75 06 D9 5C 24 14 EB 02 DD D8 D9 44 24 38 D8 5C 24 10 DF E0 F6 C4 05 7A 0C 8B 44 24 38 89 44 24 10 EB 02 DD D8 D9 44 24 14 D8 5C 24 10 DF E0 F6 C4 41 74 48 D9 44 24 10 D8 1D AC 08 82 00 DF E0 F6 C4 05 7B 37 47 83 C1 04 83 FF 03 0F 8C 23 FF FF FF D9 44 24 14 D8 1D AC 08 82 00 DF E0 F6 C4 05 7A 06 D9 44 24 10 EB 04 D9 44 24 14 D8 15 70 0D 82 00 DF E0 F6 C4 41 EB 0E DD D8 5F 5E 5D 33 C0 5B 83 C4 20 C2 0C 00 D9 C0 8B 4C 24 3C D8 0B 5F 5E D9 5C 24 1C D9 C0 D8 4B 04 D9 5C 24 20 D8 4B 08 D9 44 24 1C D8 45 00 D9 5C 24 10 D9 44 24 20 8B 54 24 10 D8 45 04 D9 5C 24 14 8B 44 24 14 D8 45 08 89 11 89 41 04 5D D9 5C 24 14 8B 54 24 14 89 51 08 B8 01 00 00 00 5B 83 C4 20 C2 0C 00'
        HEX @0x005493B1 = 'E8 A1 BD 23 00'
    #/patch
    
    #patch [LOW_FPS_NaN_check]    
        HEX @0x007852F2 = '81 3B 00 00 C0 FF 0F 84 5B 9D DA FF D9 03 8D 44 8C 1C E9 5F 9D DA FF'
        HEX @0x0052F062 = 'E9 8B 62 25 00 90'
        HEX @0x00785309 = '81 7C E4 20 00 00 C0 FF 0F 84 6F 8E DA FF E9 14 8E DA FF'
        HEX @0x00616CDA = 'E8 2A E6 16 00'
    #/patch

    #patch [Simple Window]    
        IF BOOL @SYSTEMPACK:DEBUG:SimpleWindow
            HEX @0x0050052F = '68 00 00 00 90'
            HEX @0x00500544 = '68 00 00 00 00'
            HEX @0x004FDE90 = 'C3'
        END
    #/patch

    #patch [SmoothAniDistance]
        IF FLOAT @SYSTEMPACK:PARAMETERS:SmoothAniDistance > 2000.0
            HEX @0x00577561 = LIM(2000.0 , FLOAT @SYSTEMPACK:PARAMETERS:SmoothAniDistance, 1000000.0)
            HEX @0x0057773D = 'D8 1D 81 CA 57 00'
            HEX @0x00577780 = 'D8 1D 81 CA 57 00'
        END
    #/patch

    #patch [Lootfix Unconscious]
        HEX @0x00785336 = 'C6 86 0C 09 00 00 00 E9 CE 4D C8 FF'
        HEX @0x006D78B0 = 'E8 81 DA 0A 00'
    #/patch

    #patch [DrawItemInfo]
        HEX @0x00785342 = 'FF 90 B8 00 00 00 8B 8D 8C 00 00 00 8B 54 24 24 8B 45 00 51 52 8B CD C7 05 08 05 FC 02 01 00 00 00 FF 90 B8 00 00 00 C7 05 08 05 FC 02 00 00 00 00 E9 B8 4D F2 FF E8 53 E2 F2 FF 83 C4 04 83 3D 08 05 FC 02 01 0F 84 D8 47 F2 FF E9 00 42 F2 FF'
        HEX @0x006AA12A = 'E9 13 B2 0D 00 90'
        HEX @0x006A9581 = 'E9 F2 BD 0D 00'
        HEX @0x0078535B = 4x00000040
        HEX @0x0078536B = 4x00000040
        HEX @0x00785382 = 4x00000040
    #/patch

    #patch [CView_Blit_farZ_65534]
        HEX @0x00746B8E = '90 90'
    #/patch

    #patch [MobInterCollision]    
        IF BOOL @SYSTEMPACK:PARAMETERS:InteractionCollision
            HEX @0x006C353F = 'EB 10 90 90 90 90'
            HEX @0x006C353A = 'E8 91 1E 0C 00'
            HEX @0x007853D0 = '6A 00 E8 A9 DE EE FF 8B CF E9 52 6A F6 FF'
        END
    #/patch
    
    #patch [Rain particle collisions]
        IF BOOL @SYSTEMPACK:PARAMETERS:RainVobCollision
            INT @0x005DB4CA = 736
        END
    #/patch
    
    #patch [REMOVE OVERLAYMDS fix]    
        HEX @0x00672E12 = '74 34'
    #/patch

    #patch [Fix low framerate]
        HEX @0x004DB2BF = '08'
    #/patch
    
    #patch [Exit VDFS]
        HEX @0x0042536E = 'FF 15 BC 04 82 00 6A 00 E8 7F FA 39 00' // call vdf_exitall, push 0, call exit(0)
    #/patch
  
    #patch [Hide original splash]
        INT nBegin1  = 0x004264C9
        INT nEnd1    = 0x004264E4
        INT nLength1 = nEnd1 - nBegin1
        MemSet(nBegin1, '90', nLength1)
        
        INT nBegin2  = 0x00426530
        INT nEnd2    = 0x0042653F
        INT nLength2 = nEnd2 - nBegin2
        MemSet(nBegin2, '90', nLength2)
    #/patch

    #patch [Interupt gamestart sound]
        IF BOOL @SYSTEMPACK:PARAMETERS:AbortMenuSound
            HEX @0x004D91FF = '00'
        END
    #/patch

    #patch [Allow undeclarated instances]
        HEX @0x005A59BD = 'E9 99 00 00 00 90'
    #/patch

    #patch [Timed Overlay Mds Fix 'SetFightAnis after InitAnimations']
        HEX @0x006DFFA8 = 'E9 E5 53 0A 00'
        HEX @0x00785392 = 'E8 F9 23 EC FF 89 F1 E8 62 51 F5 FF 8B 8E E8 08 00 00 50 E8 16 8E EC FF E9 FE AB F5 FF'
    #/patch

    #patch [Line cache size]
        INT CacheSize = INT @SYSTEMPACK:DEBUG:LineCacheSize
        INT @0x00508585 = CacheSize
        INT @0x0050857F = CacheSize * 20
    #/patch

    #patch [UnequipItem]
        HEX @0x006D41D0 = '68 00 00 00 40 8B CE E8 64 07 FE FF 56 8B CF E8 DC FB FF FF'
        HEX @0x006D3990 = '68 00 00 00 40 8B CE E8 84 0F FE FF 85 C0 74 21 56 8B CF E8 58 FB FF FF 85 C0 75 15'
    #/patch

    #patch [SAVEDAT IN ASCII]
        IF BOOL @UNION:GAME:SaveDATinASCII
            HEX @0x00668BF5 = '01'
        END
    #/patch

    #patch [oCNpc::SetFlag Fix]
        HEX @0x006D251A = '0B'
    #/patch

    #patch [Dialog Starvation Fix]
        HEX @0x007A0E35 = 'D9 EA 90 90 90 90'
        HEX @0x007A0EA7 = 'D9 EA 90 90 90 90'
        HEX @0x007A0F25 = 'D9 EA 90 90 90 90'
        HEX @0x007A0FB2 = 'D9 EA 90 90 90 90'
    #/patch

    #patch [prolog]
        HEX @0x0081FFC1 = '6A FF 68 7F F0 80 00 64 A1 00 00 00 00 50 64 89 25 00 00 00 00 83 EC 1C 53 55 56 8B F1 57 8D AE 1C 09 00 00 31 DB 31 C0 E9 9B F9 EA FF'
        HEX @0x0081FEC2 = '6A FF 68 24 C3 80 00 64 A1 00 00 00 00 50 64 89 25 00 00 00 00 83 EC 08 53 55 56 8B F1 57 89 74 24 14 E8 05 00 00 00 E9 39 E1 E8 FF C3'
    #/patch

    #patch [F3 - SetForegroundWindow]
        HEX @0x0066F2B4 = 'FF 35 F4 5B 8C 00 E9 F0 60 11 00'
        HEX @0x007853AF = 'FF 15 B8 03 82 00 C3'
    #/patch

    #patch [Disable slow code segment in zCTexConGeneric::Unlock]
        INT slowBegin = 0x0076ED36
        INT slowEnd = 0x0076EEE7
        INT jumpLength = slowEnd - slowBegin - 5
        HEX @slowBegin = 'E9' + HEX jumpLength
    #/patch

    #patch [CS Player crash fix]
        INT begin = 0x0041F560
        INT length = 0x0041F76A - begin
        MemSet(begin, '90', length)
    #/patch
  
    #patch [Sliding fix]
      FLOAT @7x00000000 = FLOAT @UNION:DEBUG:SlidingSize
      INT   @0x005AFD7C = 7x00000000
    #/patch

    #patch [Fix 1px cutline in zCView objects]
        HEX @0x007469D6 = '41'
        HEX @0x00746A12 = '42'
        HEX @0x00746957 = '00'
        HEX @0x0074696A = '00'
        HEX @0x005CD8EA = '42'
        HEX @0x005CD8F6 = '41'
    #/patch

    #patch [CastSpecificSpell - SetAsPlayer fix]
        HEX @0x0048554A = '90 90 90 90 90 90'
        HEX @0x0048558F = 'E9 22 FE 2F 00'
        HEX @0x007853B6 = 'E8 E5 F1 E8 FF 8B 4E 34 E8 CD E8 F5 FF 8B 4E 40 E8 B5 1B F6 FF E9 C4 01 D0 FF'
    #/patch

    #patch [Fix double spawn for summons]
        HEX @0x00719235 = '90 90 90 90 90 90 90 90 90 90'
    #/patch

    #patch [GetSpellItem leak fix]
        HEX @0x00796DEA = '90 90 90'
    #/patch
    
    #patch [CopyDamage to arrow/bolt]
        HEX @0x007853DE = '55 50 8B EC 83 EC 2C 56 C7 45 00 00 00 00 00 83 BB 3C 02 00 00 06 75 27 68 14 4D 89 00 8D 75 E8 89 F1 E8 BB BC C7 FF 8D 55 E8 52 89 D9 E8 D0 E6 F4 FF 89 45 00 8D 4D E8 E8 45 BD C7 FF EB 2E 83 BB 3C 02 00 00 05 75 41 68 BC 7F 88 00 8D 75 D4 89 F1 E8 8B BC C7 FF 8D 55 D4 52 89 D9 E8 A0 E6 F4 FF 89 45 00 8D 4D D4 E8 15 BD C7 FF 89 D9 E8 0E 3C F5 FF 89 45 FC 83 7D FC 00 74 0C 8B 45 00 50 8B 4D FC E8 C9 F1 F2 FF 5E 8B E5 58 5D C2 04 00'
        HEX @0x006E9D26 = 'E9 B3 B6 09 00'
    #/patch

    #patch [zCView::PrintCY fix]
        HEX @0x0074A4A4 = '90'
        HEX @0x0074A4A5 = Call(0x0074A4A5, 0x00729AA0)
    #/patch

    #patch [CompatData fix]
        IF BOOL @SYSTEMPACK:DEBUG:BorderFix
            INT address = ImportSymbol("ddraw.dll", "SetAppCompatData")
            IF address != 0
                HEX @impSetAppCompatData = address 
                impSetAppCompatData(12, 0)
            END
        END
    #/patch

    #patch [Fix crash while transforming in water]
        #assembler [0x0050BC44]
            push ecx
            mov ecx, [ecx+00B8h] ; homeWorld
            cmp ecx, 0
            pop ecx
            je 0x0050C4B2
            orgcode
        #/assembler
    #/patch
#/engine

#engine [G2A]
    
    #patch [GLOBAL DATA]
        INT Lang_Other = 0
        INT Lang_Rus = 1
        INT Lang_Eng = 2
        INT Lang_Ger = 3
        INT Lang_Pol = 4
        INT Lang_Rou = 5
        INT Lang_Ita = 6
        INT Lang_Cze = 7
        INT Lang_Esp = 8
        INT Language = GetLanguage()
        
        AllocPage(1, 0x10000)  //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(2, 0x30000)  //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(3, 0x10000)  //ALPHA_VOB; ALPHA_WORLD_POLY
        AllocPage(4, 0x100)    //FOV; DrawDistanceMultiplier; RMB_No_Take_Anim; Interface scaling
        AllocPage(5, 0x100000) //s_posCacheList
        AllocPage(7, 0x100)    //DS for sliding fix and etc
        
        OptionDef(BOOL  @UNION:GAME:SaveGameToASCII,                            0)
        OptionDef(BOOL  @UNION:GAME:SaveDATinASCII,                             1)
        OptionDef(BOOL  @UNION:DEBUG:ReadBinkWithVDFS,                          true)
        OptionDef(BOOL  @UNION:DEBUG:UseErrorVisuals,                           false)
        OptionDef(BOOL  @UNION:DEBUG:FixBink,                                   true)
        OptionDef(BOOL  @Union:Core:CustomDebugWindowPos,                       false)
        OptionDef(BOOL  @Union:Core:DebugWindowPosX,                            0)
        OptionDef(BOOL  @Union:Core:DebugWindowPosY,                            0)
        OptionDef(BOOL  @Union:Core:UseDebugWindowHost,                         0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BorderFix,                            1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:OptimizeVB,                           0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:dwNumVertices,                        8192)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Disable_D3DVBCAPS_WRITEONLY,          1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:SimpleWindow,                         1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BorderlessWindow,                     0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:WindowPosX,                           0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:WindowPosY,                           0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:ZNORESTHREAD,                         1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:BUGFIX_already_deleted_zCObject,      1)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Polish_version,                       Language == Lang_Pol)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:StrafeBug,                            0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:Show_FPS_Counter,                     0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:Cache_Timeout,                        400)
        OptionDef(INT   @SYSTEMPACK:DEBUG:LineCacheSize,                        16384)
        OptionDef(INT   @SYSTEMPACK:DEBUG:ForceFlip,                            0)
        OptionDef(INT   @SYSTEMPACK:DEBUG:DisableOcclusionCulling,              0)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:TerminateProcessHotkey,               true)
        OptionDef(BOOL  @SYSTEMPACK:DEBUG:RestoreMortalityAfterDialog,          0)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AnisotropicFiltering,            0)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:VerticalFOV,                     67.5)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:NewFOVformula,                   0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:DisableLOD,                      0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:DisableIndoorClipping,           1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTRANGE,               4500)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_REMOVERANGE,               5000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTTIME_MAX,            1000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:SmoothAniDistance,               5000)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:DrawDistanceMultiplier,          1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:OutDoorPortalDistanceMultiplier, 1)
        OptionDef(FLOAT @SYSTEMPACK:PARAMETERS:InDoorPortalDistanceMultiplier,  1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:EnableShields,                   1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:UnlockParadeJumpB,               1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:No_Take_Anim,                    0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:RMB_No_Take_Anim,                0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HideFocus,                       1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:InteractionCollision,            1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:TestHardCollisionsOnLadder,      false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdvancedFloorCheckForInteract,   true)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:ShowArmor,                       0)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:RainVobCollision,                1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AbortMenuSound,                  1)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance,           false)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_LowerFPS,  55)
        OptionDef(INT   @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_UpperFPS,  60)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:AdaptiveSightDistance_ShowInfo,  false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:VisualizePerfomance,             false)
        OptionDef(BOOL  @SYSTEMPACK:PARAMETERS:HeightCorrectionOnLadder,        1)
        OptionDef(FLOAT @SYSTEMPACK:INTERFACE:Scale,                            1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ScaleRate,                        768)
        OptionDef(BOOL  @SYSTEMPACK:INTERFACE:ScaleInventory,                   1)
        OptionDef(BOOL  @SYSTEMPACK:INTERFACE:ForceMenuScale,                   0)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ScaleMenusX,                      640)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ScaleMenusY,                      480)
        OptionDef(BOOL  @SYSTEMPACK:INTERFACE:ForceDocScale,                    0)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ScaleDocX,                        8192)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ScaleDocY,                        8192)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:DialogBoxX,                       800)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:DialogBoxY,                       600)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:SubtitlesBoxX,                    600)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ShowManaBar,                      1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:ShowSwimBar,                      1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:HideHealthBar,                    0)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:NewChapterSizeX,                  800)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:NewChapterSizeY,                  600)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:SaveGameImageSizeX,               320)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:SaveGameImageSizeY,               200)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:InventoryCellSize,                70)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_DialogChoice_Active,        -1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_DialogChoice_Inactive,      -6316129)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_Talk_Hero,                  -1)
        OptionDef(INT   @SYSTEMPACK:INTERFACE:Color_Talk_NPC,                   -256)
        OptionDef(BOOL  @SYSTEMPACK:INTERFACE:Hide_STR_DEX,                     1)
        OptionDef(BOOL  @SYSTEMPACK:SUBTITLES:Control,                          0)
        OptionDef(FLOAT @SYSTEMPACK:SUBTITLES:TimeMultiplier,                   2.0)
        OptionDef(FLOAT @SYSTEMPACK:SUBTITLES:MaxTimePerPhrase,                 30.0)
        OptionDef(FLOAT @SYSTEMPACK:SUBTITLES:TimePerChar,                      100.0)
        OptionDef(FLOAT @UNION:DEBUG:SlidingSize,                               0.05)
    #/patch
    
    #patch [Load Steam Overlay]
        IF INT @SYSTEMPACK:DEBUG:OptimizeVB == 0
            HEX hSteamDirectory = FindSteamDirectory()
            INT nLength = GetHexSize(hSteamDirectory)
            IF hSteamDirectory != NULL
                LoadLibrary(Concat(hSteamDirectory, "/GameOverlayRenderer.dll.tmp"))
                INT nGothicPID = GetProcessID(NULL)
                INT nSteamPID = GetProcessID("Steam.exe")
                IF nGothicPID != INVALID && nSteamPID != INVALID
                    HEX hProcessPath = Concat(hSteamDirectory, "/GameOverlayUI.exe")
                    HEX hparameters  = Concat(" -pid ", nGothicPID, " -steampid ", nSteamPID, " -manuallyclearframes 0 -gameid 39510")
                    StartProcess(hProcessPath, hparameters)
                END
            END
        END
    #/patch
    
    #patch [CodeCave - 1]
        HEX @0x0066E8AE = 'E9 FF 01 00 00'
        INT begin = 0x0066E8B3
        INT length = 0x0066EAB2 - begin
        MemSet(begin, '90', length)
    #/patch
    
    #patch [PerceptionCheck - crash fix]
        HEX @0x0075E0E3 = '89 F3 90 90'
    #/patch
    
    #patch [SendMessage - BroadCast fix]
        INT hWindow     = FindWindow(NULL, "[zSpy]")
        IF INT @0x0044C5DA != INT '90 90 90 90'
            INT @0x0044C5DA = hWindow
            INT @0x0044D9A0 = hWindow
            INT @0x0044C72F = hWindow
        END
    #/patch
    
    #patch [Gothic.ini fixes]
        IF !BOOL @GAME:INTERNAL:extendedMenu
            BOOL @GAME:INTERNAL:extendedMenu = 1
        END
        IF  INT @GAME:VIDEO:zVidResFullscreenBPP != 32
            INT @GAME:VIDEO:zVidResFullscreenBPP = 32
        END
        IF  INT @GAME:ENGINE:zTexCacheSizeMaxBytes < 100000000
            INT @GAME:ENGINE:zTexCacheSizeMaxBytes = 100000000
        END
        IF !BOOL @GAME:INTERNAL:menuShowVersion
            BOOL @GAME:INTERNAL:menuShowVersion = 1
        END
        IF  BOOL @GAME:INTERNAL:gameStartFailed == 1
            BOOL @GAME:INTERNAL:gameStartFailed = 0
        END
        IF  BOOL @GAME:INTERNAL:gameAbnormalExit == 1
            BOOL @GAME:INTERNAL:gameAbnormalExit = 0
        END
        IF Language == Lang_Ger
            HEX @GAME:GAME:keyboardLayout == "00000407"
        ELSE
            HEX @GAME:GAME:keyboardLayout == "00020409"
        END
    #/patch

    #patch [GameVersion]
        HEX @0x0089D9B0  = 4x00000024
        HEX @GameVersion = 4x00000024
        HEX hVersion     = GetUnionVersion()
        GameVersion      = "Union " + hVersion
    #/patch
    
    #patch [D3DIM700.dll - removes 2048 pixel limit]
        HEX hModuleName = "D3DIM700.dll"
        INT nModuleBase = ModuleBase(hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize(hModuleName)
            FindAndReplace(HEX 'B8 00 08 00 00 39', 'B8 00 80 00 00 39', nModuleBase, nModuleSize)
        END
    #/patch
    
    #patch [AcGenral.dll - Windows 7 rundll32.exe bugfix]
        HEX hModuleName = "AcGenral.dll"
        INT nModuleBase = ModuleBase(hModuleName, True)
        IF nModuleBase !=0
            INT nModuleSize = ModuleSize(hModuleName)
            FindAndReplace(HEX '68 28 09 00 00', 'C2 04 00 90 90', nModuleBase, nModuleSize)
        END
    #/patch

    /*#patch [nvd3dum]
        HEX hModuleName = "nvd3dum.dll"
        INT nModuleBase = ModuleBase (hModuleName, True)
        
        IF    nModuleBase !=0
        INT nModuleSize = ModuleSize (hModuleName)
        FindAndReplace (HEX '88 88 88 18', '00 00 00 00', nModuleBase, nModuleSize)
        MessageBox ("FastSync Disabled")
        END
    #/patch*/
    
    #patch [ALPHA_VOB and ALPHA_WORLD_POLY]
        HEX @0x00528BBA = '68 00 0C 00 00'
        HEX @0x0052D28C = '3D 00 0C 00 00'
        HEX @0x00528CE1 = '68 00 0C 00 00'
        HEX @0x00528BC2 = 1x00000000
        HEX @0x00528CEB = 1x00000000
        HEX @0x00528DDD = 1x00000000
        HEX @0x0052D30B = 1x00000000
        HEX @0x00528F86 = 1x0000000C
        HEX @0x00528FAD = 1x0000000C
        HEX @0x00528FE6 = 1x0000000C
        HEX @0x0052900D = 1x0000000C
        HEX @0x0052BDEB = 1x0000000C
        HEX @0x0052BE12 = 1x0000000C
        HEX @0x0052D304 = 1x0000000C
        HEX @0x005D6EEA = '68 00 26 00 00'
        HEX @0x005D6FEF = '81 FB 00 26 00 00'
        HEX @0x005D6F61 = '68 00 26 00 00'
        HEX @0x005D6EF2 = 2x00000000
        HEX @0x005D6F6B = 2x00000000
        HEX @0x005D70AD = 2x00000000
        HEX @0x005291C0 = 3x00000000
        HEX @0x00530790 = 3x00000000
        HEX @0x00529257 = 3x00000000
        HEX @0x0052A3EA = 3x00000000
        HEX @0x0052E689 = 3x00000000
        HEX @0x0052E69E = 3x00000000
        HEX @0x0052E6B5 = 3x00000000
        HEX @0x0052FF8F = 3x00000000
        HEX @0x0052FFB4 = 3x00000000
        HEX @0x0052FFDB = 3x00000000
        HEX @0x005291CC = 3x0000B000
        HEX @0x00529242 = 3x0000B000
        HEX @0x00529250 = 3x0000B000
        HEX @0x0052A3D1 = 3x0000B000
        HEX @0x0052A3DF = 3x0000B000
        HEX @0x0052E6CD = 3x0000B000
        HEX @0x00530007 = 3x0000B000
        HEX @0x0053078B = 3x0000B000
        HEX @0x0053079D = 3x0000B000
        HEX @0x005307A2 = 3x0000B004
    #/patch
    
    #patch [FOV]
        HEX @0x0082D1DA = 'CC CC DF 44 24 44 DA 74 24 40 D9 1D 00 00 CE 07 55 89 5C 24 08 E9 7C B6 E2 FF CC CC 51 8B 41 70 85 C0 89 44 24 00 75 08 D9 05 2C 1D 83 00 EB 07 DB 41 74 DA 74 24 00 D8 4C 24 08 8B 44 24 08 51 D9 1C 24 50 E8 3D D7 D1 FF 59 C2 04 00 CC CC 51 FF 35 04 00 CE 07 D9 04 24 D8 35 0E A2 54 00 D9 1D 08 00 CE 07 D9 05 00 00 CE 07 D9 05 08 00 CE 07 DE F1 D9 E8 D9 F3 D8 0D 8C 02 83 00 D8 0D 84 00 83 00 50 D9 1C 24 E8 FA D6 D1 FF 59 C2 04 00 CC CC'
        HEX @0x0082D1E6 = 4x00000000
        HEX @0x0082D241 = 4x00000000
        HEX @0x0082D22C = 4x00000004
        HEX @0x0082D23B = 4x00000008
        HEX @0x0082D247 = 4x00000008
        HEX @0x004C0CC3 = 'E8 61 C5 36 00'
        HEX @0x004C2F65 = 'E8 BF A2 36 00'
        HEX @0x0054A214 = 'E8 10 30 2E 00'
        HEX @0x0071384E = 'E8 A3 99 11 00'
        HEX @0x0065886B = 'E9 6C 49 1D 00'
        HEX @VFOV = 4x00000004
        VFOV = FLOAT @SYSTEMPACK:PARAMETERS:VerticalFOV
    #/patch

    #patch [MAP - 4:3 aspect ratio]
        HEX @0x0082D283 = 'CC CC 8B 02 83 EC 0C 85 C0 53 55 56 8B F1 89 46 30 8B 4A 04 57 89 4E 34 BD 01 00 00 00 7F 03 89 6E 30 8B 46 34 85 C0 7F 03 89 6E 34 33 C0 33 C9 89 46 40 89 4E 44 8B 46 4C 85 C0 74 44 8B 56 30 89 56 40 8B 46 34 89 46 44 8B 4E 4C 8B 56 30 DF 41 44 D8 35 8F 30 6C 00 50 DB 1C 24 58 0F B7 1D 40 BB 83 00 0F AF C2 99 F7 FB 8B 7E 34 8B D8 8B 41 44 0F B7 0D 42 BB 83 00 0F AF C7 89 5E 40 EB 38 A1 08 2F 98 00 8B 48 0C 8B 40 10 89 46 44 89 4E 40 8B 46 30 0F AF C1 89 46 40 0F B7 0D 40 BB 83 00 99 F7 F9 89 46 40 8B 46 34 0F AF 46 44 89 46 44 0F B7 0D 42 BB 83 00 99 F7 F9 89 46 44 8B 46 40 85 C0 7F 03 89 6E 40 8B 46 44 85 C0 7F 03 89 6E 44 8B 46 58 33 C9 85 C0 74 09 90 8B 40 08 41 85 C0 75 F8 85 C9 8B E9 0F 84 88 00 00 00 8B 46 58 4D 33 C9 85 C0 89 6C 24 10 74 10 3B CD 0F 84 A6 00 00 00 8B 40 08 41 85 C0 75 F0 33 FF 8B 4F 4C 33 C0 85 C9 8D 5F 38 89 03 89 43 04 74 48 8B 41 40 8B 57 28 0F B7 2D 40 BB 83 00 0F AF C2 99 F7 FD 8B E8 8B 41 44 0F AF 47 2C 0F B7 0D 42 BB 83 00 99 F7 F9 8D 54 24 14 52 8B CB 89 6C 24 18 89 44 24 1C E8 63 4D E6 FF 8B 4F 4C 8B D3 E8 79 4F E6 FF 8B 6C 24 10 8B CF E8 0E 52 E6 FF 85 ED 0F 85 78 FF FF FF 8B 46 58 33 DB 85 C0 74 08 8B 40 08 43 85 C0 75 F8 85 DB 74 4A 33 ED 8B 46 58 4B 33 C9 85 C0 74 20 90 8D 64 24 00 3B CB 74 12 8B 40 08 41 85 C0 75 F4 EB 0D 8B 78 04 E9 5C FF FF FF 8B 78 04 EB 02 33 FF 8D 57 40 33 C0 8B CF 89 2A 89 42 04 E8 72 4F E6 FF 8B CF E8 6B 52 E6 FF 85 DB 75 B8 5F 5E 5D 5B 83 C4 0C C3 CC CC'
        HEX @0x0068C9FC = 'E8 84 08 1A 00'
    #/patch
    
    #patch [DrawDistanceMultiplier]
        HEX @0x005E9EA0 = 'D8 1D 08 07 83 00'
        HEX @0x004283C2 = 4x0000000C
        HEX @DrawDistanceMultiplier = 4x0000000C
        DrawDistanceMultiplier = LIM(0.01,(FLOAT @SYSTEMPACK:PARAMETERS:DrawDistanceMultiplier * 0.01), 0.26)
    #/patch

    #patch [zPM_NUM_VBUFFER_VERT 65535]
        HEX @0x005C8BF3 = LIM(4096, INT @SYSTEMPACK:DEBUG:dwNumVertices, 65535)
    #/patch
    
    #patch [DisableLOD]
        IF BOOL @SYSTEMPACK:PARAMETERS:DisableLOD
            FLOAT @0x00832A34 = 0.0
        END
    #/patch
    
    #patch [DisableIndoorClipping]
        IF BOOL @SYSTEMPACK:PARAMETERS:DisableIndoorClipping
            HEX @0x0054C174 = '7A 00'
        END
    #/patch

    #patch [SPAWN_INSERTRANGE]
        FLOAT @0x008BACD0 = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTRANGE
    #/patch
    
    #patch [SPAWN_REMOVERANGE]
        FLOAT @0x008BACD4 = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_REMOVERANGE
    #/patch
    
    #patch [SPAWN_INSERTTIME_MAX]
        FLOAT @0x008BACCC = FLOAT @SYSTEMPACK:PARAMETERS:SPAWN_INSERTTIME_MAX
    #/patch
    
    #patch [OutDoorPortalDistanceMultiplier]
        FLOAT @0x0052F25E = FLOAT @SYSTEMPACK:PARAMETERS:OutDoorPortalDistanceMultiplier * 3240000
        FLOAT @0x0052F266 = FLOAT @SYSTEMPACK:PARAMETERS:OutDoorPortalDistanceMultiplier * 3240000 - 1800000
    #/patch
    
    #patch [InDoorPortalDistanceMultiplier]
        FLOAT @0x005348A9 = FLOAT @SYSTEMPACK:PARAMETERS:InDoorPortalDistanceMultiplier * 3240000
        FLOAT @0x005348B1 = FLOAT @SYSTEMPACK:PARAMETERS:InDoorPortalDistanceMultiplier * 3240000 - 1800000
    #/patch

    #patch [ZNORESTHREAD]
        IF BOOL @SYSTEMPACK:DEBUG:ZNORESTHREAD
            HEX @0x00558D39 = '90'
        END
    #/patch

    #patch [NUM_POS_CACHE 524288]
        HEX @0x005C969F = '81 7E 38 00 00 08 00'
    #/patch
    
    #patch [s_posCacheList]
        HEX s_posCacheList = 5x00000000
        FindAndReplace(HEX '78 AA 96 00', s_posCacheList, ModuleBase(Null), ModuleSize(Null))
    #/patch
    
    #patch [SubtitlesBoxX]
        HEX @0x006C2E39 = INT @SYSTEMPACK:INTERFACE:SubtitlesBoxX
    #/patch

    #patch [ShowManaBar]
        IF INT @SYSTEMPACK:INTERFACE:ShowManaBar == 0
            HEX @0x006C342A = 'E8 B0 88 0E 00'
        END
        IF INT @SYSTEMPACK:INTERFACE:ShowManaBar == 2
            HEX @0x006C33FC = '90 90 90 90 90 90'
        END
    #/patch

    #patch [ShowSwimBar]
        IF INT @SYSTEMPACK:INTERFACE:ShowSwimBar == 0
            HEX @0x006C3373 = 'E8 67 89 0E 00'
        END
        IF INT @SYSTEMPACK:INTERFACE:ShowSwimBar == 2
            HEX @0x006C332C = 'EB 1C 90 90 90 90'
        END
    #/patch

    #patch [HideHealthBar]
        IF INT @SYSTEMPACK:INTERFACE:HideHealthBar == 1
            HEX @0x006C326C = '81 7E 38 00 00 08 00'
        END
    #/patch

    #patch [NewChapterSizeX]
        HEX @0x0042B30B = INT @SYSTEMPACK:INTERFACE:NewChapterSizeX
    #/patch

    #patch [NewChapterSizeY]
        HEX @0x0042B31C = INT @SYSTEMPACK:INTERFACE:NewChapterSizeY
    #/patch

    #patch [SaveGameImageSizeX]
        HEX @0x006C232D = INT @SYSTEMPACK:INTERFACE:SaveGameImageSizeX
    #/patch

    #patch [SaveGameImageSizeY]
        HEX @0x006C2341 = INT @SYSTEMPACK:INTERFACE:SaveGameImageSizeY
    #/patch

    #patch [InventoryCellSize]
        IF INT @SYSTEMPACK:INTERFACE:InventoryCellSize != 70
            HEX @0x007087EC = 'E9 36 3D EC FF 90'
            HEX @0x005CC527 = '68 46 00 00 00 8B CF FF 12 E9 BD C2 13 00'
            HEX @0x005CC528 = LIM(10, INT @SYSTEMPACK:INTERFACE:InventoryCellSize, 9999)
            HEX @0x0070880A = 'E9 26 3D EC FF 90 90'
            HEX @0x005CC535 = '68 46 00 00 00 8B CF FF 50 04 E9 CD C2 13 00'
            HEX @0x005CC536 = LIM(10, INT @SYSTEMPACK:INTERFACE:InventoryCellSize, 9999)
        END
    #/patch
    
    #patch [D3DVBCAPS_WRITEONLY]
        IF BOOL @SYSTEMPACK:DEBUG:Disable_D3DVBCAPS_WRITEONLY
            HEX @0x00656F36 = '81 4C 24 1C 00 00 00 00'
        END
    #/patch
    
    #patch [Shield]
        IF BOOL @SYSTEMPACK:PARAMETERS:EnableShields
            HEX @0x008AC14B = '00 5A 53 5F 4C 45 46 54 41 52 4D 00'
            HEX @0x0082D49F = '60 8B CE 6A 09 68 50 83 8B 00 6A 00 68 F0 E6 82 00 54 E8 4A C3 F1 FF 83 C4 10 61 60 8B CE 6A 0A 68 4C C1 8A 00 6A 00 68 F0 E6 82 00 54 E8 2F C3 F1 FF 83 C4 10 61 60 68 FF D4 82 00 8B CE E8 AE C1 F1 FF 81 F9 00 01 00 00 7D 0B 61 68 0C 1E AB 00 E9 98 CC F0 FF 51 8B CE E8 C3 51 F0 FF EB EB F0 E6 82 00 00 00 00 00 2C 83 8B 00 0C 00 00 00 1F'
            HEX @0x0073A188 = 'E9 12 33 0F 00'
            HEX @0x0073905D = 'E9 D9 44 0F 00'
            HEX @0x00739489 = 'E9 DD 40 0F 00'
            HEX @0x00737621 = 'E9 7A 5F 0F 00 90'
            HEX @0x0082D513 = 'F0 E6 82 00 00 00 00 00 4C C1 8A 00 0A 00 00 00 1F 00 00 00 F0 E6 82 00 00 00 00 00 50 83 8B 00 09 00 00 00 1F 00 00 00 68 F4 1E AB 00 60 8B CE E8 08 A9 F0 FF 81 F9 00 01 00 00 73 06 61 E9 2D BB F0 FF 61 60 8B CE 68 13 D5 82 00 68 27 D5 82 00 E8 57 68 F1 FF EB E5 68 F4 1E AB 00 60 8B CE 68 13 D5 82 00 E8 13 C1 F1 FF 81 F9 00 01 00 00 73 06 61 E9 03 BF F0 FF 61 60 8B CE 68 27 D5 82 00 68 13 D5 82 00 E8 22 68 F1 FF EB E5 8B 86 B8 09 00 00 33 FF 85 C0 7E 35 8D 49 00 8B 96 B0 09 00 00 8B 04 BA 68 17 D5 82 00 8D 48 04 E8 EB AA BE FF 85 C0 74 0D 8B 86 B8 09 00 00 47 3B F8 7C DB EB 0B 8B 86 B0 09 00 00 8B 3C B8 EB 02 33 FF 57 8B CE E8 75 D0 F1 FF 8B 86 B8 09 00 00 E9 31 A0 F0 FF'
			HEX @0x0082D5F6 = '60 68 0C 1E AB 00 8B CE E8 8D 49 F0 FF 85 C0 75 0B 61 68 F0 1E AB 00 E9 2A EC F1 FF 50 8B CE E8 A6 50 F0 FF EB EB'
			HEX @0x0074C237 = 'E9 BA 13 0E 00'
        END
    #/patch

    #patch [Model Clipping]
        HEX @0x0052FD71 = 'C7 44 24 24 F0 23 74 44'
        HEX @0x0054B01F = 'C7 44 24 20 00 00 00 BF'
    #/patch

    #patch [Subtitles]
        IF BOOL @SYSTEMPACK:SUBTITLES:Control
            FLOAT @0x0082D7B7 = FLOAT @SYSTEMPACK:SUBTITLES:TimeMultiplier
            FLOAT @0x0082D7BF = FLOAT @SYSTEMPACK:SUBTITLES:MaxTimePerPhrase * 1000
            FLOAT @0x0082D7BB = FLOAT @SYSTEMPACK:SUBTITLES:TimePerChar
            HEX   @0x00758688 = 'E9 1A 51 0D 00'
            HEX   @0x0082D7A7 = '8B CD FF 50 30 D8 0D B7 D7 82 00 E9 D6 AE F2 FF'
            HEX   @0x007586B6 = 'D8 0D BB D7 82 00'
            HEX   @0x00758698 = 'D8 1D 78 00 83 00'
            HEX   @0x007586CF = 'D9 05 BF D7 82 00'
        END
    #/patch

    #patch [Not equip a bow/crossbow together]
        HEX @0x00745FB3 = 'E8 38 63 E8 FF'
        HEX @0x005CC2F0 = '8B 44 24 04 83 F8 04 53 55 56 57 8B F9 75 75 8D AF 68 06 00 00 8B CD E8 14 33 14 00 8B CD E8 2D 00 14 00 33 DB 85 C0 89 44 24 14 7E 57 53 8B CD E8 2B 01 14 00 8B F0 56 8B CF E8 81 56 16 00 85 C0 74 19 6A 04 8B CE E8 94 63 14 00 85 C0 74 0C 56 8B CF E8 98 03 17 00 85 C0 75 10 8B 44 24 14 43 3B D8 7C C8 5F 5E 5D 5B C2 04 00 8B CE 68 00 00 00 40 E8 68 63 14 00 85 C0 75 08 8B CF 56 E8 9C DF 16 00 5F 5E 5D 5B C2 04 00'
    #/patch

    #patch [Disable endless VISEME after getting hit]
        HEX @0x0067A0E3 = '68 00 00 80 BF 68 00 00 00 40'
    #/patch
    
    #patch [Disable assert - refCtr>=-1, "D: OBJ: deleting an already deleted zCObject ?!"]
        IF BOOL @SYSTEMPACK:DEBUG:BUGFIX_already_deleted_zCObject
            HEX @0x00401EFD = 'EB 14'
            HEX @0x005A8D1D = 'E9 88 00 00 00 90'
        END
    #/patch
    
    #patch [Polish]
        IF BOOL @SYSTEMPACK:DEBUG:Polish_version
            HEX @0x00899930 = '44 AF 2E 20 50 52 5A 2E 20 33 32 00 44 AF 2E 20 50 52 5A 2E 20 33 31 00 44 AF 2E 20 50 52 5A 2E 20 33 30 00 44 AF 2E 20 50 52 5A 2E 20 32 39 00 44 AF 2E 20 50 52 5A 2E 20 32 38 00 44 AF 2E 20 50 52 5A 2E 20 32 37 00 44 AF 2E 20 50 52 5A 2E 20 32 36 00 44 AF 2E 20 50 52 5A 2E 20 32 35 00 44 AF 2E 20 50 52 5A 2E 20 32 34 00 44 AF 2E 20 50 52 5A 2E 20 32 33 00 44 AF 2E 20 50 52 5A 2E 20 32 32 00 44 AF 2E 20 50 52 5A 2E 20 32 31 00 44 AF 2E 20 50 52 5A 2E 20 32 30 00 44 AF 2E 20 50 52 5A 2E 20 31 39 00 44 AF 2E 20 50 52 5A 2E 20 31 38 00 44 AF 2E 20 50 52 5A 2E 20 31 37 00 44 AF 2E 20 50 52 5A 2E 20 31 36 00 44 AF 2E 20 50 52 5A 2E 20 31 35 00 44 AF 2E 20 50 52 5A 2E 20 31 34 00 44 AF 2E 20 50 52 5A 2E 20 31 33 00 44 AF 2E 20 50 52 5A 2E 20 31 32 00 44 AF 2E 20 50 52 5A 2E 20 31 31 00 44 AF 2E 20 50 52 5A 2E 20 31 30 00 44 AF 2E 20 50 52 5A 2E 20 39 00 00 44 AF 2E 20 50 52 5A 2E 20 38 00 00 44 AF 2E 20 50 52 5A 2E 20 37 00 00 44 AF 2E 20 50 52 5A 2E 20 36 00 00 44 AF 2E 20 50 52 5A 2E 20 35 00 00 44 AF 2E 20 50 52 5A 2E 20 34 00 00 44 AF 2E 20 50 52 5A 2E 20 33 00 00 44 AF 2E 20 50 52 5A 2E 20 32 00 00 44 AF 2E 20 50 52 5A 2E 20 31 00 00 50 4F 56 2D 44 4F 57 4E 00 00 00 00 50 4F 56 2D 55 50 00 00 50 4F 56 2D 52 49 47 48 54 00 00 00 50 4F 56 2D 4C 45 46 54 00 00 00 00 53 54 45 52 20 50 52 41 57 4F 00 00 00 00 00 00 53 54 45 52 20 4C 45 57 4F 00 00 00 50 52 5A 45 50 2E 20 44 D3 A3 00 00 00 00 00 00 50 52 5A 45 50 2E 20 47 D3 52 41 00 44 AF 2E 20 44 D3 A3 00 00 00 00 00 44 AF 2E 20 47 D3 52 41 00 44 AF 2E 20 50 52 41 57 4F 00 00 44 AF 2E 20 4C 45 57 4F 00 00 00 00 4B 52 4F 50 4B 41 00 00 43 4F 4D 4D 41 00 00 00 50 49 50 45 00 00 00 00 5C 00 00 00 2F 00 00 00 00 00 00 00 41 50 4F 53 54 52 4F 46 00 00 00 00 8C 52 45 44 4E 49 4B 00 00 00 00 00 50 52 2E 20 4E 41 57 2E 20 4B 57 2E 00 00 00 00 4C 2E 20 4E 41 57 2E 20 4B 57 2E 00 00 00 00 00 3D 00 00 00 00 00 00 00 54 59 4C 44 41 00 00 00 00 00 00 00 00 00 00 00 50 52 41 57 59 20 43 54 52 4C 00 00 43 4F 4E 54 45 58 54 00 50 52 41 57 59 20 57 49 4E 00 00 00 00 00 00 00 50 52 41 57 59 20 41 4C 54 00 00 00 53 50 41 43 4A 41 00 00 4C 45 57 59 20 41 4C 54 00 00 00 00 4C 45 46 54 20 57 49 4E 00 00 00 00 4C 45 57 59 20 43 54 52 4C 00 00 00 50 52 41 57 59 20 53 48 49 46 54 00 4C 45 57 59 20 53 48 49 46 54 00 00 43 41 50 53 20 4C 4F 43 4B 00 00 00 54 41 42 00 42 41 43 4B 53 50 41 43 45 00 00 00 4E 55 4D 20 44 45 4C 00 4E 55 4D 4C 4F 43 4B 00 50 52 41 57 4F 00 00 00 00 00 00 00 00 00 00 00 44 D3 A3 00 00 00 00 00 00 00 00 00 4C 45 57 4F 00 00 00 00 00 00 00 00 47 D3 52 41 00 00 00 00 00 00 00 00 50 41 47 45 20 44 4F 57 4E 00 00 00 45 4E 44 00 44 45 4C 45 54 45 00 00 50 41 47 45 20 55 50 00 48 4F 4D 45 00 00 00 00 49 4E 53 45 52 54 00 00 53 43 52 4F 4C 4C 4C 4F 43 4B 00 00 50 52 49 4E 54 00 00 00 50 4F 56 2D 55 4E 54 45 4E 00 00 00 50 4F 56 2D 4F 42 45 4E 00 00 00 00 50 4F 56 2D 52 45 43 48 54 53 00 00 50 4F 56 2D 4C 49 4E 4B 53 00 00 00 52 55 44 45 52 20 52 45 43 48 54 53 00 00 00 00 52 55 44 45 52 20 4C 49 4E 4B 53 00 50 52 5A 45 43 49 4E 45 4B 00 00 00 00 00 00 00 53 43 48 55 42 52 45 47 4C 45 52 20 41 55 46 00 4A 4F 59 2D 55 4E 54 45 4E 00 00 00 4A 4F 59 2D 4F 42 45 4E 00 00 00 00 4A 4F 59 2D 52 45 43 48 54 53 00 00 4A 4F 59 2D 4C 49 4E 4B 53 00 00 00 4D 49 4E 55 53 00 00 00 50 55 4E 4B 54 00 00 00 4B 4F 4D 4D 41 00 00 00 4D 00 00 00 4E 00 00 00 42 00 00 00 56 00 00 00 43 00 00 00 58 00 00 00 59 00 00 00 4B 4C 45 49 4E 45 52 2D 41 4C 53 00 52 41 55 54 45 00 00 00 C4 00 00 00 D6 00 00 00 4B 00 00 00 4A 00 00 00 48 00 00 00 47 00 00 00 44 00 00 00 41 00 00 00 50 4C 55 53 00 00 00 00 DC 00 00 00 50 00 00 00 4F 00 00 00 49 00 00 00 55 00 00 00 5A 00 00 00 54 00 00 00 45 00 00 00 57 00 00 00 51 00 00 00 41 4B 5A 45 4E 54 00 00 DF 00 00 00 39 00 00 00 38 00 00 00 37 00 00 00 36 00 00 00 35 00 00 00 34 00 00 00 33 00 00 00 32 00 00 00 5A 49 52 4B 55 4D 46 4C 45 58 00 00 53 54 52 47 20 52 45 43 48 54 53 00 4B 4F 4E 54 45 58 54 00 4F 53 2D 4C 4F 47 4F 20 52 45 43 48 54 53 00 00 41 4C 54 20 47 52 00 00 4C 45 45 52 54 41 53 54 45 00 00 00 41 4C 54 00 4F 53 2D 4C 4F 47 4F 20 4C 49 4E 4B 53 00 00 00 53 54 52 47 20 4C 49 4E 4B 53 00 00 55 4D 53 43 48 41 4C 54 20 52 45 43 48 54 53 00 55 4D 53 43 48 41 4C 54 20 4C 49 4E 4B 53 00 00 46 45 53 54 53 54 45 4C 4C 00 00 00 45 4E 54 45 52 00 00 00 54 41 42 55 4C 41 54 4F 52 00 00 00 52 DC 43 4B 00 00 00 00 4E 55 4D 20 39 00 00 00 4E 55 4D 20 38 00 00 00 4E 55 4D 20 37 00 00 00 4E 55 4D 20 36 00 00 00 4E 55 4D 20 35 00 00 00 4E 55 4D 20 34 00 00 00 4E 55 4D 20 33 00 00 00 4E 55 4D 20 32 00 00 00 4E 55 4D 20 31 00 00 00 4E 55 4D 20 30 00 00 00 4E 55 4D 20 45 4E 54 46 00 00 00 00 4E 55 4D 20 45 4E 54 45 52 00 00 00 4E 55 4D 20 2D 00 00 00 4E 55 4D 20 47 57 2E 00 4E 55 4D 20 2F 00 00 00 4E 55 4D 2D 46 45 53 54 53 54 45 4C 4C 00 00 00 4E 41 43 48 2D 52 45 43 48 54 53 00 4E 41 43 48 2D 55 4E 54 45 4E 00 00 4E 41 43 48 2D 4C 49 4E 4B 53 00 00 4E 41 43 48 2D 4F 42 45 4E 00 00 00 42 49 4C 44 2D 41 42 00 45 4E 44 45 00 00 00 00 45 4E 54 46 45 52 4E 45 4E 00 00 00 42 49 4C 44 2D 41 55 46 00 00 00 00 50 4F 53 31 00 00 00 00 45 49 4E 46 DC 47 45 4E 00 00 00 00 50 41 55 53 45 00 00 00 52 4F 4C 4C 45 4E 2D 46 45 53 54 53 54 45 4C 4C 00 00 00 00 44 52 55 43 4B 00 00 00 46 31 35 00 46 31 34 00 46 31 33 00 46 31 32 00 46 31 31 00 46 31 30 00 46 39 00 00 46 38 00 00 46 37 00 00 46 36 00 00 46 35 00 00 46 34 00 00 46 33 00 00 46 32 00 00 46 31 00 00 45 53 43 00 4D 59 53 5A 20 58 35 00 00 00 00 00 4D 59 53 5A 20 58 34 00 00 00 00 00 4D 59 53 5A 20 58 33 00 00 00 00 00 4D 59 53 5A 20 58 32 00 00 00 00 00 4D 59 53 5A 20 58 31 00 00 00 00 00 8C 50 4D 00 00 00 00 00 00 00 00 00 50 50 4D 00 00 00 00 00 00 00 00 00 4C 50 4D 00 4B D3 A3 4B 4F 20 57 20 47 D3 52 CA 00 4B D3 A3 4B 4F 20 57 20 44 D3 A3 00 00 00 00 00 00 00 00 4D 59 53 5A 2D 59 00 00 4D 59 53 5A 2D 58 00 00'
            HEX @0x008AF638 = '4B 4F 4E 49 45 43 00 00'
            HEX @0x008B28F4 = '50 41 55 5A 41 00 00 00'
            HEX @0x004CC67A = 'C7 05 14 99 89 00 00 02 04 09 EB 39'
            HEX @0x004CC9C3 = 'BF 9D A0 89 00'
            HEX @0x004CC9CE = '68 9D A0 89 00'
            HEX @0x004CC9F7 = 'BF 90 A0 89 00'
            HEX @0x004CCA02 = '68 90 A0 89 00'
            HEX @0x004CF428 = '68 18 9D 89 00'
            HEX @0x004CF470 = '68 5C 9B 89 00'
            HEX @0x004CF4BF = '68 29 9B 89 00'
            HEX @0x004D2199 = 'C7 05 50 A1 89 00 00 02 04 09 EB 4B'
            HEX @0x0066C7A0 = 'E9 D5 01 00 00 A5 C6 CA A3 D1 D3 8C 8F AF CC CC 33 DB 38 93 D4 C7 66 00 74 0B FE C3 80 FB 09 75 F1 B0 20 EB 06 8A 83 A5 C7 66 00 5B 81 C4 0C 01 00 00 C3 CC 1E 2E 12 26 31 18 1F 2D 2C CC CC CC 33 DB 38 93 D4 C7 66 00 74 0B FE C3 80 FB 09 75 F1 B0 20 EB 06 8A 83 04 C8 66 00 5B 81 C4 0C 01 00 00 C3 CC B9 E6 EA B3 F1 F3 9C 9F BF CC CC CC 84 DB 74 9C EB CA CC CC CC CC CC CC CC CC CC CC 84 DB 74 BC EB 8A'
            HEX @0x004D23EF = 'E9 1C A4 19 00 90 90 90 90'
            HEX @0x004D25B6 = 'E9 25 A2 19 00 90 90 90 90'
            HEX @0x004D262D = 'E9 EE A1 19 00 90 90 90 90'
            HEX @0x004D2F6C = '00 17 06 07 08 09 00 0B 17 17 17 17 00 00 0E 17 17 17 17 17 00 10 11 17 17 12 00 00 00 17 17 00'
            HEX @0x004D3058 = '2D 26 4D 00'
            HEX @0x004D3070 = '2D 26 4D 00'
            HEX @0x004D3088 = '2D 26 4D 00 2D 26 4D 00'
            HEX @0x004D30A8 = '2D 26 4D 00'
            HEX @0x004D30C0 = '2D 26 4D 00 2D 26 4D 00 2D 26 4D 00'
            HEX @0x004D30D4 = '2D 26 4D 00'
            HEX @0x006D9E1A = 'E9 07 2A F9 FF'
            HEX @0x0066C826 = '83 7C 24 04 32 75 05 83 44 24 04 20 8D 54 24 18 52 E9 E3 D5 06 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90'
        END
    #/patch
    
    #patch [MAP_Delay_BUGFIX]
        HEX @0x0068CD4E = 'E8 11 01 00 00'
    #/patch
    
    #patch [BorderlessWindow]
        IF BOOL @SYSTEMPACK:DEBUG:BorderlessWindow
            HEX @0x0050321B = '68 00 00 00 96'
            HEX @0x00503226 = '68 00 00 00 00'
            HEX @0x00630BD6 = '33 C9 41 90'
            INT adrPosX     = 4x0000001C
            INT adrPosY     = 4x00000020
            INT @adrPosX    = INT @SYSTEMPACK:DEBUG:WindowPosX
            INT @adrPosY    = INT @SYSTEMPACK:DEBUG:WindowPosY
            INT @0x00503209 = adrPosX
            INT @0x00503216 = adrPosY
            HEX @0x00500B10 = 'C3'
        END
    #/patch
    
    #patch [FOV_New_Formula]
        IF BOOL @SYSTEMPACK:PARAMETERS:NewFOVformula
            HEX @0x0082D233 = 'D8 35 84 00 83 00 D8 35 8C 02 83 00 D9 F2 DD D8 D8 35 00 00 46 01 D9 E8 D9 F3 D8 0D 8C 02 83 00 D8 0D 84 00 83 00 50 D9 1C 24 E8 FE D6 D1 FF 59 C2 04 00 90 90 90 90 CC CC'
            HEX @0x0082D245 = 4x00000000
        END
    #/patch
    
    #patch [No_Take_Anim]
        IF BOOL @SYSTEMPACK:PARAMETERS:No_Take_Anim
            HEX @0x0075355B = '00'
        END
    #/patch
    
    #patch [RMB_No_Take_Anim]
        IF BOOL @SYSTEMPACK:PARAMETERS:RMB_No_Take_Anim
            HEX @0x0069AE44 = 'E9 FB 16 F3 FF'
            HEX @0x005CC544 = '8B 41 04 8B 40 10 8B 40 04 C7 00 0C 02 0D 02 8B 01 6A 05 FF 50 04 E8 E9 49 20 00 85 C0 75 06 50 E9 E6 E8 0C 00 81 7C E4 E4 0D 02 00 00 75 2A A3 F0 CE AB 00 EB E9 83 3D F0 CE AB 00 01 74 0B 8B 8B 80 09 00 00 E9 12 70 18 00 C7 05 F0 CE AB 00 00 00 00 00 E9 BF 6F 18 00 C7 05 F0 CE AB 00 00 00 00 00 EB BA'
            HEX @0x005CC574 = 4x00000010
            HEX @0x005CC57C = 4x00000010
            HEX @0x005CC590 = 4x00000010
            HEX @0x005CC59F = 4x00000010
            HEX @0x0075359A = 'E9 DB 8F E7 FF 90'
            HEX @0x0075355B = '3E'
        END
    #/patch
    
    #patch [Interface scaling]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @Scale = 4x00000014
            Scale = LIM (1.0,FLOAT @SYSTEMPACK:INTERFACE:Scale,9999)
            HEX @0x006670E0 = 'E9 10 03 00 00 DB 44 E4 0C DA 35 21 57 40 00 D8 15 00 00 B9 07 DF E0 F6 C4 41 7F 0C DD D8 68 6D 0D 81 00 E9 4F 17 FF FF D9 1D 00 00 B9 07 EB EE'
            HEX @0x00658852 = 'E9 8E E8 00 00'
            HEX @0x006670F1 = 4x00000014
            HEX @0x0066710A = 4x00000014
            HEX @0x00667110 = '0F B6 54 08 1C 52 DB 04 E4 D8 0D 00 00 B9 07 DB 1C E4 8B 14 E4 89 34 E4 E9 75 32 12 00'
            HEX @0x0078A39C = 'E9 6F CD ED FF'
            HEX @0x0066711B = 4x00000014
            HEX @0x0066712D = 'DB 41 14 D8 0D 00 00 B9 07 DB 1D 04 00 B9 07 A1 04 00 B9 07 C3 A3 04 00 B9 07 DB 05 04 00 B9 07 D8 0D 00 00 B9 07 DB 1D 04 00 B9 07 A1 04 00 B9 07 C2 04 00'
            HEX @0x007894E0 = 'E9 48 DC ED FF'
            HEX @0x00789518 = 'E9 25 DC ED FF'
            HEX @0x0078952A = 'E9 13 DC ED FF'
            HEX @0x00667132 = 4x00000014
            HEX @0x00667138 = 4x00000018
            HEX @0x0066713D = 4x00000018
            HEX @0x00667143 = 4x00000018
            HEX @0x00667149 = 4x00000018
            HEX @0x0066714F = 4x00000014
            HEX @0x00667155 = 4x00000018
            HEX @0x0066715A = 4x00000018
            HEX @0x00667161 = 'D8 0D 00 00 B9 07 E9 DC 9D 16 00'
            HEX @0x00667163 = 4x00000014
            HEX @0x004DC0E7 = 'E9 80 B0 18 00 90 90 90'
            HEX @0x0066716C = 'DA 0D 5D A9 4D 00 E8 EA FF FF FF DB 05 5D A9 4D 00 D8 0D 00 00 B9 07 E9 6A 4F E7 FF'
            HEX @0x0066717F = 4x00000014
            HEX @0x00667188 = '83 EC 24 56 8B F1 8B 46 60 85 C0 57 74 75 8D 48 54 8B 01 8D 54 24 10 52 FF 50 18 8B 78 10 8B 46 60 8D 48 54 8B 01 8D 54 24 10 52 FF 50 18 8B 4E 4C 85 C9 8B 40 14 74 4B 85 FF 8B 51 40 8B 49 44 7E 41 3B FA 7D 3D 85 C0 7E 39 3B C1 7D 35 8D 54 24 08 8B CE 89 7C 24 08 89 44 24 0C DB 44 E4 08 D8 0D 00 00 E2 07 DB 5C E4 08 DB 44 E4 0C D8 0D 00 00 E2 07 DB 5C E4 0C E8 5B AF 02 00 5F 5E 83 C4 24 C3 E9 F7 5D 02 00'
            HEX @0x006671EA = 4x00000014
            HEX @0x006671F8 = 4x00000014
            HEX @0x0068C9C8 = 'E8 BB A7 FD FF'
            HEX @0x00667210 = 'E8 4B 95 13 00 DB 02 D8 0D 00 00 B7 07 DB 1A E9 DE 2B 07 00 E8 37 95 13 00 DB 01 D8 0D 00 00 B7 07 DB 19 E9 E2 2B 07 00'
            HEX @0x00667219 = 4x00000014
            HEX @0x0066722D = 4x00000014
            HEX @0x006D9DFD = 'E9 0E D4 F8 FF 8D 44 24 10 50 8B CE E8 52 69 0C 00 8D 4C 24 0C 51 8B CE E9 0A D4 F8 FF'
            HEX @0x00667238 = '68 80 02 00 00 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 C1 40 DC FF 68 E0 01 00 00 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 BC 40 DC FF 68 80 02 00 00 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 C1 85 FF FF 68 E0 01 00 00 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 BA 85 FF FF 68 58 02 00 00 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 97 BB 05 00 68 40 01 00 00 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 75 B0 05 00 68 C8 00 00 00 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 73 B0 05 00'
            HEX @0x00667242 = 4x00000014
            HEX @0x00667258 = 4x00000014
            HEX @0x0066726E = 4x00000014
            HEX @0x00667284 = 4x00000014
            HEX @0x0066729A = 4x00000014
            HEX @0x006672B0 = 4x00000014
            HEX @0x006672C6 = 4x00000014
            HEX @0x0042B30A = 'E9 29 BF 23 00'
            HEX @0x0042B31B = 'E9 2E BF 23 00'
            HEX @0x0065F836 = 'E9 29 7A 00 00'
            HEX @0x0065F845 = 'E9 30 7A 00 00'
            HEX @0x006C232C = 'E9 75 4F FA FF'
            HEX @0x006C2340 = 'E9 77 4F FA FF'
            HEX @0x006C2E38 = 'E9 53 44 FA FF'
            HEX @0x007087C1 = 'E8 9B E9 F5 FF A3 54 0F AB 00 8B 07 6A 46 8B CF FF 50 04 89 44 24 10 DB 44 24 10 D8 4C 24 0C E8 63 87 0C 00 A3 50 0F AB 00 8B 17 6A 46 8B CF FF 12 89 44 24 10 DB 44 24 10 D8 4C 24 08 E8 5E E9 F5 FF A3 A8 0F AB 00 8B 07 6A 46 8B CF FF 50 04 89 44 24 10 DB 44 24 10 D8 4C 24 0C E8 3F E9 F5 FF'
            HEX @0x006672D2 = '68 B4 00 00 00 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 FF 12 8B 0D 68 64 AB 00 A3 1C 30 8C 00 8B 01 6A 14 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 6F 63 DD FF 6A 1E DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 FF 52 04 E9 7C BC 05 00 68 BE 00 00 00 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 EE BC 05 00 6A 10 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 FF 10 8B 8E 8C 03 00 00 89 86 14 04 00 00 8B 11 6A 10 DB 04 E4 D8 0D 00 00 F1 02 DB 1C E4 E9 4E CA E7 FF'
            HEX @0x006672DC = 4x00000014
            HEX @0x006672F9 = 4x00000014
            HEX @0x0066730C = 4x00000014
            HEX @0x00667325 = 4x00000014
            HEX @0x00667338 = 4x00000014
            HEX @0x00667356 = 4x00000014
            HEX @0x0043D65E = 'E9 6F 9C 22 00'
            HEX @0x004E3D9C = 'E9 90 35 18 00 90 90 90 90 90'
            HEX @0x006C2F92 = 'E9 6E 43 FA FF'
            HEX @0x006C301A = 'E9 FC 42 FA FF'
            FLOAT @0x00830C84 = FLOAT @SYSTEMPACK:INTERFACE:ScaleMenusX
            FLOAT @0x00830C88 = FLOAT @SYSTEMPACK:INTERFACE:ScaleMenusY
            HEX @0x00667264 = '68 20 03 00 00'
            HEX @0x0066727A = '68 58 02 00 00'
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale ==1
            HEX @0x00658852 = 'E9 0B EB 00 00'
            HEX @0x00667362 = '81 7C E4 0C 00 03 00 00 0F 8D 75 FD FF FF D9 E8 E9 91 FD FF FF'
            HEX @0x006670E9 = 'DA 35 E4 17 41 00'
            HEX @0x006670FA = 'EB 0C'
            HEX @0x006670EB = 4x00000100
            HEX @4x00000100 = INT @SYSTEMPACK:INTERFACE:ScaleRate
        END
        IF BOOL @SYSTEMPACK:INTERFACE:ForceMenuScale
            HEX @0x004DC0A1 = '74 00'
        END
        IF INT @SYSTEMPACK:INTERFACE:ScaleInventory ==0
            HEX @0x007087C1 = 'E8 82 87 0C 00 A3 54 0F AB 00 8B 07 6A 46 8B CF FF 50 04 89 44 24 10 DB 44 24 10 D8 4C 24 0C E8 63 87 0C 00 A3 50 0F AB 00 8B 17 6A 46 8B CF FF 12 89 44 24 10 DB 44 24 10 D8 4C 24 08 E8 45 87 0C 00 A3 A8 0F AB 00 8B 07 6A 46 8B CF FF 50 04 89 44 24 10 DB 44 24 10 D8 4C 24 0C E8 26 87 0C 00'
            HEX @0x0070783E = '90 90'
        END
        IF BOOL @SYSTEMPACK:INTERFACE:ForceDOCScale
            HEX @0x006671C8 = 'EB'
            HEX @4x00000050 = INT @SYSTEMPACK:INTERFACE:ScaleDocX
            HEX @4x00000054 = INT @SYSTEMPACK:INTERFACE:ScaleDocY
            HEX @0x0068D02C = 4x00000050
            HEX @0x0068D025 = 4x00000054
        END
    #/patch

    #patch [DialogBoxX]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale < 1.0
            HEX @0x0065F837 = INT @SYSTEMPACK:INTERFACE:DialogBoxX
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @0x00667265 = INT @SYSTEMPACK:INTERFACE:DialogBoxX
        END        
    #/patch

    #patch [DialogBoxY]
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale < 1.0
            HEX @0x0065F846 = INT @SYSTEMPACK:INTERFACE:DialogBoxY
        END
        IF FLOAT @SYSTEMPACK:INTERFACE:Scale >= 1.0
            HEX @0x0066727B = INT @SYSTEMPACK:INTERFACE:DialogBoxY
        END    
    #/patch
    
    #patch [Disable using map when the hero has become a monster]
        HEX @0x006FC36F = 'E8 8C 62 04 00'
    #/patch

    #patch [Disable using of weapons when the hero uses an anvil]
        HEX @0x005CC5A9 = '80 B9 6C 07 00 00 10 74 05 E9 59 06 18 00 B8 01 00 00 00 C2 04 00'
        HEX @0x0074C192 = 'E8 12 04 E8 FF'
        HEX @0x006982FD = 'EB 1F'
    #/patch
    
    #patch [The last used scroll gives full damage]
        HEX @0x0066741A = 'E9 A0 51 F6 FF'
        HEX @0x005CC5BF = 'E8 7C C6 16 00 83 F8 00 0F 84 BC BC 09 00 E9 4D AE 09 00'
    #/patch
    
    #patch [No_Interrupt_Interact_ANI]
        HEX @0x0066E872 = 'E9 E0 F9 FF FF'
        HEX @0x0066E252 = 'E9 0B 06 00 00 80 B9 6C 07 00 00 0E 0F 84 2F 06 00 00 E8 D7 A9 0C 00 E9 09 06 00 00 90 90'
    #/patch
    
    #patch [AttackRun_fix]
        HEX @0x00751957 = 'E8 14 C9 F1 FF'
        HEX @0x0066E270 = '39 35 84 26 AB 00 0F 84 C4 C6 02 00 C2 04 00'
    #/patch
    
    #patch [Block the hero move in the menu]
        HEX @0x00426BFD = 'E8 D2 76 24 00'
        HEX @0x0066E2D4 = '81 7C E4 14 8A AE 47 00 74 0E 81 7C E4 20 D6 C6 4D 00 0F 85 C4 9D 0C 00 C7 44 E4 04 01 00 00 00 E9 B7 9D 0C 00'
    #/patch
    
    #patch [FIST mode turns off correctly by pressing "1" button]
        HEX @0x006FCAB2 = 'E9 E3 17 F7 FF'
        HEX @0x0066E29A = 'E8 11 CC F3 FF 83 C4 0C 89 74 24 14 C6 84 24 FC 00 00 00 08 3B F3 0F 84 70 E8 08 00 53 53 6A 03 8B CE E8 0F 85 0F 00 89 C6 E9 52 F0 08 00'
    #/patch
    
    #patch [Dropped arrows, bolts and torches will be removed after loading save]
        HEX @0x0066E2C8 = '8B 47 30 89 44 E4 04 E9 FC 6A 0D 00'
        HEX @0x0073761C = 'E8 A7 6C F3 FF'
        HEX @0x00737672 = 'E8 51 6C F3 FF'
    #/patch
    
    #patch [MOUSE_BUFFER_SIZE 100]
        HEX @0x004D37D2 = 'E9 22 AB 19 00'
        HEX @0x0066E2F9 = 'A1 70 1D 8D 00 C7 44 E4 2C 64 00 00 00 E9 CC 54 E6 FF'
    #/patch

    #patch [Hide_Focus_on_EMPTY_DEAD_NPC]
        IF BOOL @SYSTEMPACK:PARAMETERS:HideFocus
            HEX @0x00733FA2 = 'E9 64 A3 F3 FF 90'
            HEX @0x0066E30B = '81 3F 24 D7 83 00 74 0B 8B 0D 38 07 AB 00 E9 8A 5C 0C 00 83 BF B8 01 00 00 00 75 EC 8D 8F 68 06 00 00 6A 00 6A 01 E8 6A EE 09 00 85 C0 74 D9 E9 2A 5D 0C 00'
        END
    #/patch

    #patch [Text Color]
        HEX @0x0068EA97 = '90 90 B9 9F 9F 9F FF BA FF FF FF FF'
        HEX @0x0072BDA0 = 'C7 05 DC 1F AB 00 FF FF FF FF C3 90'
        HEX @0x0072BDC0 = 'C7 05 90 1E AB 00 00 FF FF FF C3 90'
        HEX @0x0082D7BB = INT @SYSTEMPACK:INTERFACE:Color_DialogChoice_Inactive //9F9F9FFF // FF9F9F9F
        HEX @0x0068EA9F = INT @SYSTEMPACK:INTERFACE:Color_DialogChoice_Active   //FFFFFFFF // FFFFFFFF
        HEX @0x0072BDA6 = INT @SYSTEMPACK:INTERFACE:Color_Talk_Hero             //FFFFFFFF // FFFFFFFF
        HEX @0x0072BDC6 = INT @SYSTEMPACK:INTERFACE:Color_Talk_NPC              //00FFFFFF // FFFFFF00
    #/patch
    
    #patch [Close_Inventory_In_NPC]
        HEX @0x005CC5B2 = 'E9 88 1D 0A 00'
        HEX @0x0066E33F = '39 35 84 26 AB 00 0F 85 C5 E8 0D 00 83 3D D0 27 AB 00 01 75 0C E8 E7 47 0F 00 89 F1 E9 B0 E8 0D 00 83 3D D0 27 AB 00 02 0F 85 A3 E8 0D 00 E8 DE 45 0F 00 89 F1 E9 97 E8 0D 00'
    #/patch

    #patch [Show_FPS]
        IF BOOL @SYSTEMPACK:DEBUG:Show_FPS_Counter
            HEX @0x00425328 = 'E9 4C 90 24 00'
            HEX @0x0066E379 = 'A3 84 08 AB 00 C6 80 A4 00 00 00 01 E9 A3 6F DB FF'
        END
    #/patch

    #patch [No_Strafe_while_fall]
        IF BOOL @SYSTEMPACK:DEBUG:StrafeBug
            HEX @0x0069ACC7 = '00 00'
        END
    #/patch

    #patch [WASD_Menu]
        HEX @0x0066E38A = '83 F8 1F 0F 84 B1 D8 E6 FF 83 F8 11 0F 84 75 D8 E6 FF 83 F8 1E 0F 84 D2 D8 E6 FF 83 F8 20 0F 84 D7 D8 E6 FF 83 F8 0F 0F 84 23 D8 E6 FF E9 02 D8 E6 FF'
        HEX @0x004DBBB9 = 'E9 CC 27 19 00'
    #/patch
    
    #patch [F6_Windowed_FreeLook]
        HEX @0x004816D9 = '75 00'
    #/patch

    #patch [JUMP_ANIM_Bug (s_ledgeCache?)]
        HEX @0x0050C585 = '68 C8 00 00 00 EB 06 90 90 90 90 EB F3'
        HEX @0x0050C586 = INT @SYSTEMPACK:DEBUG:Cache_Timeout
    #/patch

    #patch [Unlock armor in trade, in npc]
        IF BOOL @SYSTEMPACK:PARAMETERS:ShowArmor
            HEX @0x0070AF4B = '0F 85 00 00 00 00'
            HEX @0x0070B6BC = '75 00'
            IF BOOL @SYSTEMPACK:PARAMETERS:HideFocus
                HEX @0x0066E30B = '81 3F 24 D7 83 00 74 0B 8B 0D 38 07 AB 00 E9 8A 5C 0C 00 83 BF B8 01 00 00 00 75 EC 8D 8F 68 06 00 00 6A 01 6A 00 E8 6A EE 09 00 85 C0 74 D9 E9 2A 5D 0C 00'
            END
        END
    #/patch
    
    #patch [Hide strength and dexterity values in character screen after /]
        IF BOOL @SYSTEMPACK:INTERFACE:Hide_STR_DEX
            HEX @0x0066E3DF = '8D 54 E4 34 83 7C E4 24 02 52 0F 8F B1 FD E0 FF C7 42 0C 00 00 00 00 83 68 0C 01 E9 A1 FD E0 FF'
            HEX @0x0047E19B = 'E9 3F 02 1F 00'
        END
    #/patch

    #patch [Anisotropic_Filtering]
        IF BOOL @SYSTEMPACK:PARAMETERS:AnisotropicFiltering != 0
            HEX @0x0064743E = '68 10 00 00 00 6A 14 57 FF 92 7C 01 00 00 8B 55 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90'
            HEX @0x0064743F = LIM(2, INT @SYSTEMPACK:PARAMETERS:AnisotropicFiltering, 16)
        END
    #/patch
    
    #patch [SaveGameToASCII]
        IF BOOL @UNION:GAME:SaveGameToASCII
            HEX @0x006C5692 = '00'
        END
    #/patch
    
    #patch [Magic_Collision_Fix]
        HEX @0x0066E3FF = '83 EC 20 53 8B 5C 24 2C 55 8B 6C 24 2C 56 8B F3 57 8B D5 33 FF 2B F1 C7 44 24 14 FF FF 7F FF C7 44 24 10 FF FF 7F 7F 2B D1 8D A4 24 00 00 00 00 D9 04 0E D9 E1 D8 1D 78 07 83 00 DF E0 F6 C4 05 7A 1F D9 01 D9 04 0A DE D9 DF E0 F6 C4 05 0F 8B E3 00 00 00 D9 04 0A D9 41 0C DE D9 E9 98 00 00 00 D9 04 0E D8 3D 70 ED 82 00 D9 01 D8 24 0A D8 C9 D9 5C 24 38 D9 41 0C D8 24 0A DE C9 D9 44 24 38 D8 D9 DF E0 F6 C4 05 7A 28 D9 44 24 38 D8 5C 24 14 DF E0 F6 C4 41 75 08 8B 44 24 38 89 44 24 14 D8 54 24 10 DF E0 F6 C4 05 7A 32 D9 5C 24 10 EB 2E D8 54 24 14 DF E0 F6 C4 41 75 06 D9 5C 24 14 EB 02 DD D8 D9 44 24 38 D8 5C 24 10 DF E0 F6 C4 05 7A 0C 8B 44 24 38 89 44 24 10 EB 02 DD D8 D9 44 24 14 D8 5C 24 10 DF E0 F6 C4 41 74 48 D9 44 24 10 D8 1D AC E8 82 00 DF E0 F6 C4 05 7B 37 47 83 C1 04 83 FF 03 0F 8C 23 FF FF FF D9 44 24 14 D8 1D AC E8 82 00 DF E0 F6 C4 05 7A 06 D9 44 24 10 EB 04 D9 44 24 14 D8 15 70 ED 82 00 DF E0 F6 C4 41 EB 0E DD D8 5F 5E 5D 33 C0 5B 83 C4 20 C2 0C 00 D9 C0 8B 4C 24 3C D8 0B 5F 5E D9 5C 24 1C D9 C0 D8 4B 04 D9 5C 24 20 D8 4B 08 D9 44 24 1C D8 45 00 D9 5C 24 10 D9 44 24 20 8B 54 24 10 D8 45 04 D9 5C 24 14 8B 44 24 14 D8 45 08 89 11 89 41 04 5D D9 5C 24 14 8B 54 24 14 89 51 08 B8 01 00 00 00 5B 83 C4 20 C2 0C 00'
        HEX @0x0054E5D1 = 'E8 29 FE 11 00'
    #/patch
    
    #patch [LOW_FPS_NaN_check]    
        HEX @0x0066E59A = '81 3A 00 00 C0 FF 0F 84 F3 3C EC FF 81 3A 00 00 C0 7F 0F 84 E7 3C EC FF D9 45 00 8D 44 8C 20 E9 EB 3C EC FF'
        HEX @0x005322A2 = 'E9 F3 C2 13 00 90 90'
        HEX @0x0066E5BE = '81 7C E4 20 00 00 C0 FF 0F 84 2A 2B EC FF 81 7C E4 20 00 00 C0 7F 0F 84 1C 2B EC FF E9 C1 2A EC FF'
        HEX @0x0061E412 = 'E8 A7 01 05 00'
    #/patch

    #patch [Simple Window]    
        IF BOOL @SYSTEMPACK:DEBUG:SimpleWindow
            HEX @0x0050321B = '68 00 00 00 96'
            HEX @0x00503226 = '68 00 00 00 00'
            HEX @0x00500B10 = 'C3'
        END
    #/patch

    #patch [SmoothAniDistance]
        IF FLOAT @SYSTEMPACK:PARAMETERS:SmoothAniDistance > 2000.0
            HEX @0x0057CA81 = LIM(2000.0, FLOAT @SYSTEMPACK:PARAMETERS:SmoothAniDistance, 1000000.0)
            HEX @0x0057CC5D = 'D8 1D 81 CA 57 00'
            HEX @0x0057CCA0 = 'D8 1D 81 CA 57 00'
        END
    #/patch

    #patch [Lootfix Unconscious]
        HEX @0x0066E5DF = 'C6 86 A0 09 00 00 00 E9 25 BB D9 FF 90 90'
        HEX @0x00736010 = 'E8 CA 85 F3 FF'
    #/patch

    #patch [DrawItemInfo]
        HEX @0x0066E5ED = 'FF 90 B8 00 00 00 8B 8D 8C 00 00 00 8B 54 24 24 8B 45 00 51 52 8B CD C7 05 B0 CF AB 00 01 00 00 00 FF 90 B8 00 00 00 C7 05 B0 CF AB 00 00 00 00 00 E9 FD 95 09 00 E8 48 2C 0A 00 83 C4 04 83 3D B0 CF AB 00 01 0F 84 1D 90 09 00 E9 45 8A 09 00'
        HEX @0x00707C1A = 'E9 CE 69 F6 FF 90'
        HEX @0x00707071 = 'E9 AD 75 F6 FF'
        HEX @0x0066E606 = 4x00000040
        HEX @0x0066E616 = 4x00000040
        HEX @0x0066E62D = 4x00000040
    #/patch

    #patch [CView_Blit_farZ_65534]
        HEX @0x007A668E = '90 90'
    #/patch

    #patch [MobInterCollision]
        IF BOOL @SYSTEMPACK:PARAMETERS:InteractionCollision
            BOOL laddersTestHardCollisions = BOOL @SYSTEMPACK:PARAMETERS:InteractionCollision_TestHardCollisionsOnLadder
            #assembler [MobInterCollision]
                mov     edx, [ebx+84h]              ; vob
                mov     eax, [edx+176]              ; type
                cmp     eax, 130
                jnz     detectCollisions
                mov     eax, dword ptr [edx+964h]   ; interactMob
                test    eax, eax
                jz      detectCollisions
                push    eax
                mov     eax, $laddersTestHardCollisions
                test    eax, eax
                pop     eax
                jz      return
                cmp     dword ptr [eax], 83CF2Ch    ; oCMobLadder vftable
                jnz     return
            detectCollisions:
                mov     eax, [ebx]
                push    esi
                mov     edx, edi
                mov     ecx, ebx
                jmp     0054CE94h
            return:
                jmp     0054CE97h
            #/assembler
            JMP(0x0054CE8D, MobInterCollision)
            CALL(0x0071E400, 0x0077D0E0)
            CALL(0x0071E46D, 0x0077D0E0)
            MemSet(0x007215CF, '90', 0x007215E1 - 0x007215CF)
        END
        
        /*
        IF BOOL @SYSTEMPACK:PARAMETERS:InteractionCollision
            HEX @0x007215CF = 'EB 10 90 90 90 90'
            
            HEX @0x007215CA = 'E8 36 D1 F4 FF'
            HEX @0x0066E705 = '6A 00 E8 F4 18 06 00 8B CF E9 ED C3 0D 00'
            
            HEX @0x0071E378 = '90 90 90 90 90'
            HEX @0x0071E381 = '90 90 90 90 90'
            HEX @0x0071E414 = '90 90 90 90 90'
            HEX @0x0071E420 = '90 90 90 90 90'
        END
        */
    #/patch    
    
    #patch [Rain particle collisions]
        IF BOOL @SYSTEMPACK:PARAMETERS:RainVobCollision
            INT @0x005E227A = 736
        END
    #/patch

    #patch [REMOVE OVERLAYMDS fix]    
        HEX @0x006CFC64 = '74 34'
    #/patch

    #patch [Fix low framerate]
        HEX @0x004DDC6F = '08'
    #/patch
    
    #patch [Exit VDFS]
        HEX @0x004256AE = 'FF 15 44 E6 82 00 6A 00 E8 FF BB 3A 00' // call vdf_exitall, push 0, call exit(0)
    #/patch
  
    #patch [Hide original splash]
        INT nBegin1  = 0x00426809
        INT nEnd1    = 0x00426824
        INT nLength1 = nEnd1 - nBegin1
        MemSet(nBegin1, '90', nLength1)
    
        INT nBegin2  = 0x00426870
        INT nEnd2    = 0x0042687F
        INT nLength2 = nEnd2 - nBegin2
        MemSet(nBegin2, '90', nLength2)
    #/patch

    #patch [Interupt gamestart sound]
        IF BOOL @SYSTEMPACK:PARAMETERS:AbortMenuSound
            HEX @0x004DB89F = '00'
        END
    #/patch

    #patch [Optimize VB]
        IF BOOL @SYSTEMPACK:DEBUG:OptimizeVB !=1
            HEX @0x00657440 = 'EB 2D'
        END
    #/patch

    #patch [Allow undeclarated instances]
        IF HEX @0x005AAF1D == '0F'
            HEX @0x005AAF1D = 'E9 99 00 00 00 90'
        END
    #/patch

    #patch [Timed Overlay Mds Fix 'SetFightAnis after InitAnimations']
        HEX @0x0066E63D = 'E8 CE 59 03 00 89 F1 E8 F7 A5 0C 00 8B 8E 7C 09 00 00 50 E8 EB C3 03 00 E9 43 02 0D 00'
        HEX @0x0073E898 = 'E9 A0 FD F2 FF'
    #/patch

    #patch [Line cache size]
        INT CacheSize = INT @SYSTEMPACK:DEBUG:LineCacheSize
        INT @0x0050B335 = CacheSize
        INT @0x0050B32F = CacheSize * 20
    #/patch

    #patch [UnequipItem]
        HEX @0x007326FF = '68 00 00 00 40 8B CB E8 E5 FF FD FF 53 8B CD E8 5D FB FF FF'
        HEX @0x00731E40 = '68 00 00 00 40 8B CE E8 84 08 FE FF 85 C0 74 21 56 8B CF E8 58 FB FF FF 85 C0 75 15'
    #/patch

    #patch [SAVEDAT IN ASCII]
        IF BOOL @UNION:GAME:SaveDATinASCII
            HEX @0x006C5875 = '01'
        END
    #/patch

    #patch [oCNpc::SetFlag Fix]
        HEX @0x007309CA = '0B'
    #/patch

    #patch [Dialog Starvation Fix]
        HEX @0x00690C57 = 'D9 EA 90 90 90 90'
        HEX @0x00690BE5 = 'D9 EA 90 90 90 90'
        HEX @0x00690CD5 = 'D9 EA 90 90 90 90'
        HEX @0x00690D62 = 'D9 EA 90 90 90 90'
    #/patch

    #patch [prolog]
        HEX @0x0082DF20    = '6A FF 68 CD 3C 82 00 64 A1 00 00 00 00 50 64 89 25 00 00 00 00 83 EC 1C 53 55 56 8B F1 57 8D AE B0 09 00 00 31 DB E9 53 FC EF FF'
        HEX @0x0082DF4B = '6A FF 68 D4 0E 82 00 64 A1 00 00 00 00 50 64 89 25 00 00 00 00 83 EC 08 53 55 56 8B F1 57 89 74 24 14 E8 05 00 00 00 E9 A0 DB ED FF C3'
    #/patch

    #patch [F3 - SetForegroundWindow]
        HEX @0x006CC034    = 'FF 35 2C 42 8D 00 E9 1B 26 FA FF'
        HEX @0x0066E65A    = 'FF 15 78 E3 82 00 C3'
    #/patch

    #patch [IsDead check T_RUNSTRAFEL and T_RUNSTRAFER]
        HEX @0x006AD780    = 'E9 DC 0E FC FF 90'
        HEX @0x0066E661    = '0F 85 4D F4 03 00 8B 96 30 10 00 00 52 8B CF E8 DB 48 E0 FF 50 8B CF E8 13 49 E0 FF 85 C0 0F 85 2F F4 03 00 8B 96 34 10 00 00 52 8B CF E8 BD 48 E0 FF 50 8B CF E8 F5 48 E0 FF 85 C0 0F 85 11 F4 03 00 E9 DE F0 03 00'
    #/patch

    #patch [IsDead before FindNextFightAction]
        HEX @0x0067E42C    = 'E8 77 02 FF FF'
        HEX @0x0066E6A8    = '83 B9 B8 01 00 00 00 0F 85 CB EF 00 00 B8 15 00 00 00 C3'
    #/patch

    #patch [Disable slow code segment in zCTexConGeneric::Unlock]
        INT slowBegin = 0x0065B866
        INT slowEnd = 0x0065BA17
        INT jumpLength = slowEnd - slowBegin - 5
        HEX @slowBegin = 'E9' + HEX jumpLength
    #/patch

    #patch [Ignore damage from GIL_SKELETON_MAGE to GIL_SKELETON]
        HEX @0x00666495    = 'E9 21 82 00 00 90'
        HEX @0x0066E6BB    = '0F 84 14 7F FF FF 80 BF 66 07 00 00 1F 0F 85 CD 7D FF FF 8B 4E 08 39 E9 0F 84 C2 7D FF FF 80 B9 66 07 00 00 21 0F 84 A5 7E FF FF E9 B0 7D FF FF'
    #/patch

    #patch [CS Player crash fix]
        INT begin = 0x0041F890
        INT length = 0x0041FAB5 - begin
        MemSet(begin, '90', length)
    #/patch
  
    #patch [Sliding fix]
      FLOAT @7x00000000 = FLOAT @UNION:DEBUG:SlidingSize
      INT   @0x005B58EC = 7x00000000
    #/patch

    #patch [Fix 1px cutline in zCView objects]
        HEX @0x007A64D6 = '41'
        HEX @0x007A6512 = '42'
        HEX @0x007A6457 = '00'
        HEX @0x007A646A = '00'
        HEX @0x005D449A = '42'
        HEX @0x005D44A6 = '41'
    #/patch

    #patch [CastSpecificSpell - SetAsPlayer fix]
        HEX @0x00486B6A = '90 90 90 90 90 90'
        HEX @0x00486BAF = 'E9 37 7B 1E 00'
        HEX @0x0066E6EB = 'E8 90 D5 FA FF 8B 4E 34 E8 A8 3F 0D 00 8B 4E 40 E8 20 73 0D 00 E9 AF 84 E1 FF'
    #/patch

    #patch [Disable inventory limit]
        INT @INV_MAX_ITEMS = 0x0083C474
        INV_MAX_ITEMS = 0x7FFFFFFF

        INT @0x00704DEB = INV_MAX_ITEMS
        INT @0x00704DF4 = INV_MAX_ITEMS
        INT @0x00706901 = INV_MAX_ITEMS
        INT @0x0070690A = INV_MAX_ITEMS
        INT @0x007078A1 = INV_MAX_ITEMS
        INT @0x007078AA = INV_MAX_ITEMS
        INT @0x0070F502 = INV_MAX_ITEMS
        INT @0x0070F5E9 = INV_MAX_ITEMS
    #/patch

    /* #patch [Stop Focus Talk]
        INT GetTalkingWith = 0x006BCF60
        INT GetFocusNpc = 0x00732BF0
        INT Delta = GetFocusNpc - GetTalkingWith
        
        INT CallA = 0x0042A8BD + 1
        INT CallB = 0x0042A97A + 1
        INT CallC = 0x0042A99C + 1
        INT CallD = 0x0042A9C3 + 1
        
        INT @CallA += Delta
        INT @CallB += Delta
        INT @CallC += Delta
        INT @CallD += Delta
    #/patch */

    #patch [Fix double spawn for summons]
        HEX @0x00778AF5 = '90 90 90 90 90 90 90 90 90 90'
    #/patch

    #patch [GetSpellItem leak fix]
        HEX @0x006802CA = '90 90 90'
    #/patch
    
    #patch [Spawn anim fix]
        HEX @0x0066E713 = '55 8B EC 83 EC 20 89 4D FC 68 FC 5D 8B 00 8D 4D E0 E8 97 29 D9 FF 8D 45 E0 50 8B 4D FC E8 EB 9F 0C 00 8B C8 E8 34 39 FA FF 89 45 F4 8D 4D E0 E8 19 2A D9 FF 8B 4D F4 51 8B 4D FC E8 CD 9F 0C 00 8B C8 E8 F6 47 E0 FF 89 45 F8 83 7D F8 00 74 1B 8B 55 F8 52 8B 4D FC E8 B1 9F 0C 00 8B C8 E8 1A 48 E0 FF 85 C0 74 04 33 C0 EB 12 8B 4D FC 83 C4 20 5D 53 56 8B 74 24 0C E9 56 55 01 00 8B E5 5D C2 04 00'
        HEX @0x00683CE0 = 'E9 2E AA FE FF 90'
    #/patch

    #patch [PARADEJUMPB when GAME_ACTION not pressed]
        IF BOOL @SYSTEMPACK:PARAMETERS:UnlockParadeJumpB
            HEX @0x007524A6 = 'E9 EB C2 F1 FF'
            HEX @0x0066E796 = '8B 4C E4 1C 3B 0D 84 26 AB 00 75 1E 83 3D C0 21 8B 00 00 74 15 8B 0D 50 16 8D 00 8B 11 6A 05 FF 52 04 3C 01 0F 85 5E 40 0E 00 E8 D3 47 16 00 E9 E1 3C 0E 00'
        END
    #/patch

    #patch [CopyDamage to arrow/bolt]
        HEX @0x0066E8B3 = '55 50 8B EC 83 EC 2C 56 C7 45 00 00 00 00 00 83 BB 50 02 00 00 06 75 27 68 FC 2E 8A 00 8D 75 E8 89 F1 E8 E6 27 D9 FF 8D 55 E8 52 89 D9 E8 AB 36 0C 00 89 45 00 8D 4D E8 E8 70 28 D9 FF EB 2E 83 BB 50 02 00 00 05 75 41 68 AC 60 89 00 8D 75 D4 89 F1 E8 B6 27 D9 FF 8D 55 D4 52 89 D9 E8 7B 36 0C 00 89 45 00 8D 4D D4 E8 40 28 D9 FF 89 D9 E8 79 8E 0C 00 89 45 FC 83 7D FC 00 74 0C 8B 45 00 50 8B 4D FC E8 24 3A 0A 00 5E 8B E5 58 5D C2 04 00'
        HEX @0x00748808 = 'E9 A6 60 F2 FF'
    #/patch

    #patch [zCView::PrintCY fix]
        HEX @0x007A9FA4 = '90'
        HEX @0x007A9FA5 = Call(0x007A9FA5, 0x007894E0)
    #/patch

    #patch [skip EV_AIMAT]
        HEX @0x007530F0 = 'EB 79'
    #/patch

    #patch [zFILE_VDFS::Open unsigned]
        HEX @0x0044925F = 'E9 E0 56 22 00 90 0F 85 FF 00 00 00'
        HEX @0x0066E944 = '83 BE FC 29 00 00 FF E9 15 A9 DD FF'
    #/patch
    
    #patch [Regen mana without hp]
        INT @0x00742053 += 4
    #/patch

    #patch [skip Strafe at unsupported BodyStates]
        HEX @0x0069AF4B = 'E8 00 3A FD FF'
        HEX @0x0066E950 = '8B 86 2C 01 00 00 8B 80 6C 07 00 00 83 E0 7F C1 E0 0D C1 F8 0D 83 F8 09 7D 05 E9 11 C3 02 00 31 C0 C2 04 00'
    #/patch

    #patch [Disable WALD zones]
        MemSet(0x00696DAC, '90', 0x00696DCC - 0x00696DAC)
        HEX @0x00696DCC = 'EB'
    #/patch
    
    #patch [forceFlip]
        IF BOOL @SYSTEMPACK:DEBUG:ForceFlip
            HEX @0x00657800 = 'EB'
        END
    #/patch
    
    #patch [Disable occlusion culling]
        IF BOOL @SYSTEMPACK:DEBUG:DisableOcclusionCulling
            HEX @0x0052F6F1 = '90 90'
        END
    #/patch

    #patch [patch SVM (small talk) - ensure the text popups always appear]
        HEX @0x00758BC8 = '83 3D D8 0F AB 00 00 0F 85 08 01 00 00 80 3D A4 C4 AA 00 01 0F 83 FB 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90'
    #/patch

    #patch [Aligning npc by ladder]
        HEX vector = '00 00 00 00 00 00 00 00 00 00 00 00'
        
        #assembler [0x00727E45]
            cmp     dword ptr [ebp], 83CF2Ch ; oCMobLadder vftable
            jnz     return
            mov     ecx, ebp                 ; ladder
            lea     eax, [$vector]       
            push    eax                      ; vector
            call    52DCB0h                  ; GetAtVectorWorld
            mov     ecx, [esp+40h]           ; npc
            test    ecx, ecx
            jz      return
            push    eax      
            call    61CBC0h                  ; SetHeadingAtWorld
        return:
            orgcode
        #/assembler
        
        #assembler [0x0061CDB7]
            orgcode
            test    eax, eax
            jz      0x0061CE3E
        #/assembler
        
        #assembler [0x0061DB71]
            orgcode
            test    eax, eax
            jz      0x0061DBEB
        #/assembler
    #/patch

    #patch [Disable form return after death]
        #assembler [0x00472117]
            mov     ecx, [edi+12Ch]
            mov     edx, [ecx+1B8h]
            cmp     edx, 0
            jle     472146h
            orgcode
        #/assembler
    #/patch

    #patch [Inventory freeze at spell cast fix]
        #assembler [checkIsAniActive] //IsAniActive(s_cast) in RemoveWeapon1
            CMP EAX,1
            JE 6B3081h
            MOV EAX,DWORD PTR DS:[EDI+11E0h]    ; s_cast
            MOV ESI,DWORD PTR DS:[EDI+68h]
            PUSH EAX
            MOV ECX,ESI
            CALL 472F50h                        ; GetAniFromAniID
            PUSH EAX
            MOV ECX,ESI
            CALL 472F90h                        ; IsAniActive
            CMP EAX,1
            JE 6B3081h
            JMP 6B336Ah
        #/assembler
        JMP(0x006B3079, checkIsAniActive)
        HEX @0x006B307E = '90 90 90'        
    #/patch

    /* #patch [Don't open inventory when spell casting]
        #assembler [LockInventory]
            push    ecx         ; save npc
            call    734B40h     ; GetAnictrl
            mov     ecx, eax    
            call    6B8860h     ; IsInCastAni
            cmp     eax, 0      
            pop     ecx         ; restore npc
            jnz     006FCEDBh   
        return:                 
            push    0           
            call    762250h     ; OpenInventory
            jmp     6FC5DCh
        #/assembler
        JMP(0x006FC5D6, LockInventory)
    #/patch */
    
    #patch [Step sounds in more actions]
        #assembler [NpcIsMoving]
            mov     eax, 100Ch          ; _t_walk_2_walkl
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1010h          ; _t_walkl_2_walk
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1014h          ; _s_walkl
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1040h          ; _s_walkbl
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1060h          ; _t_jumpb
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1064h          ; _t_stand_2_jump
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 106Ch          ; t_jump_2_stand
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1030h          ; _t_strafel
            call    aniIsActive
            test    eax, eax
            jnz     return
            mov     eax, 1034h          ; _t_strafer
            call    aniIsActive
        return:
            jmp     69B198h
        aniIsActive:
            mov     ecx, [esi+68h]      ; model
            push    ecx
            push    dword ptr [esi+eax]
            call    472F50h             ; GetAniFromAniID
            pop     ecx
            push    eax
            call    472F90h             ; IsAniActive
            ret
        #/assembler
        JMP(0x0069B193, NpcIsMoving)
        
        #assembler [0x00684B64]
            push    eax
            mov     ecx, [ebp+97Ch]     ; human_ai
            push    0
            call    69B180h             ; CreateFootStepSound
            pop     eax
            orgcode
        #/assembler
    #/patch
    
    #patch [Stop strafe when movlock]
        #assembler [0x00683DFE]
            mov     ecx, esi
            call    7425B0h             ; IsSelfPlayer
            test    eax, eax
            jz      continue
            call    7380E0h             ; IsMovLock
            test    eax, eax
            jz      continue
            mov     ebp, esi
            jmp     684B64h
        continue:
            orgcode
        #/assembler
        #assembler [0x00660C2B]
            push    ebx
            push    ebp
            //mov     ecx, [ebp+24h]              ; npc
            mov     eax, [ecx+980h]             ; anictrl
            push    dword ptr [eax+1030h]       ; _t_strafel
            push    dword ptr [eax+1034h]       ; _t_strafer
            call    0x00738720                  ; GetModel
            cmp     eax, 0
            jz      skip
            mov     ecx, eax
            mov     ebp, eax
            call    0x0057ABE0                  ; StopAni
            mov     ecx, ebp
            call    0x0057ABE0                  ; StopAni
        skip:
            pop     ebp
            pop     ebx
            orgcode
        #/assembler
    #/patch
    
    #patch [Change BodyState in strafe]
        #assembler [0x0068472B]
            orgcode
            mov     eax, [ebp+980h]     ; anictrl
            mov     eax, [eax+160h]     ; walkmode
            cmp     eax, 3
            jge     return
            cmp     eax, 0
            jnz     setBodyState
            mov     eax, 1
        setBodyState:
            mov     ecx, ebp
            push    eax
            call    75E920h
        return:
        #/assembler
    #/patch
    
    #patch [Create draw and remove weapon perceptions on run]
        INT this = 0
        #assembler [0x0074CC18]
            mov     [$this], ecx
            orgcode
        #/assembler
        #assembler [0x0074D2C4]
            test    eax, eax
            jz      returnFalse
            mov     ecx, [$this]
            mov     eax, [ecx]
            mov     eax, [eax+100h] ; IsAPlayer
            call    eax
            test    eax, eax
            jz      returnTrue
            push    0
            push    ecx
            push    24              ; NPC_PERC_DRAWWEAPON
            call    75B270h         ; CreatePassivePerception
        returnTrue:
            mov     eax, 1
        returnFalse:
            orgcode
        #/assembler
        MemSet(0x0074DAEF, '90', 0x0074DAFB - 0x0074DAEF)
        
        #assembler [0x0074DB22]
            mov     [$this], ecx
            orgcode
        #/assembler        
        #assembler [0x0074E494]
            test    eax, eax
            jz      returnFalse
            mov     ecx, [$this]
            mov     eax, [ecx]
            mov     eax, [eax+100h] ; IsAPlayer
            call    eax
            test    eax, eax
            jz      returnTrue
            push    0
            push    ecx
            push    11              ; NPC_PERC_ASSESSREMOVEWEAPON
            call    75B270h         ; CreatePassivePerception
        returnTrue:
            mov     eax, 1
        returnFalse:
            orgcode
        #/assembler
        MemSet(0x0074E955, '90', 0x0074E961 - 0x0074E955)
    #/patch
    
    #patch [Close alpha-lines on multipage documents]
        #assembler [0x0068CF06]
            mov     ebx, [edi+48h]
            imul    ebx, -2
            add     eax, ebx
            orgcode
        #/assembler
    #/patch
    
    #patch [Unpack inventory before trade]
        #assembler [0x00662E69]
            push    ecx
            mov     eax, [esi+20h]      ; npc
            lea     ecx, [eax+668h]     ; inventory
            call    710030h             ; UnpackAllItems
            pop     ecx
            orgcode
        #/assembler
    #/patch
    
    #patch [CompatData fix]
        IF BOOL @SYSTEMPACK:DEBUG:BorderFix
            INT address = ImportSymbol("ddraw.dll", "SetAppCompatData")
            IF address != 0
                HEX @impSetAppCompatData = address 
                impSetAppCompatData(12, 0)
            END
        END
    #/patch
    
    #patch [Lost sound fix in DirectSound3D provider]
        INT impSetSampleCone = ImportSymbol("Mss32.dll", "_AIL_set_3D_sample_cone@16")
        IF impSetSampleCone
            FLOAT inner = 360.0
            FLOAT outer = 0.0
            #assembler [impSetSampleCone]
                mov     dword ptr [esp+8h], $inner
                mov     dword ptr [esp+0Ch], $outer
                orgcode
            #/assembler
        END
    #/patch
    
    #patch [Double swim_2_dive fix]
        #assembler [0x006B5A2C]
            orgcode
            MOV DWORD PTR DS:[0x0AAD6AC],0x1
        #/assembler
    #/patch
    
    #patch [Dont reset active npcs at midnight]
        #assembler [0x00742143]
            orgcode
            mov     eax, [esi+00B8h]
            test    eax, eax
            jnz     742358h
        #/assembler
    #/patch
    
    #patch [Fantom light after remove torch or other sources fix]
        INT exit = 0
        #assembler [0x0052AD40]
            mov     dword ptr [$exit], 0
            orgcode
        #/assembler
        #assembler [0x0052AD8C]
            jp      return
            mov     dword ptr [$exit], 1
        return:
        #/assembler
        #assembler [0x0052AFA0]
            mov     eax, dword ptr [$exit]
            test    eax, eax
            jnz     52B62Dh
            orgcode
        #/assembler
    #/patch
    
    #patch [Disable inventory key in dialogs]
        #assembler [0x006FC5D6]
            push    ecx
            call    0x0065F790      ; GetInformationManager
            mov     eax, [eax+2Ch]  ; IsDone
            test    eax, eax
            pop     ecx
            jz      return
            push    ebx
            call    0x00762250
        return:
        #/assembler [0x006FC5DC]
    #/patch
    
    #patch [Monster-fish fix]
        HEX @0x00473977 = 'EB 25'
    #/patch
    
    #patch [Transform teleportation through the walls fix]
        BOOL checkEnoughSpace = True
        #assembler [0x00486D32]
            mov     dword ptr ds:[$checkEnoughSpace], 0
            orgcode
            mov     dword ptr ds:[$checkEnoughSpace], 1
        #/assembler
        #assembler [0x00486D7D]
            mov     dword ptr ds:[$checkEnoughSpace], 0
            orgcode
            mov     dword ptr ds:[$checkEnoughSpace], 1
        #/assembler
        #assembler [0x0048706A]
            mov     dword ptr ds:[$checkEnoughSpace], 0
            orgcode
            mov     dword ptr ds:[$checkEnoughSpace], 1
        #/assembler
        
        CALL(0x00486BEA, 0x0077D130)
        CALL(0x00486F62, 0x0077D130)
        
        #assembler [0x00745DEE]
            mov     eax, dword ptr ds:[$checkEnoughSpace]
            test    eax, eax
            jnz     searchPosition
            call    0x0077D130
            jmp     return
        searchPosition:
            call    0x0077C860
        return:
        #/assembler
    #/patch
    
    #patch [Relax ranged weapon after remove]
        BOOL relax = False
        // Relax weapon after put in slot
        #assembler [0x0074A20E]
            mov     dword ptr [$relax], 1
            push    0
            push    0
            mov     ecx, esi
            call    0x00682B40
            mov     dword ptr [$relax], 0
            orgcode
        #/assembler
        #assembler [0x00682B5E]
            mov     eax, dword ptr [$relax]
            test    eax, eax
            jnz     0x00682EA7
            orgcode
        #/assembler
        
        // Fix incorrectry object casting
        #assembler [0x00682EAC]
            test    eax, eax
            jz      0x00682F47
            mov     eax, [eax+0C8h]     ; visual
            orgcode
        #/assembler
        #assembler [0x00682F4E]
            test    eax, eax
            jz      0x00682FE9
            mov     eax, [eax+0C8h]     ; visual
            orgcode
        #/assembler
        
        // Instantly relax
        FLOAT @0x00682F0D = 0.0
        FLOAT @0x00682F12 = 0.0
        FLOAT @0x00682FAF = 0.0
        FLOAT @0x00682FB4 = 0.0
    #/patch

    #patch [Disallow locking focus non-npc objects]
        #assembler [0x006FC20C]
            mov     ecx, dword ptr ds:[0x00AB2684]  ; player
            test    ecx, ecx
            jz      0x006FC21E
            call    0x00732BF0                      ; GetFocusNpc
            test    eax, eax
            jz      0x006FC21E
            orgcode
        #/assembler
    #/patch

    #patch [Fix crash while transforming in water]
        #assembler [0x0050E9F4]
            push ecx
            mov ecx, [ecx+00B8h] ; homeWorld
            cmp ecx, 0
            pop ecx
            je 0x0050F268
            orgcode
        #/assembler
    #/patch

    #patch [Restore mortality after dialog]
        IF BOOL @SYSTEMPACK:DEBUG:RestoreMortalityAfterDialog
            INT memString = CreateMemString("AIV_INVINCIBLE")
            #assembler[0x006631B9]
                mov     ebp, [ecx+24h]          ; Player
                test    ebp, ebp
                jz      return
                
                push    ecx
                mov     ecx, 0x00AB40C0         ; parser
                push    $memString
                call    0x007938D0              ; GetSymbol
                pop     ecx
                test    eax, eax
                jz      return
                
                mov     eax, [eax+18h]          ; single_intdata
                mov     ebx, 0
                mov     [ebp+288h+eax*4], ebx   ; aiscriptvars[eax]
            return:
                orgcode
            #/assembler
        END
    #/patch

    #patch [Disable frame activity on pause]
        #assembler [0x00602C71]
            orgcode
            mov     eax, [ecx+00B0h]    ; type
            cmp     eax, 130            ; zVOB_TYPE_NSC
            jnz     return
            mov     eax, 0x0099B3D4     ; ztimer
            mov     eax, [eax+04h]      ; frameTimeFloat
            test    eax, eax
            jz      0x00602EC3
        return:
        #/assembler
    #/patch

    #patch [VISEME at 60Hz fix]
        #assembler [0x005A6863]
            orgcode
            FADD DWORD PTR DS:[0x0082F330]
        #/assembler

        #assembler [0x005A6893]
            orgcode
            FADD DWORD PTR DS:[0x0082F330]
        #/assembler		
    #/patch
#/engine
