Code:
#include "stdafx.h"
#include "..\..\include\homm3.h"
#include "..\..\include\HoMM3_Dlg.cpp"
Patcher* _P;
PatcherInstance* _PI;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////// константы диалога экспы монстров /////// /////////////////////////////////////////
#define o_Dlg_ExpaMon 0x845880
#define o_DlgLoop (*(_int_*)0x847F00)
#define o_DlgUpgr (*(_int_*)0x840E18)
#define o_DlgTrig (*(_int_*)0x845AE8)
#define o_Mon     (*(_int_*)0x84730C)
#define o_Num     (*(_int_*)0x847D84)
#define o_Expo     (*(_int_*)0x85EB48)
#define o_CrExpo (*(_int_*)0x840F88)
#define o_MayChooseArtOpt (*(_int_*)0x841940)
#define o_Dlg_Case8 (*(_int_*)0x846B00)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////// дополнительный диалог с флагом опыта /// /////////////////////////////////////////
int New_Dlg_ExpaMon_Case8(int style)
{
    int x = 512;
    int y = 400;
    if (style == 1)
        y += 40;
    _Dlg_* dlg = _CustomDlg_::Create(-1, -1, x, y, DF_SCREENSHOT | DF_SHADOW, NULL);
    Set_DlgBackground_RK(dlg, 0);
    dlg->AddItem(_DlgStaticDef_::Create(dlg->width/2 -41, 26, 2, "PSKILL.def", 4, 0, 0x12)); 
    dlg->AddItem(_DlgStaticText_::Create(20, 126, dlg->width -40, 20, Get_ITxtExp(460), "bigfont.fnt", 10, 5, ALIGN_H_CENTER | ALIGN_V_TOP, 0));
    for (int i = 0; i < 11; i++){
        dlg->AddItem(_DlgStaticText_::Create(24, 150 +i*20, dlg->width -48, 20, Get_ITxtExp(461 +i), "bigfont.fnt", 7, 10+i, ALIGN_H_LEFT | ALIGN_V_CENTER, 0));    
    }
    dlg->AddItem(_DlgStaticText_::Create(24, 150, dlg->width -48, 20, o_pCreatureInfo[o_Mon].name_single, "bigfont.fnt", 1, 22, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    
    int runk = CALL_2(_int_, __cdecl, 0x727F20, 1000, o_Expo); 
    sprintf(o_TextBuffer, "%s (%d)", Get_ITxtExp(2+runk), runk);
    dlg->AddItem(_DlgStaticText_::Create(24, 170, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 23, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    sprintf(o_TextBuffer, "%d", o_Expo); 
    dlg->AddItem(_DlgStaticText_::Create(24, 190, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 24, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    sprintf(o_TextBuffer, "%d", CALL_3(_int_, __cdecl, 0x727FB0, 1000, runk +1, 0) - o_Expo); 
    dlg->AddItem(_DlgStaticText_::Create(24, 210, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 25, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    int t1 = CALL_1(_int_, __cdecl, 0x7283D0, 1000); 
    int t2 = CALL_1(_int_, __cdecl, 0x727E20, 1000) * t1 / 100;
    sprintf(o_TextBuffer, "%d%% (%d)", t1, t2);
    dlg->AddItem(_DlgStaticText_::Create(24, 230, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 26, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    sprintf(o_TextBuffer, "%d", o_Num); 
    dlg->AddItem(_DlgStaticText_::Create(24, 250, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 27, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    t1 = CALL_3(_int_, __cdecl, 0x727FB0, 1000, runk, 0);
    t2 = 999999;
    if( t1 ){ t2 = o_Num * o_Expo / t1 - o_Num; }    
    sprintf(o_TextBuffer, "%d", t2); 
    dlg->AddItem(_DlgStaticText_::Create(24, 270, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 28, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    sprintf(o_TextBuffer, "%hf", CALL_1(double, __cdecl, 0x727C00, 1000)); 
    dlg->AddItem(_DlgStaticText_::Create(24, 290, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 29, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    sprintf(o_TextBuffer, "%hf", CALL_1(double, __cdecl, 0x727E00, 1000)); 
    dlg->AddItem(_DlgStaticText_::Create(24, 310, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 30, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    t1 = CALL_1(_int_, __cdecl, 0x7283B0, 1000);
    sprintf(o_TextBuffer, "%d", t1); 
    dlg->AddItem(_DlgStaticText_::Create(24, 330, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 31, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    t2 = CALL_3(_int_, __cdecl, 0x727FB0, 1000, 10, 0);
    int t3 = 999999; 
    if ( t2 ){
        int t4 = o_Num * (t2 + t1);
        t3 = t4 / t2 - o_Num;
    }
    sprintf(o_TextBuffer, "%d", t3); 
    dlg->AddItem(_DlgStaticText_::Create(24, 350, dlg->width -48, 20, o_TextBuffer, "bigfont.fnt", 1, 32, ALIGN_H_RIGHT | ALIGN_V_CENTER, 0));
    if (style == 1){
        dlg->AddItem(_DlgStaticPcx8_::Create(dlg->width/2 -33, dlg->height -26 -31, 0, "Box64x30.pcx"));
        dlg->AddItem(_DlgButton_::Create(dlg->width/2 -32, dlg->height -26 -30, 64, 30, 1, "iOkay.def", 0, 1, 1, 28, 2));
        dlg->Run();
    }
    if (style == 4)
        dlg->RMC_Show(); 
        
    dlg->Destroy(TRUE);
    return 1;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////// диалог по выбору типа действия артефакта /////////////////////////////////////////
int __stdcall New_Dlg_ExpaMon_BannerDlg_Proc(_Dlg_* dlg, _EventMsg_* msg)
{
    int r = dlg->DefProc(msg);
        if (msg->subtype == MST_LBUTTONCLICK){ 
            if (msg->item_id >= 30 && msg->item_id <40){
                for (int i = 0; i < 9; i++){
                    ((_DlgStaticDef_*)dlg->GetItem(30+i))->def_frame_index = 0;                
                }
                ((_DlgStaticDef_*)dlg->GetItem(msg->item_id))->def_frame_index = 1;
                CALL_2(_int_, __thiscall, 0x728380, o_CrExpo, msg->item_id -30); 
                dlg->Redraw(TRUE);
            }
        }
    return r;
}
int New_Dlg_ExpaMon_BannerDlg()
{
    if (!o_MayChooseArtOpt || !o_CrExpo){
        b_MsgBox(Get_ITxtExp(455), 4);    
        return 0;
    }
    _Dlg_* dlg = _CustomDlg_::Create(-1, -1, 460, 420, DF_SCREENSHOT | DF_SHADOW, New_Dlg_ExpaMon_BannerDlg_Proc);
    Set_DlgBackground_RK(dlg, 0);
    sprintf(o_TextBuffer, "%s", Get_ITxtExp(340));
    dlg->AddItem(_DlgStaticText_::Create(18, 30, 424, 30, o_TextBuffer, "bigfont.fnt", 7, 3, ALIGN_H_CENTER | ALIGN_V_TOP, 0));
    
    int dy = 34;
    for (int i = 0; i < 9; i++){
        dlg->AddItem(CALL_8 (_DlgItem_*, __thiscall, 0x44FE00, o_New(56), 18, 62+i*dy, 424, 30, 10+i, *(int*)(*(int*)0x6AAD18 + 118), 1024));
        dlg->GetItem(10+i)->SendCommand(5, 4);
        
        sprintf(o_TextBuffer, "%s", Get_ITxtExp(341 +i));
        dlg->AddItem(_DlgStaticText_::Create(56, 69+i*dy, 372, 16, o_TextBuffer, "smalfont.fnt", 1, 20+i, ALIGN_H_LEFT | ALIGN_V_CENTER, 0));
        dlg->AddItem(_DlgButton_::Create(20, 65+i*dy, 30+i, "SYSOPCHK.DEF", 0, 0, 0, 0));
    } 
    int s = CALL_1(_int_, __thiscall, 0x727BE0, o_CrExpo);
    ((_DlgStaticDef_*)dlg->GetItem(30+s))->def_frame_index = 1;
    dlg->AddItem(_DlgStaticPcx8_::Create(dlg->width/2 -33, dlg->height -20 -31, 0, "Box64x30.pcx"));
    dlg->AddItem(_DlgButton_::Create(dlg->width/2 -32, dlg->height -20 -30, 64, 30, 95, "iOkay.def", 0, 1, 1, 28, 2));
    dlg->Run();
    int t = CALL_1(_int_, __thiscall, 0x727BE0, o_CrExpo);
    dlg->Destroy(TRUE);
    if ( s == t)
         return 0;
    else return 1;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// основной диалог ////////////////////////////////////////////////////////////////////
int __stdcall New_Dlg_ExpaMon_Proc(_Dlg_* dlg, _EventMsg_* msg)
{
    int r = dlg->DefProc(msg);
    if (msg->type == MT_MOUSEOVER)
        {
            _DlgItem_* it = dlg->FindItem(msg->x_abs, msg->y_abs);
            char* text_bar = "";
            if (it)    
            {
                switch (it->id)
                {
                    case 1: text_bar = Get_ITxtExp(107); break;
                    
                    case 6: text_bar = Get_ITxtExp(456); break;
                    case 8: case 9: sprintf(o_TextBuffer, "%s", *(int*)(o_Dlg_ExpaMon +76)); text_bar = o_TextBuffer; break;                
                    case 10: text_bar = Get_ITxtExp(123); break;
                    case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:
                    case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26:
                        sprintf(o_TextBuffer, "%s", *(int*)(*(int*)(o_Dlg_ExpaMon +40)+4*(it->id-11))); text_bar = o_TextBuffer; break;
                    case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37:
                    case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: 
                        sprintf(o_TextBuffer, "%s", *(int*)(*(int*)(o_Dlg_ExpaMon +48)+4*(it->id-30))); text_bar = o_TextBuffer; break;
                    
                    case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57:
                    case 58: case 59: case 60: case 61: case 62: case 63: case 64: case 65:
                        sprintf(o_TextBuffer, "%s", *(int*)(*(int*)(o_Dlg_ExpaMon +24)+4*((it->id-50)/2))); text_bar = o_TextBuffer; break;                    
                    case 95: text_bar = "Ok"; break;                     
                    default: text_bar = "";    break;
                }
                ((_DlgTextEdit_*)dlg->GetItem(2))->SetText(text_bar);
                ((_DlgTextEdit_*)dlg->GetItem(2))->RedrawScreen();
                dlg->Redraw();
            }  
    } 
    if (msg->type == MT_MOUSEBUTTON)
    {
        if (msg->subtype == MST_RBUTTONDOWN)
        {
            int frame = 0;
            switch (msg->item_id)
            {
                case 3: dlg->Redraw(); break;
                case 5: case 6: 
                case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
                case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25:
                case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37:
                case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45:
                        New_Dlg_ExpaMon_Case8(4); break;                          
                case 9: if (New_Dlg_ExpaMon_BannerDlg() == 1){ 
                            o_DlgLoop = 1;
                            return dlg->Close(msg);    
                        }    break; 
                case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57:
                case 58: case 59: case 60: case 61: case 62: case 63: case 64: case 65:
                    frame = *(int*)(*(int*)(o_Dlg_ExpaMon +20)+4*((msg->item_id-50)/2));
                    if (frame == 0){
                        sprintf(o_TextBuffer, "%s\n", *(int*)(*(int*)(o_Dlg_ExpaMon +16)+4*((msg->item_id-50)/2)));
                    }
                    else {
                        sprintf(o_TextBuffer, "%s\n\n %s\n", *(int*)(*(int*)(o_Dlg_ExpaMon +16)+4*((msg->item_id-50)/2)),
                                                            Get_ITxtExp(*(int*)(0x840E1C +4*((msg->item_id-50)/2))+1));
                    }    
                    b_MsgBoxAndDef("Expa_Mon.def", frame, o_TextBuffer);    break; 
                    
                default: break; 
            }
        } 
        if (msg->subtype == MST_LBUTTONCLICK){
            if (msg->item_id == 1)    {
                o_DlgUpgr = 1;
                return dlg->Close(msg);
            }
        }
        if (msg->subtype == MST_LBUTTONDOWN){ 
            if (msg->item_id == 5 || msg->item_id == 6 || (msg->item_id >= 10 && msg->item_id <= 45)){
                New_Dlg_ExpaMon_Case8(1);
            }
            if (msg->item_id == 9){
                int hero_id = *(short*)(o_CrExpo +12);
                if (hero_id < 0 || hero_id >=156 )
                    hero_id = -1;
                if (hero_id == -1 || !o_MayChooseArtOpt || !o_CrExpo){
                    b_MsgBox(Get_ITxtExp(455), 1);
                }
                else {
                    b_MsgBoxD(Get_ITxtExp(459), MBX_OKCANCEL, 8, 156);
                    if (o_WndMgr->result_dlg_item_id == DIID_OK) {
                        o_DlgLoop = CALL_1(_int_, __thiscall, 0x728280, o_CrExpo);
                        _Hero_* hero = o_GameMgr->GetHero(hero_id);
                        int Art[] = {156, -1};
                        CALL_3(char, __thiscall, 0x4E3200, hero, &Art, -1); 
                        return dlg->Close(msg);    
                    }
                }
            }
        }
    } 
    return r;
}
int New_Dlg_ExpaMon(signed int Mon, signed int  Num, int Expo, _ptr_ CRExpo)
{
    int dop_str = *(int*)(o_Dlg_ExpaMon +52);
    int dop_str_txt = dop_str;
    int art_num = *(int*)(o_Dlg_ExpaMon +88);
    int Changin = *(int*)(o_Dlg_ExpaMon +84);
    
    int is_art = 0;
    if (CRExpo){
        if (CALL_1(_int_, __thiscall, 0x7279C0, CRExpo)){
            is_art = 1;
            dop_str_txt -= 1;
            if (art_num < 1)
            art_num = 1;
        }
    } 
    int x = 800;
    int y = 252 +8 +16*(dop_str_txt) +52*Round((float)dop_str/2); 
    _Dlg_* dlg = _CustomDlg_::Create(-1, -1, x, y, DF_SCREENSHOT | DF_SHADOW, New_Dlg_ExpaMon_Proc);
    Set_DlgBackground_RK(dlg, 1);
    b_MouseMan_SetCursor(0,0);
    // Добавляем кнопку OK (id = 30722)
    dlg->AddItem(_DlgStaticPcx8_::Create(dlg->width -31 -52, dlg->height - 31 -40, 0, "Box64x30.pcx"));
    dlg->AddItem(_DlgButton_::Create(dlg->width -30 -52, dlg->height -30 -40, 64, 30, 95, "iOkay.def", 0, 1, 1, 28, 2));
    // Добавляем кнопку просмотра улучшенного (id = 1)
    int is_grade_bttn_on = *(int*)(o_Dlg_ExpaMon +56);
    if (is_grade_bttn_on){
        dlg->AddItem(_DlgStaticPcx8_::Create(dlg->width -31 -122, dlg->height - 31 -40, 0, "Box64x30.pcx"));
        dlg->AddItem(_DlgButton_::Create(dlg->width -30 -122, dlg->height -30 -40, 64, 30, 1, "DlgUpExp.def", 0, 1, 0, 88, 0));
    }
    // Подсказка (id = 2)
    dlg->AddItem(_DlgStaticText_::Create(8, dlg->height -26, dlg->width -34, 18, "", "smalfont.fnt", 1, 2, ALIGN_H_CENTER | ALIGN_V_CENTER, 0));
    // заголовок диалога (id = 3)
    sprintf(o_TextBuffer, "%s", *(int*)o_Dlg_ExpaMon);
    dlg->AddItem(_DlgStaticText_::Create(340, 14, 120, 30, o_TextBuffer, "bigfont.fnt", 7, 3, ALIGN_H_CENTER | ALIGN_V_TOP, 0));
    // нижнее описание монстра красным (id = 4)
    sprintf(o_TextBuffer, "%s", *(int*)(o_Dlg_ExpaMon +4));
    dlg->AddItem(_DlgStaticText_::Create(18, dlg->height - 70, dlg->width -200, 30, o_TextBuffer, "bigfont.fnt", 27, 4, ALIGN_H_LEFT | ALIGN_V_CENTER, 0));
    // картинка и рамка монстра (id = 5, 6)
    dlg->AddItem(_DlgStaticDef_::Create(18, 35, 5, "twcrport.def", Mon +2, 0, 0x12)); 
    dlg->AddItem(_DlgStaticDef_::Create(18, 35, 6, "twcrport.def", 1, 0, 0x12));  
    // название артефакта и рамка для него (id = 7,8)
    dlg->AddItem(_DlgStaticText_::Create(18, 100, 60, 15, o_GENRLTXT_TXT->GetString(615), "medfont.fnt", 1, 7, ALIGN_H_CENTER | ALIGN_V_TOP, 0));
    dlg->AddItem(_DlgStaticPcx8_::Create(23, 117, 8, "artbckg.pcx"));    
    
    // артефакт и цифры его кол-ва (id = 9)
    if (art_num > 0){
        dlg->AddItem(_DlgStaticDef_::Create(25, 119, 9, "Artifact.def", 156, 0, 0x12));    // рамка монстра (id = 9)
        sprintf(o_TextBuffer, "%d", art_num);
        dlg->AddItem(_DlgStaticText_::Create(47, 142, 20, 20, o_TextBuffer, "tiny.fnt", 1, 9, ALIGN_H_RIGHT | ALIGN_V_BOTTOM, 0));
    }
    
    // желтая рамка обрамления ранга
    int rank_mon = 0;
        if ((_ptr_)CRExpo)
            rank_mon = CALL_2(int, __cdecl, 0x727F20, 1000, Expo);
    dlg->AddItem(CALL_8 (_DlgItem_*, __thiscall, 0x44FE00, o_New(56), 168-4+ 56*rank_mon, 50, 56, 128+16*(dop_str_txt), 100, *(int*)(*(int*)0x6AAD18 + 118), 1024));
    dlg->GetItem(100)->SendCommand(5, 4);
    // верхние названия     
    for (int i = 0; i <= 10; i++){
    dlg->AddItem(_DlgStaticText_::Create(168 +56*i, 34, 58, 15, 
        CALL_3 (char*, __cdecl, 0x77710B, 1+i, 1, 0x847D88), 
        "smalfont.fnt", 7, 10, ALIGN_H_LEFT | ALIGN_V_TOP, 0));
    }
    // элементы заполнения колонок (первый столбик) id = 11...(26)
    int y0 = 50;    int yy = 16;
    for (int i = 0; i < (8+dop_str_txt); i++){
        sprintf(o_TextBuffer, "%s", *(int*)(*(int*)(o_Dlg_ExpaMon +36)+4*i));
        dlg->AddItem(_DlgStaticText_::Create(80, y0 + yy*i, 80, 15, o_TextBuffer, "smalfont.fnt", 7, 11+i, ALIGN_H_LEFT | ALIGN_V_TOP, 0));
    }
    int x0 = 168;    int xx = 56;
    char text[16];
    for (char i = 0; i < (8+dop_str_txt); i++){
        sprintf(o_TextBuffer, "%s", *(int*)(*(int*)(o_Dlg_ExpaMon +44)+4*i));
        for (char j = 0; j < 11; j++){
            for (char k = 0; k < 8; k++){
                if (*(char*)(*(int*)(*(int*)(o_Dlg_ExpaMon +44)+4*i) +j*8 +k) != ' ')
                    text[k] = *(char*)(*(int*)(*(int*)(o_Dlg_ExpaMon +44)+4*i) +j*8 +k);
                else {
                    for (char s = k; s < 16; s++){
                        text[s] = ' ';
                    }
                    k = 7;
                }
            } 
            dlg->AddItem(_DlgStaticText_::Create(x0 + xx*j, y0 + yy*i, 54, 15, text, "smalfont.fnt", 1, 30+i, ALIGN_H_LEFT | ALIGN_V_TOP, 0));
        }
    }
    // нижние картинки с дефами (id 50 ... )
    int xd = 18;  int xxd = 366;
    int yd = 50 +8 +16*8 +16*dop_str_txt; 
    int yyd = 52;
    if (dop_str > 0 || art_num > 0){
        for (int i = 0; i < (dop_str); i++){
            dlg->AddItem(_DlgStaticDef_::Create(xd, yd, 50+i*2, "Expa_Mon.def", *(int*)(*(int*)(o_Dlg_ExpaMon +20)+4*i), 0, 0x12)); 
            sprintf(o_TextBuffer, "%s", *(int*)(*(int*)(o_Dlg_ExpaMon +16)+4*i));
            dlg->AddItem(_DlgStaticText_::Create(xd+54, yd, 330, 50, o_TextBuffer, "smalfont.fnt", 7, 51+i*2, ALIGN_H_LEFT | ALIGN_V_CENTER, 0));
            if (xd == 18)
                xd = 400;
            else xd = 18;
            if ( (i+10)%2 == 1 )
                yd += 52;
        }    
    } 
    dlg->Run();
    dlg->Destroy(TRUE);
    return 0;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int Y_ChangeBmp_To_DefFrame()
{
        
        _PI->WriteDword(0x792048, 0); // E_ART.bmp
        int sdv = 7;
        _PI->WriteDword((0x71F86F +sdv), 1);  // E_SHOOTN.bmp
        _PI->WriteDword((0x71F89F +sdv), 2);  // N_SHOOTN.bmp
        _PI->WriteDword((0x71F94C +sdv), 3);  // E_CASTER.bmp
        _PI->WriteDword((0x71F97C +sdv), 4);  // N_CASTER.bmp
        _PI->WriteDword((0x71FA2D +sdv), 5);  // E_FEAR.bmp
        _PI->WriteDword((0x71FA5E +sdv), 6);  // N_FEAR.bmp
        _PI->WriteDword((0x71FB0B +sdv), 7);  // E_RETAIL1.bmp
        _PI->WriteDword((0x71FB3B +sdv), 8);  // N_RETAIL1.bmp
        _PI->WriteDword((0x71FBE8 +sdv), 9);  // E_DEFBON.bmp
        _PI->WriteDword((0x71FC18 +sdv), 10); // N_DEFBON.bmp
        _PI->WriteDword((0x71FCC5 +sdv), 11); // E_DWARF.bmp
        _PI->WriteDword((0x71FCF5 +sdv), 12); // N_DWARF.bmp
        _PI->WriteDword((0x71FDA8 +sdv), 13); // E_GOLEM.bmp
        _PI->WriteDword((0x71FDD8 +sdv), 14); // N_GOLEM.bmp
        _PI->WriteDword((0x71FE89 +sdv), 15); // E_DIST.bmp
        _PI->WriteDword((0x71FEBA +sdv), 16); // N_DIST.bmp
        _PI->WriteDword((0x71FF6B +sdv), 17); // E_OBST.bmp
        _PI->WriteDword((0x71FF9C +sdv), 18); // N_OBST.bmp
        _PI->WriteDword((0x72007B +sdv), 19); // E_FLY.bmp
        _PI->WriteDword((0x7200AC +sdv), 20); // N_FLY.bmp
        _PI->WriteDword((0x720156 +sdv), 21); // E_SHOOT.bmp
        _PI->WriteDword((0x720187 +sdv), 22); // N_SHOOT.bmp
        _PI->WriteDword((0x720231 +sdv), 23); // E_BREATH.bmp
        _PI->WriteDword((0x720262 +sdv), 24); // N_BREATH.bmp
        _PI->WriteDword((0x72030C +sdv), 25); // E_ALIVE.bmp
        _PI->WriteDword((0x72033D +sdv), 26); // N_ALIVE.bmp
        _PI->WriteDword((0x7203E7 +sdv), 27); // E_KING1.bmp
        _PI->WriteDword((0x720418 +sdv), 28); // N_KING1.bmp
        _PI->WriteDword((0x7204C2 +sdv), 29); // E_KING2.bmp
        _PI->WriteDword((0x7204F3 +sdv), 30); // N_KING2.bmp
        _PI->WriteDword((0x72059D +sdv), 31); // E_KING3.bmp
        _PI->WriteDword((0x7205CE +sdv), 32); // N_KING3.bmp
        _PI->WriteDword((0x720678 +sdv), 33); // E_MIND.bmp
        _PI->WriteDword((0x7206A9 +sdv), 34); // N_MIND.bmp
        _PI->WriteDword((0x720753 +sdv), 35); // E_MELEE.bmp
        _PI->WriteDword((0x720784 +sdv), 36); // N_MELEE.bmp
        _PI->WriteDword((0x72082E +sdv), 37); // E_FIRE.bmp
        _PI->WriteDword((0x72085F +sdv), 38); // N_FIRE.bmp
        _PI->WriteDword((0x720909 +sdv), 39); // E_DOUBLE.bmp
        _PI->WriteDword((0x72093A +sdv), 40); // N_DOUBLE.bmp
        _PI->WriteDword((0x7209E4 +sdv), 41); // E_RETAIL.bmp
        _PI->WriteDword((0x720A15 +sdv), 42); // N_RETAIL.bmp
        _PI->WriteDword((0x720ABF +sdv), 43); // E_MORAL.bmp
        _PI->WriteDword((0x720AF0 +sdv), 44); // N_MORAL.bmp
        _PI->WriteDword((0x720B9A +sdv), 45); // E_UNDEAD.bmp
        _PI->WriteDword((0x720BCB +sdv), 46); // N_UNDEAD.bmp
        _PI->WriteDword((0x720C75 +sdv), 47); // E_ROUND.bmp
        _PI->WriteDword((0x720CA6 +sdv), 48); // N_ROUND.bmp
        _PI->WriteDword((0x720D50 +sdv), 49); // E_DRAGON.bmp
        _PI->WriteDword((0x720D81 +sdv), 50); // N_DRAGON.bmp
        _PI->WriteDword((0x720E34 +sdv), 51); // E_HARPY.bmp
        _PI->WriteDword((0x720E65 +sdv), 52); // N_HARPY.bmp
        _PI->WriteDword((0x720F18 +sdv), 53); // E_CHAMP.bmp
        _PI->WriteDword((0x720F49 +sdv), 54); // N_CHAMP.bmp
        _PI->WriteDword((0x720FFC +sdv), 55); // E_MINOT.bmp
        _PI->WriteDword((0x72102D +sdv), 56); // N_MINOT.bmp
        _PI->WriteDword((0x7210E0 +sdv), 57); // E_SHOOTA.bmp
        _PI->WriteDword((0x721111 +sdv), 58); // N_SHOOTA.bmp
        _PI->WriteDword((0x7211C4 +sdv), 59); // E_FEARL.bmp
        _PI->WriteDword((0x7211F5 +sdv), 60); // N_FEARL.bmp
        _PI->WriteDword((0x7212A8 +sdv), 61); // E_REBIRTH.bmp
        _PI->WriteDword((0x7212D9 +sdv), 62); // N_REBIRTH.bmp
        _PI->WriteDword((0x72138C +sdv), 63); // E_UNIC.bmp
        _PI->WriteDword((0x7213BD +sdv), 64); // N_UNIC.bmp
        _PI->WriteDword((0x721484 +sdv), 65); // E_BLOCK.bmp
        _PI->WriteDword((0x7214B4 +sdv), 66); // N_BLOCK.bmp
        _PI->WriteDword((0x72155E +sdv), 67); // E_MANA.bmp
        _PI->WriteDword((0x72158E +sdv), 68); // N_MANA.bmp
        _PI->WriteDword((0x721638 +sdv), 69); // E_DBLOW.bmp
        _PI->WriteDword((0x721668 +sdv), 70); // N_DBLOW.bmp
        _PI->WriteDword((0x721A01 +sdv), 71); // E_HATE.bmp
        _PI->WriteDword((0x721A31 +sdv), 72); // N_HATE.bmp
        _PI->WriteDword((0x721C59 +sdv), 73); // E_TROLL.bmp
        _PI->WriteDword((0x721C89 +sdv), 74); // N_TROLL.bmp
        _PI->WriteDword((0x721E4C +sdv), 75); // E_CAST.bmp
        _PI->WriteDword((0x721E7C +sdv), 76); // N_CAST.bmp
        _PI->WriteDword((0x722037 +sdv), 77); // E_CAST1.bmp
        _PI->WriteDword((0x722067 +sdv), 78); // N_CAST1.bmp
        _PI->WriteDword((0x72224B +sdv), 77); // E_CAST1.bmp
        _PI->WriteDword((0x72227B +sdv), 78); // N_CAST1.bmp
        _PI->WriteDword((0x722436 +sdv), 79); // E_CAST2.bmp
        _PI->WriteDword((0x722466 +sdv), 80); // N_CAST2.bmp
        _PI->WriteDword((0x722643 +sdv), 79); // E_CAST2.bmp
        _PI->WriteDword((0x722673 +sdv), 80); // N_CAST2.bmp
        _PI->WriteDword((0x722A86 +sdv), 81); // E_BLESS.bmp
        _PI->WriteDword((0x722AB6 +sdv), 82); // N_BLESS.bmp
        _PI->WriteDword((0x72303C +sdv), 83); // E_RDEF.bmp
        _PI->WriteDword((0x72306C +sdv), 84); // N_RDEF.bmp
        _PI->WriteDword((0x72311F +sdv), 85); // E_DEATH.bmp
        _PI->WriteDword((0x72314F +sdv), 86); // N_DEATH.bmp
        _PI->WriteDword((0x72341C +sdv), 87); // E_BLOCK1.bmp
        _PI->WriteDword((0x72344C +sdv), 88); // N_BLOCK1.bmp
        _PI->WriteDword((0x7234F6 +sdv), 89); // E_BLOCK2.bmp
        _PI->WriteDword((0x723526 +sdv), 90); // N_BLOCK2.bmp
        _PI->WriteDword((0x723754 +sdv), 91); // E_SGTYPE.bmp
        _PI->WriteDword((0x723784 +sdv), 92); // N_SGTYPE.bmp
        _PI->WriteDword((0x7237D5 +sdv), 93); // E_SGNUM.bmp
        _PI->WriteDword((0x723805 +sdv), 94); // N_SGNUM.bmp
        _PI->WriteDword((0x7239C8 +sdv), 95); // E_SUMMON.bmp
        _PI->WriteDword((0x7239F8 +sdv), 96); // N_SUMMON.bmp
        _PI->WriteDword((0x723BBB +sdv), 97); // E_SUMMON1.bmp
        _PI->WriteDword((0x723BEB +sdv), 98); // N_SUMMON1.bmp
        _PI->WriteDword((0x723DAD +sdv), 99); // E_SUMMON2.bmp
        _PI->WriteDword((0x723DDD +sdv), 100); // N_SUMMON2.bmp 
        int adress = 0x792848;
        for (int i = 0; i < 58; i++){
            _PI->WriteDword(adress, 101+i);
            adress += 4;
        }
    return 1; 
} 
_int_ __stdcall New_Dlg_ExpaMon_Lo(LoHook* h, HookContext* c)
{
    New_Dlg_ExpaMon(o_Mon, o_Num, o_Expo, o_CrExpo);
    c->return_address = 0x773C22; 
    return NO_EXEC_DEFAULT; 
} 
BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    static _bool_ plugin_On = 0;
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        if (!plugin_On)
        {
            plugin_On = 1;    
            _P = GetPatcher();
            _PI = _P->CreateInstance("Dlg_ExpaMon"); 
            char* version_dll = "Dlg_ExpaMon beta 1";
            
            Y_ChangeBmp_To_DefFrame(); 
            _PI->WriteLoHook(0x773BA4, New_Dlg_ExpaMon_Lo);
        }
        break;
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}