Mercurial > mm7
changeset 920:34ed2d5e7cfb
MagicShopDialog clean and other
author | Ritor1 |
---|---|
date | Sun, 28 Apr 2013 19:11:36 +0600 |
parents | befaac4bc0e3 |
children | 3696848c0413 27bfe64b13b5 |
files | DecalBuilder.cpp Mouse.cpp Spells.h UIHouses.cpp UiGame.cpp mm7_2.cpp mm7_3.cpp mm7_5.cpp stru6.cpp |
diffstat | 9 files changed, 1152 insertions(+), 621 deletions(-) [+] |
line wrap: on
line diff
--- a/DecalBuilder.cpp Sat Apr 27 09:37:22 2013 +0600 +++ b/DecalBuilder.cpp Sun Apr 28 19:11:36 2013 +0600 @@ -130,7 +130,7 @@ double v28; // st7@21 int v29; // ST10_4@21 int v30; // ST08_4@21 - DecalBuilder *v31; // esi@21 + //DecalBuilder *v31; // esi@21 int v32; // [sp+4h] [bp-44h]@18 RenderVertexSoft *v33; // [sp+8h] [bp-40h]@21 stru314 *v34; // [sp+Ch] [bp-3Ch]@21 @@ -143,15 +143,15 @@ int v41; // [sp+34h] [bp-14h]@22 int v42; // [sp+38h] [bp-10h]@21 int v43; // [sp+3Ch] [bp-Ch]@21 - DecalBuilder *thisa; // [sp+40h] [bp-8h]@1 - RenderVertexSoft *a11; // [sp+44h] [bp-4h]@8 + //DecalBuilder *thisa; // [sp+40h] [bp-8h]@1 + //RenderVertexSoft *a11; // [sp+44h] [bp-4h]@8 - __debugbreak(); +// __debugbreak(); - auto a2 = light_level; - auto a9 = uSectorID; + //auto a2 = light_level; + //auto a9 = uSectorID; - thisa = this; + //thisa = this; if ( !a5 ) return 0; @@ -174,7 +174,7 @@ stru314::stru314(&static_AE4F60); }*/ - a11 = a6; + //a11 = a6; if ( a7 ) { if ( a5 > 0 ) @@ -198,7 +198,7 @@ { if ( !a5 ) return 0; - a11 = static_AE4F90; + a6 = static_AE4F90; } } else @@ -214,25 +214,21 @@ LODWORD(v36) = (DWORD)&static_AE4F60.field_10; static_AE4F60.field_4.z = v18; static_AE4F60.dist = v16->face_plane.dist; - if ( !pGame->pIndoorCameraD3D->GetFacetOrientation( - v16->polygonType, - &static_AE4F60.field_4, - &static_AE4F60.field_10, - &static_AE4F60.field_1C) ) + if ( !pGame->pIndoorCameraD3D->GetFacetOrientation(v16->polygonType, &static_AE4F60.field_4, &static_AE4F60.field_10, &static_AE4F60.field_1C) ) { MessageBoxW(nullptr, L"Error: Failed to get the facet orientation", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:101", 0); } int _a7 = 0; - if ( thisa->uNumDecals > 0 ) + if ( this->uNumDecals > 0 ) { - a6 = (RenderVertexSoft *)thisa->std__vector_30B00C; + a6 = (RenderVertexSoft *)this->std__vector_30B00C; do { v21 = &pBloodsplatContainer->std__vector_pBloodsplats[LODWORD(a6->vWorldPosition.x)]; *(float *)&v37 = v21->z; v36 = v21->y; v35 = v21->x; - v22 = _43F5C8_get_point_light_level_with_respect_to_lights(a2, a9, v35, v36, *(float *)&v37); + v22 = _43F5C8_get_point_light_level_with_respect_to_lights(light_level, uSectorID, v35, v36, *(float *)&v37); v23 = v21->b; v24 = v21->x; v42 = v22; @@ -246,7 +242,7 @@ v37 = a8; v40 = (signed __int64)v26; v28 = v21->dot_dist; - LODWORD(v36) = (uint32)a11; + LODWORD(v36) = (uint32)a6; a5a = v25; v39 = v27; LODWORD(v35) = a5; @@ -255,26 +251,15 @@ v32 = v23 | (v22 << 8); *(float *)&v29 = v21->radius; v30 = (int)v21; - v31 = thisa; - if ( !thisa->_49B790_build_decal_geometry( - v42, - a3, - v30, - (int)&a5a, - v29, - v43, - v33, - &static_AE4F60, - a5, - a11, - a8) ) + //v31 = thisa; + if ( !this->_49B790_build_decal_geometry(v42, a3, v30, (int)&a5a, v29, v43, v33, &static_AE4F60, a5, a6, a8) ) { MessageBoxW(nullptr, L"Error: Failed to build decal geometry", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:114", 0); } ++_a7; a6 = (RenderVertexSoft *)((char *)a6 + 4); } - while ( _a7 < v31->uNumDecals ); + while ( _a7 < this->uNumDecals ); } return 1; }
--- a/Mouse.cpp Sat Apr 27 09:37:22 2013 +0600 +++ b/Mouse.cpp Sun Apr 28 19:11:36 2013 +0600 @@ -429,9 +429,9 @@ //----- (00469EA4) -------------------------------------------------------- void Mouse::_469EA4() { - Mouse *v1; // esi@1 - unsigned int v2; // eax@2 - Texture *v3; // edi@2 + //Mouse *v1; // esi@1 + unsigned int pTextureID; // eax@2 + Texture *pTexture; // edi@2 unsigned int v4; // ecx@3 unsigned int v5; // eax@3 unsigned int v6; // ebx@5 @@ -449,16 +449,14 @@ int v18; // [sp+1Ch] [bp-Ch]@27 int v19; // [sp+20h] [bp-8h]@15 unsigned __int16 *v20; // [sp+20h] [bp-8h]@28 - int v21; // [sp+24h] [bp-4h]@12 + int pTextureWidth; // [sp+24h] [bp-4h]@12 unsigned __int16 *v22; // [sp+24h] [bp-4h]@25 - v1 = this; + //v1 = this; if ( pParty->pPickedItem.uItemID ) { - v2 = pIcons_LOD->LoadTexture( - pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, - TEXTURE_16BIT_PALETTE); - v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); + pTextureID = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, TEXTURE_16BIT_PALETTE); + pTexture = (Texture *)(pTextureID != -1 ? (int)&pIcons_LOD->pTextures[pTextureID] : 0); if (pAsyncMouse) { v4 = *((int *)pAsyncMouse + 6); @@ -481,47 +479,46 @@ v6 = 0; v15 = 0; } - if ( (signed int)(v3->uTextureWidth + a2) <= 640 ) - v21 = v3->uTextureWidth; + if ( (signed int)(pTexture->uTextureWidth + a2) <= 640 ) + pTextureWidth = pTexture->uTextureWidth; else - v21 = 640 - a2; - if ( (signed int)(v3->uTextureHeight + v6) <= 480 ) + pTextureWidth = 640 - a2; + if ( (signed int)(pTexture->uTextureHeight + v6) <= 480 ) { - v19 = v3->uTextureHeight; - v7 = v3->uTextureHeight; + v19 = pTexture->uTextureHeight; + v7 = pTexture->uTextureHeight; } else { v7 = 480 - v6; v19 = 480 - v6; } - if ( !v1->pCursorBitmap3_sysmembits_16bit - || a2 != v1->field_40 - || v6 != v1->field_44 - || a2 + v21 != v1->field_48 - || v6 + v7 != v1->field_4C ) + if ( !this->pCursorBitmap3_sysmembits_16bit + || a2 != this->field_40 + || v6 != this->field_44 + || a2 + pTextureWidth != this->field_48 + || v6 + v7 != this->field_4C ) { - if ( v1->pCursorBitmap3_sysmembits_16bit ) - free(v1->pCursorBitmap3_sysmembits_16bit); - v1->pCursorBitmap3_sysmembits_16bit = (unsigned __int16 *)operator new(2 * v3->uTextureHeight - * v3->uTextureWidth); - v1->field_40 = a2; - v1->field_48 = a2 + v21; - v1->field_44 = v6; - v1->field_4C = v6 + v19; + if ( this->pCursorBitmap3_sysmembits_16bit ) + free(this->pCursorBitmap3_sysmembits_16bit); + this->pCursorBitmap3_sysmembits_16bit = (unsigned __int16 *)operator new(2 * pTexture->uTextureHeight * pTexture->uTextureWidth); + this->field_40 = a2; + this->field_48 = a2 + pTextureWidth; + this->field_44 = v6; + this->field_4C = v6 + v19; } - v8 = v1->field_44; - v22 = v1->pCursorBitmap3_sysmembits_16bit; + v8 = this->field_44; + v22 = this->pCursorBitmap3_sysmembits_16bit; v17 = pRenderer->pTargetSurface; v16 = pRenderer->uTargetSurfacePitch; - if ( v8 < v1->field_4C ) + if ( v8 < this->field_4C ) { - v9 = v1->field_48; + v9 = this->field_48; v10 = pRenderer->uTargetSurfacePitch * v8; do { - v11 = v1->field_40; - v18 = v1->field_40; + v11 = this->field_40; + v18 = this->field_40; if ( v11 < v9 ) { v20 = &v17[v10 + v11]; @@ -533,22 +530,22 @@ ++v20; ++v22; *v13 = *v12; - v9 = v1->field_48; + v9 = this->field_48; } while ( v18 < v9 ); } v10 += v16; ++v8; } - while ( v8 < v1->field_4C ); + while ( v8 < this->field_4C ); v6 = v15; } if (pParty->pPickedItem.Broken()) - pRenderer->DrawTransparentRedShade(a2, v6, v3); + pRenderer->DrawTransparentRedShade(a2, v6, pTexture); else if (!pParty->pPickedItem.Identified()) - pRenderer->DrawTransparentGreenShade(a2, v6, v3); + pRenderer->DrawTransparentGreenShade(a2, v6, pTexture); else - pRenderer->DrawTextureTransparent(a2, v6, v3); + pRenderer->DrawTextureTransparent(a2, v6, pTexture); } } else @@ -556,7 +553,7 @@ if ( this->pCursorBitmap3_sysmembits_16bit ) { free(this->pCursorBitmap3_sysmembits_16bit); - v1->pCursorBitmap3_sysmembits_16bit = 0; + this->pCursorBitmap3_sysmembits_16bit = 0; } } }
--- a/Spells.h Sat Apr 27 09:37:22 2013 +0600 +++ b/Spells.h Sun Apr 28 19:11:36 2013 +0600 @@ -120,7 +120,7 @@ BECOME_MAGIC_GUILD_MEMBER = 150, SPELL_QUEST_COMPLETED = 151, SPELL_152 = 152, - SPELL_153 = 153 + SPELL_DISEASE = 153 };
--- a/UIHouses.cpp Sat Apr 27 09:37:22 2013 +0600 +++ b/UIHouses.cpp Sun Apr 28 19:11:36 2013 +0600 @@ -5499,7 +5499,6 @@ int all_text_height; // edi@21 char **v15; // esi@21 int v16; // eax@22 - GUIWindow *v17; // ecx@23 int v18; // edx@23 int v19; // edi@23 unsigned __int8 v20; // sf@23 @@ -5513,7 +5512,6 @@ int v28; // ST08_4@34 int v29; // eax@34 char *v30; // edx@35 - //GUIWindow *v31; // edi@40 void *v32; // eax@40 signed int v33; // esi@40 unsigned int v34; // esi@42 @@ -5521,8 +5519,6 @@ unsigned int v36; // eax@43 int v37; // eax@45 int v38; // ecx@50 - //GUIButton *v39; // eax@52 - //GUIButton *v40; // esi@52 int v41; // eax@52 char *v42; // eax@54 int v43; // eax@54 @@ -5540,11 +5536,9 @@ unsigned int v55; // edi@76 unsigned int v56; // esi@76 int v57; // edx@80 - Texture *v58; // ecx@86 unsigned int v59; // edi@86 unsigned int v60; // esi@88 int v61; // edx@92 - Texture *v62; // ecx@98 unsigned int v63; // edi@98 unsigned int v64; // esi@100 int v65; // edx@104 @@ -5554,25 +5548,16 @@ const char *v69; // ecx@119 POINT *v70; // esi@124 int v71; // ecx@125 - int v72; // eax@125 int v73; // ecx@125 - ItemGen *v74; // esi@125 int v75; // eax@130 - //int v76; // esi@131 - //char **v77; // edi@131 int v78; // eax@132 - //GUIWindow *v79; // ecx@133 int v80; // edx@133 int v81; // edi@133 - //GUIButton *v82; // esi@135 const char **v83; // eax@135 int v84; // eax@135 unsigned int v85; // ecx@135 int v86; // edx@135 - //unsigned __int16 v87; // ax@135 - GUIWindow *v88; // [sp-18h] [bp-110h]@35 int v89; // [sp-14h] [bp-10Ch]@35 - ItemGen *v90; // [sp-10h] [bp-108h]@14 int v91; // [sp-10h] [bp-108h]@35 unsigned __int16 v92; // [sp-Ch] [bp-104h]@12 void *v93; // [sp-Ch] [bp-104h]@14 @@ -5652,239 +5637,12 @@ } return; } - - if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT ) - { - draw_leather(); - CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); - pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell" - pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify" - pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair" - all_text_height = 0; - for ( uint i = 0; i < 3; ++i ) - all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); - _this = ((174 - all_text_height) / 3); - v81 = (3 * (58 - (signed int)_this) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138; - v20 = -pDialogueWindow->pNumPresenceButton < 0; - v118 = pDialogueWindow->pStartingPosActiveItem; - if ( v20 ^ pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) - { - v122 = 2; - pSrtingNum = 0; - do - { - control_button = pDialogueWindow->GetControl(v118); - control_button->uY = (unsigned int)((char *)_this + v81); - pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pSrtingNum], &dialog_window, 0, 0); - v85 = control_button->uY; - control_button->uHeight = pTextHeight; - v81 = pTextHeight + v85 - 1; - control_button->uW = v81; - text_color = pYellowColor; - if ( pDialogueWindow->pCurrentPosActiveItem != v122 ) - text_color = pWhiteColor; - dialog_window.DrawTitleText(pFontArrus, 0, v85, text_color, pShopOptions[pSrtingNum], 3); - ++v122; - ++pSrtingNum; - ++v118; - } - while ( v118 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); - } - return; - } - - if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR) - { - draw_leather(); - CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); - DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() - || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14, - v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5), - result = (int)pMouse->GetCursorPos(&v106), - *(int *)result <= 13) - || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462) - || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) - || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) ) - return; - item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; - v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5); - v30 = BuilDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); - v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; - dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); - return; - } - if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS ) - { - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) - { - v3 = 0; - all_text_height = 0; - v33 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); - v119 = (const char **)(v33 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100); - if ( (signed int)v119 < v33 / 3 ) - v119 = (const char **)(v33 / 3); - pActiveItemNum = pDialogueWindow->pStartingPosActiveItem; - v122 = 0; - if ( (signed int)pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) - { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// - // "Seek knowledge elsewhere %s the %s" - strcat(pTmpBuf, "\n \n"); - strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." - v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; - dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3); - return; - } - do - { - v36 = pDialogueWindow->GetControl(pActiveItemNum)->msg_param - 36; - if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v36] && !pPlayers[uActiveCharacter]->pActiveSkills[v36] ) - { - all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0); - ++v122; - } - ++pActiveItemNum; - } - while ( pActiveItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); - if ( !v122 ) - { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// - // "Seek knowledge elsewhere %s the %s" - strcat(pTmpBuf, "\n \n"); - strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." - v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; - dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3); - return; - } - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu" - dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); - v119 = (const char **)((149 - all_text_height) / v122); - if ( (149 - all_text_height) / v122 > 32 ) - v119 = (const char **)32; - v38 = (149 - v122 * (signed int)v119 - all_text_height) / 2 - (signed int)v119 / 2 + 162; - v118 = 2; - if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) - { - v122 = 2; - do - { - control_button = pDialogueWindow->GetControl(v122); - v41 = control_button->msg_param - 36; - if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] || pPlayers[uActiveCharacter]->pActiveSkills[v41] ) - { - control_button->uW = 0; - control_button->uHeight = 0; - control_button->uY = 0; - } - else - { - control_button->uY = (unsigned int)((char *)v119 + v38); - pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0); - v44 = control_button->uY; - control_button->uHeight = pTextHeight; - v38 = v44 + pTextHeight - 1; - control_button->uW = v38; - text_color = pYellowColor; - if ( pDialogueWindow->pCurrentPosActiveItem != v122 ) - text_color = pWhiteColor; - dialog_window.DrawTitleText(pFontArrus, 0, v44, text_color, pSkillNames[v41], 3); - } - ++v122; - } - while ( v122 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); - } - } - return; - } - if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY) - { - draw_leather(); - CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); - DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) - { - v2 = pMouse->GetCursorPos(&a2)->x - 14; - v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5); - result = (int)pMouse->GetCursorPos(&v111); - if ( *(int *)result > 13 ) - { - result = (int)pMouse->GetCursorPos(&v103); - if ( *(int *)result < 462 ) - { - result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117); - if ( result ) - { - item = &pPlayers[uActiveCharacter]->pInventoryItems[result-1]; - if ( item->uAttributes & 1 ) - { - v5 = BuilDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); - v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101; - dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3); - return; - } - v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4); - v30 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v8], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); - v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138; - dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v30, 3); - return; - } - } - } - } - return; - } - if ( dialog_menu_id > HOUSE_DIALOGUE_SHOP_REPAIR ) - { - if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_SPECIAL ) - { - result = dialog_menu_id - HOUSE_DIALOGUE_LEARN_SKILLS; - - } - } - else - { - - if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) - { - if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL) - { - result = dialog_menu_id - HOUSE_DIALOGUE_SHOP_IDENTIFY; - return; - } - draw_leather(); - CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); - DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell" - result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( !result - || (v11 = pMouse->GetCursorPos(&v107)->x - 14, - v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5), - result = (int)pMouse->GetCursorPos(&v105), - *(int *)result <= 13) - || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) - || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) - return; - v96 = 0; - v94 = 3; - v93 = window_SpeakInHouse->ptr_1C; - v90 = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; - v12 = (int)window_SpeakInHouse->ptr_1C; - uPlayerID = uActiveCharacter - 1; - v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v90, BildingType_MagicShop, v12, 3); - v9 = uPlayerID; - v10 = (char *)pMerchantsSellPhrases[v13]; - v30 = BuilDialogueString(v10, v9, v90, (char *)v93, v94, v96); - v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; - dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); - return; - } - } - pRenderer->DrawTextureIndexed(8, 8, ShopTexture); - v3 = 0; - v49 = 0; - v122 = 0; if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) { + pRenderer->DrawTextureIndexed(8, 8, ShopTexture); + v3 = 0; + v49 = 0; + v122 = 0; do { if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID) @@ -5944,19 +5702,86 @@ ++v122; } while ( v122 < 6 ); + if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + { + v66 = 0; + v117 = 0; + if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) + { + do + { + if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) + ++v117; + ++v66; + } + while ( v66 < 12 ); + } + else + { + do + { + if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) + ++v117; + ++v66; + } + while ( v66 < 12 ); + } + v67 = GetAsyncKeyState(VK_CONTROL); + v68 = pPlayers[uActiveCharacter]->CanSteal(); + Str = (char *)v68; + if ( v67 && v68 ) + { + v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item" + } + else + { + v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy" + if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) + v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy" + } + DrawTextAtStatusBar(v69, 0); + if ( !v117 ) + { + dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); + return; + } + v70 = pMouse->GetCursorPos(&v102); + result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; + if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) + { + v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; + item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; + if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) + item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; + if ( v67 && Str ) + v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" + else + { + v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); + v10 = (char *)pMerchantsBuyPhrases[v75]; + } + v30 = BuilDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); + v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; + dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); + return; + } + } + return; } - else + if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL) { + pRenderer->DrawTextureIndexed(8, 8, ShopTexture); + v3 = 0; + v49 = 0; + v122 = 0; do { - // if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) - if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID) + if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID) { - v58 = ItemsInShopTexture[v49]; - v59 = 152 - v58->uTextureHeight; + v59 = 152 - ItemsInShopTexture[v49]->uTextureHeight; if ( (signed int)v59 < 1 ) v59 = 0; - v60 = 75 * v49 - v58->uTextureWidth / 2 + 40; + v60 = 75 * v49 - ItemsInShopTexture[v49]->uTextureWidth / 2 + 40; if ( v122 ) { if ( v122 == 5 ) @@ -5971,7 +5796,7 @@ if ( (signed int)v60 < 18 ) v60 = 18; } - pRenderer->DrawTextureTransparent(v60, v59, v58); + pRenderer->DrawTextureTransparent(v60, v59, ItemsInShopTexture[v49]); sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], ItemsInShopTexture[v122], v122 + 1); v49 = v122; } @@ -5982,14 +5807,12 @@ v122 = 0; do { - //if ( pParty->Spell_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49] + 778] ) //weak if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v122 + 6].uItemID) { - v62 = ItemsInShopTexture[v122 + 6]; - v63 = 306 - v62->uTextureHeight; + v63 = 306 - ItemsInShopTexture[v122 + 6]->uTextureHeight; if ( (signed int)v63 < 1 ) v63 = 0; - v64 = 75 * v122 - v62->uTextureWidth / 2 + 40; + v64 = 75 * v122 - ItemsInShopTexture[v122 + 6]->uTextureWidth / 2 + 40; if ( v122 ) { if ( v122 == 5 ) @@ -6004,80 +5827,277 @@ if ( (signed int)v64 < 18 ) v64 = 18; } - pRenderer->DrawTextureTransparent(v64, v63, v62); + pRenderer->DrawTextureTransparent(v64, v63, ItemsInShopTexture[v122 + 6]); sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], ItemsInShopTexture[v122 + 6], v122 + 7); } ++v122; } while ( v122 < 6 ); - } - result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( result ) - { - v66 = 0; - v117 = 0; - if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) + if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) { - do + v66 = 0; + v117 = 0; + if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD) + { + do + { + if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) + ++v117; + ++v66; + } + while ( v66 < 12 ); + } + else + { + do + { + if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) + ++v117; + ++v66; + } + while ( v66 < 12 ); + } + v67 = GetAsyncKeyState(VK_CONTROL); + v68 = pPlayers[uActiveCharacter]->CanSteal(); + Str = (char *)v68; + if ( v67 && v68 ) + { + v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item" + } + else + { + v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy" + if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) + v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy" + } + DrawTextAtStatusBar(v69, 0); + if ( !v117 ) { - if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) - ++v117; - ++v66; + dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); + return; } - while ( v66 < 12 ); + v70 = pMouse->GetCursorPos(&v102); + result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; + if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) + { + v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; + item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; + if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) + item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][v71]; + if ( v67 && Str ) + v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" + else + { + v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); + v10 = (char *)pMerchantsBuyPhrases[v75]; + } + v30 = BuilDialogueString(v10, uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); + v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; + dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); + return; + } } - else + return; + } + if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT ) + { + draw_leather(); + CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); + pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell" + pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify" + pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair" + all_text_height = 0; + for ( uint i = 0; i < 3; ++i ) + all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); + _this = ((174 - all_text_height) / 3); + v81 = (3 * (58 - (signed int)_this) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138; + v20 = -pDialogueWindow->pNumPresenceButton < 0; + v118 = pDialogueWindow->pStartingPosActiveItem; + if ( v20 ^ pDialogueWindow->pStartingPosActiveItem > pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) { + v122 = 2; + pSrtingNum = 0; do { - //if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) - if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID) - ++v117; - ++v66; + control_button = pDialogueWindow->GetControl(v118); + control_button->uY = (unsigned int)((char *)_this + v81); + pTextHeight = pFontArrus->CalcTextHeight(pShopOptions[pSrtingNum], &dialog_window, 0, 0); + v85 = control_button->uY; + control_button->uHeight = pTextHeight; + v81 = pTextHeight + v85 - 1; + control_button->uW = v81; + text_color = pYellowColor; + if ( pDialogueWindow->pCurrentPosActiveItem != v122 ) + text_color = pWhiteColor; + dialog_window.DrawTitleText(pFontArrus, 0, v85, text_color, pShopOptions[pSrtingNum], 3); + ++v122; + ++pSrtingNum; + ++v118; } - while ( v66 < 12 ); + while ( v118 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); } - v67 = GetAsyncKeyState(VK_CONTROL); - v68 = pPlayers[uActiveCharacter]->CanSteal(); - Str = (char *)v68; - if ( v67 && v68 ) + return; + } + if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_SELL) + { + draw_leather(); + CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); + DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell" + if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() + || (v11 = pMouse->GetCursorPos(&v107)->x - 14, + v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5), + result = (int)pMouse->GetCursorPos(&v105), + *(int *)result <= 13) + || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) + || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) + return; + item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; + v13 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3); + v30 = BuilDialogueString((char *)pMerchantsSellPhrases[v13], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); + v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; + dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); + return; + } + if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_IDENTIFY) + { + draw_leather(); + CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); + DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify" + if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) { - v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item" - } - else - { - v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy" - if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) - v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy" + v2 = pMouse->GetCursorPos(&a2)->x - 14; + v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5); + result = (int)pMouse->GetCursorPos(&v111); + if ( *(int *)result > 13 ) + { + result = (int)pMouse->GetCursorPos(&v103); + if ( *(int *)result < 462 ) + { + result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117); + if ( result ) + { + item = &pPlayers[uActiveCharacter]->pInventoryItems[result-1]; + if ( item->uAttributes & 1 ) + { + v5 = BuilDialogueString("%24", uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); + v6 = (212 - pFontArrus->CalcTextHeight(v5, &dialog_window, 0, 0)) / 2 + 101; + dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v5, 3); + return; + } + v8 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4); + v30 = BuilDialogueString((char *)pMerchantsIdentifyPhrases[v8], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); + v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138; + dialog_window.DrawTitleText(pFontArrus, 0, v6, pWhiteColor, v30, 3); + return; + } + } + } } - DrawTextAtStatusBar(v69, 0); - if ( !v117 ) - { - dialog_window.DrawCurrentTime( pParty->field_3C.field_50[(unsigned int)window_SpeakInHouse->ptr_1C] - pParty->uTimePlayed); - return; - } - v70 = pMouse->GetCursorPos(&v102); - result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; - if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) + return; + } + if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_REPAIR) + { + draw_leather(); + CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); + DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair" + if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() + || (pTextHeight = pMouse->GetCursorPos(&v110)->x - 14, + v117 = (pTextHeight >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5), + result = (int)pMouse->GetCursorPos(&v106), + *(int *)result <= 13) + || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462) + || (result = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) + || (result *= 9, !(pPlayers[uActiveCharacter]->field_1F5[4 * result + 15] & 2)) ) + return; + item = &pPlayers[uActiveCharacter]->pInventoryItems[result - 1]; + v29 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItems[result - 1], BildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5); + v30 = BuilDialogueString((char *)pMerchantsRepairPhrases[v29], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); + v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; + dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); + return; + } + if ( dialog_menu_id == HOUSE_DIALOGUE_LEARN_SKILLS ) + { + if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) { - v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; - v117 = v71; - v72 = (int)window_SpeakInHouse->ptr_1C; - v74 = (ItemGen *)&pParty->StandartItemsInShops[v72][v71]; - if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD) - v74 =&pParty->SpecialItemsInShops[v72][v71]; - if ( v67 && Str ) - v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" - else + v3 = 0; + all_text_height = 0; + v33 = (signed __int64)(p2DEvents[(signed int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); + v119 = (const char **)(v33 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100); + if ( (signed int)v119 < v33 / 3 ) + v119 = (const char **)(v33 / 3); + pActiveItemNum = pDialogueWindow->pStartingPosActiveItem; + v122 = 0; + if ( (signed int)pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) + { + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// + // "Seek knowledge elsewhere %s the %s" + strcat(pTmpBuf, "\n \n"); + strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." + v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; + dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3); + return; + } + do + { + v36 = pDialogueWindow->GetControl(pActiveItemNum)->msg_param - 36; + if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v36] && !pPlayers[uActiveCharacter]->pActiveSkills[v36] ) + { + all_text_height += pFontArrus->CalcTextHeight(pSkillNames[v36], &dialog_window, 0, 0); + ++v122; + } + ++pActiveItemNum; + } + while ( pActiveItemNum < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); + if ( !v122 ) { - v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(v74, BildingType_MagicShop, v72, 2); - v10 = (char *)pMerchantsBuyPhrases[v75]; + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]);// + // "Seek knowledge elsewhere %s the %s" + strcat(pTmpBuf, "\n \n"); + strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further." + v6 = (174 - pFontArrus->CalcTextHeight(pTmpBuf, &dialog_window, 0, 0)) / 2 + 138; + dialog_window.DrawTitleText(pFontArrus, v3, v6, pYellowColor, pTmpBuf, 3); + return; } - v30 = BuilDialogueString(v10, uActiveCharacter - 1, v74, (char *)window_SpeakInHouse->ptr_1C, 2, 0); - v6 = (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, v3, v3)) / 2 + 138; - dialog_window.DrawTitleText(pFontArrus, v3, v6, pWhiteColor, v30, 3); - return; + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu" + dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); + v119 = (const char **)((149 - all_text_height) / v122); + if ( (149 - all_text_height) / v122 > 32 ) + v119 = (const char **)32; + v38 = (149 - v122 * (signed int)v119 - all_text_height) / 2 - (signed int)v119 / 2 + 162; + v118 = 2; + if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) + { + v122 = 2; + do + { + control_button = pDialogueWindow->GetControl(v122); + v41 = control_button->msg_param - 36; + if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v41] || pPlayers[uActiveCharacter]->pActiveSkills[v41] ) + { + control_button->uW = 0; + control_button->uHeight = 0; + control_button->uY = 0; + } + else + { + control_button->uY = (unsigned int)((char *)v119 + v38); + pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v41], &dialog_window, 0, 0); + v44 = control_button->uY; + control_button->uHeight = pTextHeight; + v38 = v44 + pTextHeight - 1; + control_button->uW = v38; + text_color = pYellowColor; + if ( pDialogueWindow->pCurrentPosActiveItem != v122 ) + text_color = pWhiteColor; + dialog_window.DrawTitleText(pFontArrus, 0, v44, text_color, pSkillNames[v41], 3); + } + ++v122; + } + while ( v122 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); + } } + return; } return; }
--- a/UiGame.cpp Sat Apr 27 09:37:22 2013 +0600 +++ b/UiGame.cpp Sun Apr 28 19:11:36 2013 +0600 @@ -266,9 +266,7 @@ //----- (0041B3B6) -------------------------------------------------------- void __cdecl draw_right_panel() { - pRenderer->DrawTextureTransparent( - pViewport->uViewportBR_X, - 0, + pRenderer->DrawTextureTransparent(pViewport->uViewportBR_X, 0, (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0)); } @@ -1133,13 +1131,11 @@ //----- (0044158F) -------------------------------------------------------- void __cdecl GameUI_DrawCharacterSelectionFrame() - { - if ( uActiveCharacter ) - pRenderer->DrawTextureTransparent( - pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, - 0x17Cu, - &pIcons_LOD->pTextures[dword_50C98C]); - } +{ + if ( uActiveCharacter ) + pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, + 380, &pIcons_LOD->pTextures[dword_50C98C]); +} //----- (004415C5) -------------------------------------------------------- void LoadPartyBuffIcons()
--- a/mm7_2.cpp Sat Apr 27 09:37:22 2013 +0600 +++ b/mm7_2.cpp Sun Apr 28 19:11:36 2013 +0600 @@ -6832,8 +6832,6 @@ { switch ( Msg ) { - default: - goto _def_wnd_proc; case WM_DEVICECHANGE: if ( wParam == 0x8000 ) PostMessageA(hInsertCDWindow, WM_CHOOSEFONT_GETLOGFONT, 0, 0); @@ -6845,12 +6843,10 @@ if ( pArcomageGame->bGameInProgress ) { if (pAsyncMouse) - goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); pArcomageGame->stru1.field_0 = 7; - v29 = 1; -LABEL_210: - v30 = 0; - goto LABEL_263; + ArcomageGame::OnMouseClick(0, 1); + return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( pVideoPlayer->pVideoFrame.pPixels ) pVideoPlayer->bStopBeforeSchedule = 1; @@ -6862,42 +6858,77 @@ case WM_RBUTTONDOWN: v31 = 0; if ( !pArcomageGame->bGameInProgress ) - goto LABEL_240; + //goto LABEL_240; + { + if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 ) + pVideoPlayer->bStopBeforeSchedule = 1; + if (!pAsyncMouse) + pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); + if (pGame) + { + if (pAsyncMouse) + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + v33 = pGame->pIndoorCameraD3D->GetPickDepth(); + pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &vis_sprite_filter_2, &vis_door_filter); + } + if (!pAsyncMouse) + { + sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0); + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } if (pAsyncMouse) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); pArcomageGame->stru1.field_0 = 8; - v29 = 1; - goto LABEL_262; + ArcomageGame::OnMouseClick(1, 1); + return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_LBUTTONUP: v32 = 0; if ( !pArcomageGame->bGameInProgress ) - goto LABEL_218; - if (pAsyncMouse) - goto _def_wnd_proc; - pArcomageGame->stru1.field_0 = 3; - v29 = 0; - goto LABEL_210; - case WM_RBUTTONUP: - v32 = 0; - if ( !pArcomageGame->bGameInProgress ) - { -LABEL_218: + //goto LABEL_218; + { if ( pAsyncMouse != v32 ) - goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); back_to_game(); return DefWindowProcA(hWnd, Msg, wParam, lParam); } if (pAsyncMouse) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + pArcomageGame->stru1.field_0 = 3; + ArcomageGame::OnMouseClick(0, 0); + return DefWindowProcA(hWnd, Msg, wParam, lParam); + case WM_RBUTTONUP: + v32 = 0; + if ( !pArcomageGame->bGameInProgress ) + { +//LABEL_218: + if ( pAsyncMouse != v32 ) + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + back_to_game(); + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if (pAsyncMouse) + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); pArcomageGame->stru1.field_0 = 4; v29 = 0; - goto LABEL_262; + //goto LABEL_262; + v30 = 1; + ArcomageGame::OnMouseClick(v30, v29); + return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_LBUTTONDBLCLK: v28 = 0; if ( pArcomageGame->bGameInProgress ) { if (pAsyncMouse) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); pArcomageGame->stru1.field_0 = 7; return DefWindowProcA(hWnd, Msg, wParam, lParam); } @@ -6918,7 +6949,8 @@ if ( pGame != (Game *)v28 ) { if ( pAsyncMouse != (void *)v28 ) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); pGame->PickMouse(512.0, (unsigned __int16)lParam, lParam >> 16, v28, &vis_sprite_filter_3, &vis_door_filter); } if ( pAsyncMouse == (void *)v28 ) @@ -6926,12 +6958,13 @@ UI_OnMouseLeftClick(0); return DefWindowProcA(hWnd, Msg, wParam, lParam); } - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_RBUTTONDBLCLK: v31 = 0; if ( !pArcomageGame->bGameInProgress ) { -LABEL_240: +//LABEL_240: if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 ) pVideoPlayer->bStopBeforeSchedule = 1; if (!pAsyncMouse) @@ -6939,7 +6972,8 @@ if (pGame) { if (pAsyncMouse) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); v33 = pGame->pIndoorCameraD3D->GetPickDepth(); pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &vis_sprite_filter_2, &vis_door_filter); } @@ -6948,10 +6982,12 @@ sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0); return DefWindowProcA(hWnd, Msg, wParam, lParam); } - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); } if (pAsyncMouse) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); pArcomageGame->stru1.field_0 = 8; return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_MBUTTONDOWN: @@ -6963,41 +6999,46 @@ pGame->PickMouse(v34, (unsigned __int16)lParam, lParam >> 16, 1, &vis_sprite_filter_3, &vis_face_filter); return DefWindowProcA(hWnd, Msg, wParam, lParam); } - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( !pGame ) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); sub_417871(0); return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_MOUSEMOVE: if ( pArcomageGame->bGameInProgress ) { if (pAsyncMouse) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); pXY[0] = (unsigned __int16)lParam; pXY[1] = lParam >> 16; ArcomageGame::OnMouseMove((POINT *)pXY); ArcomageGame::OnMouseClick(0, wParam & 1); v29 = (wParam >> 1) & 1; -LABEL_262: - v30 = 1; -LABEL_263: - ArcomageGame::OnMouseClick(v30, v29); + ArcomageGame::OnMouseClick(1, v29); } else { if (pAsyncMouse) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); } return DefWindowProcA(hWnd, Msg, wParam, lParam); + default: + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); } } if ( Msg == WM_SYSCOMMAND ) { if ( wParam == SC_SCREENSAVE || wParam == SC_MONITORPOWER ) return 0; - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( Msg > WM_ACTIVATEAPP ) { @@ -7011,7 +7052,8 @@ return DefWindowProcA(hWnd, Msg, wParam, lParam); } } - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( Msg != WM_KEYFIRST ) { @@ -7022,10 +7064,12 @@ dword_507B98_ctrl_pressed = 0; return DefWindowProcA(hWnd, Msg, wParam, lParam); } - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( Msg != WM_COMMAND ) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); if ( wParam != 101 ) { if ( wParam == 103 ) @@ -7088,7 +7132,7 @@ return 0; v38 = 0; v37 = 104; -LABEL_126: +//LABEL_126: v36 = 273; v35 = hWnd; SendMessageA(hWnd, WM_COMMAND, v37, v38); @@ -7118,24 +7162,116 @@ if ( !v24 ) { LOBYTE(pArcomageGame->stru1.field_8) = 123; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v25 = v24 - 1; if ( !v25 ) { LOBYTE(pArcomageGame->stru1.field_8) = 124; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v26 = v25 - 1; if ( !v26 ) { LOBYTE(pArcomageGame->stru1.field_8) = 125; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } if ( v26 == 3 ) { LOBYTE(pArcomageGame->stru1.field_8) = 126; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } } else @@ -7143,30 +7279,145 @@ if ( v13 == 61 ) { LOBYTE(pArcomageGame->stru1.field_8) = 43; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v21 = v13 - 55; if ( !v21 ) { LOBYTE(pArcomageGame->stru1.field_8) = 38; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v22 = v21 - 1; if ( !v22 ) { LOBYTE(pArcomageGame->stru1.field_8) = 42; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v23 = v22 - 1; if ( !v23 ) { LOBYTE(pArcomageGame->stru1.field_8) = 40; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } if ( v23 == 2 ) { LOBYTE(pArcomageGame->stru1.field_8) = 58; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } } } @@ -7175,7 +7426,30 @@ if ( (unsigned __int16)v13 == 54 ) { LOBYTE(pArcomageGame->stru1.field_8) = 94; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } if ( v13 > 49 ) { @@ -7183,24 +7457,116 @@ if ( !v18 ) { LOBYTE(pArcomageGame->stru1.field_8) = 64; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v19 = v18 - 1; if ( !v19 ) { LOBYTE(pArcomageGame->stru1.field_8) = 35; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v20 = v19 - 1; if ( !v20 ) { LOBYTE(pArcomageGame->stru1.field_8) = 36; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } if ( v20 == 1 ) { LOBYTE(pArcomageGame->stru1.field_8) = 37; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } } else @@ -7208,60 +7574,204 @@ if ( v13 == 49 ) { LOBYTE(pArcomageGame->stru1.field_8) = 33; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v14 = v13 - 39; if ( !v14 ) { LOBYTE(pArcomageGame->stru1.field_8) = 34; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v15 = v14 - 5; if ( !v15 ) { LOBYTE(pArcomageGame->stru1.field_8) = 60; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } v16 = v15 - 2; if ( !v16 ) { LOBYTE(pArcomageGame->stru1.field_8) = 62; - goto LABEL_181; - } - v17 = v16 - 1; - if ( !v17 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 63; - goto LABEL_181; - } - if ( v17 == 1 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 41; -LABEL_181: + //goto LABEL_181; if ( wParam == 27 ) { pArcomageGame->field_F5 = 1; pArcomageGame->field_F4 = 1; pArcomageGame->uGameResult = 2; pArcomageGame->field_B0 = -2; - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; + } + v17 = v16 - 1; + if ( !v17 ) + { + LOBYTE(pArcomageGame->stru1.field_8) = 63; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( wParam != 114 ) { if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) SendMessageA(hWnd, 0x111u, 0x68u, 0); - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); } v38 = 0; v37 = 103; - goto LABEL_126; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; + } + if ( v17 == 1 ) + { + LOBYTE(pArcomageGame->stru1.field_8) = 41; +//LABEL_181: + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } } } v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u); } LOBYTE(pArcomageGame->stru1.field_8) = v27; - goto LABEL_181; + //goto LABEL_181; + if ( wParam == 27 ) + { + pArcomageGame->field_F5 = 1; + pArcomageGame->field_F4 = 1; + pArcomageGame->uGameResult = 2; + pArcomageGame->field_B0 = -2; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + if ( wParam != 114 ) + { + if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) + SendMessageA(hWnd, 0x111u, 0x68u, 0); + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } + v38 = 0; + v37 = 103; + //goto LABEL_126; + v36 = 273; + v35 = hWnd; + SendMessageA(hWnd, WM_COMMAND, v37, v38); + return 0; } if ( Msg == WM_ACTIVATEAPP ) { @@ -7314,8 +7824,8 @@ { if ( !(dword_6BE364_game_settings_1 & 0x100) ) { - while(initing); //ADDED spinlock to allow int players ets! Gloval - dword_4E98BC_bApplicationActive = 0; + while(initing); //ADDED spinlock to allow int players ets! Gloval + dword_4E98BC_bApplicationActive = 0; if ( (pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie) && pVideoPlayer->bPlayingMovie ) pVideoPlayer->bStopBeforeSchedule = 1; if (pAsyncMouse) @@ -7387,7 +7897,7 @@ return DefWindowProcA(hWnd, Msg, wParam, lParam); } } -_def_wnd_proc: +//_def_wnd_proc: return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( Msg != WM_KILLFOCUS ) @@ -7405,21 +7915,27 @@ else { if ( !pRenderer->pRenderD3D && !pRenderer->UsingDirect3D() || !AreRenderSurfacesOk() ) - goto LABEL_20; + //goto LABEL_20; + { + EndPaint(hWnd, &Paint); + return 0; + } v5 = pRenderer; } pRenderer->Present(); -LABEL_20: +//LABEL_20: EndPaint(hWnd, &Paint); return 0; } - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( ::hWnd != (HWND)wParam || (dword_4E98BC_bApplicationActive = 1, pRenderer->bWindowMode) || !pAsyncMouse ) return DefWindowProcA(hWnd, Msg, wParam, lParam); pAsyncMouse->Resume(); if ( !pAsyncMouse ) - goto _def_wnd_proc; + //goto _def_wnd_proc; + return DefWindowProcA(hWnd, Msg, wParam, lParam); pAsyncMouse->Clip(); return DefWindowProcA(hWnd, Msg, wParam, lParam); }
--- a/mm7_3.cpp Sat Apr 27 09:37:22 2013 +0600 +++ b/mm7_3.cpp Sun Apr 28 19:11:36 2013 +0600 @@ -15991,12 +15991,12 @@ //----- (004059DB) -------------------------------------------------------- signed int stru262_TurnBased::Start() { - stru262_TurnBased *v1; // ebx@1 + //stru262_TurnBased *v1; // ebx@1 unsigned int v2; // edi@1 int v3; // esi@1 int v4; // eax@5 unsigned int v5; // esi@7 - Actor *v6; // edi@7 + Actor *pActor; // edi@7 unsigned int v7; // eax@9 unsigned int v8; // edx@10 unsigned __int8 v9; // zf@14 @@ -16025,39 +16025,39 @@ int v33; // [sp+60h] [bp-14h]@10 int *v34; // [sp+64h] [bp-10h]@6 int v35; // [sp+68h] [bp-Ch]@5 - Player *v40; // [sp+6Ch] [bp-8h]@1 + Player *pPlayer; // [sp+6Ch] [bp-8h]@1 int v40b; unsigned int v37; // [sp+70h] [bp-4h]@7 pTurnEngine->field_18 &= 0xFFFFFFFDu; - v1 = this; + //v1 = this; pEventTimer->TrackGameTime(); pAudioPlayer->StopChannels(-1, -1); v2 = 0; pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0); - v40 = pParty->pPlayers; + pPlayer = pParty->pPlayers; dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength; dword_50C994 = 0; - v1->field_10 = 100; - v1->field_0 = 0; - v1->field_8 = 64; - v1->field_4 = 1; - v1->uActorQueueSize = 0; + this->field_10 = 100; + this->field_0 = 0; + this->field_8 = 64; + this->field_4 = 1; + this->uActorQueueSize = 0; v3 = 0; do { - if ( v40->CanAct() ) - { - *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = PID(OBJECT_Player,v3); - v1->pQueue[v1->uActorQueueSize].field_C = 2; - v1->pQueue[v1->uActorQueueSize].uActionLength = 0; - pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0; - } - ++v40; + if ( pPlayer->CanAct() ) + { + *(&this->field_0 + 4 * (this->uActorQueueSize + 2)) = PID(OBJECT_Player,v3); + this->pQueue[this->uActorQueueSize].field_C = 2; + this->pQueue[this->uActorQueueSize].uActionLength = 0; + pParty->pTurnBasedPlayerRecoveryTimes[this->uActorQueueSize++] = 0; + } + ++pPlayer; ++v3; } - while ( v40 <=&pParty->pPlayers[3] ); - v35 = v1->uActorQueueSize; + while ( pPlayer <= &pParty->pPlayers[3] ); + v35 = this->uActorQueueSize; v4 = v35; v40b = v35; if ( v40b < v40b + ai_arrays_size ) @@ -16067,24 +16067,24 @@ { v37 = *v34; v5 = v37; - v6 = &pActors[v37]; + pActor = &pActors[v37]; if ( v37 != 10 ) { if ( pActors[v37].CanAct() ) { - v7 = v6->uAttributes; + v7 = pActor->uAttributes; if ( v7 & 0x8000 < 0 ) { v8 = ai_near_actors_targets_pid[v5]; LOBYTE(v7) = v7 | 0x80; - v6->uAttributes = v7; + pActor->uAttributes = v7; v33 = PID(OBJECT_Actor,v5); memcpy(&v31, Actor::GetDirectionInfo(PID(OBJECT_Actor,v5), v8, &a3, 0), sizeof(v31)); memcpy(&v30, &v31, sizeof(v30)); Actor::AI_StandOrBored(v37, 4, 32, &v30); - *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = v33; - v1->pQueue[v1->uActorQueueSize].field_C = 2; - v1->pQueue[v1->uActorQueueSize++].uActionLength = 0; + *(&this->field_0 + 4 * (this->uActorQueueSize + 2)) = v33; + this->pQueue[this->uActorQueueSize].field_C = 2; + this->pQueue[this->uActorQueueSize++].uActionLength = 0; } } v4 = v35; @@ -16095,14 +16095,14 @@ while ( v40b < v4 + ai_arrays_size ); v2 = 0; } - v11 = __OFSUB__(v1->uActorQueueSize, v2); - v9 = v1->uActorQueueSize == v2; - v10 = ((v1->uActorQueueSize - v2) & 0x80000000u) != 0; + v11 = __OFSUB__(this->uActorQueueSize, v2); + v9 = this->uActorQueueSize == v2; + v10 = ((this->uActorQueueSize - v2) & 0x80000000u) != 0; v37 = v2; v40b = v2; if ( !((unsigned __int8)(v10 ^ v11) | v9) ) { - v12 = (char *)&v1->pQueue[0].field_4; + v12 = (char *)&this->pQueue[0].field_4; while ( 1 ) { v13 = PID_TYPE(*((int *)v12 - 1)); @@ -16113,7 +16113,6 @@ { v33 = v14; v16 = (signed __int64)((double)v14 * 0.46875); -LABEL_20: *(int *)v12 = v16; goto LABEL_26; } @@ -16122,7 +16121,7 @@ LABEL_26: ++v40b; v12 += 16; - if ( v40b >= v1->uActorQueueSize ) + if ( v40b >= this->uActorQueueSize ) goto LABEL_27; } if ( v13 != 3 ) @@ -16139,7 +16138,8 @@ LODWORD(v16) = SHIDWORD(v16) < 66; LOBYTE(v16) = SHIDWORD(v16) >= 66; LODWORD(v16) = 2 * v16 + 3; - goto LABEL_20; + *(int *)v12 = v16; + goto LABEL_26; } LABEL_27: v18 = 0; @@ -16148,8 +16148,7 @@ do { __debugbreak(); - *(&v31.uDistance + v18) = pParty->pPlayers[*(&v1->field_0 + 4 * (*(&a3.uDistance + v18) + 2)) >> 3].GetAttackRecoveryTime( - v2); + *(&v31.uDistance + v18) = pParty->pPlayers[*(&this->field_0 + 4 * (*(&a3.uDistance + v18) + 2)) >> 3].GetAttackRecoveryTime(v2); ++v18; } while ( (signed int)v18 < (signed int)v37 ); @@ -16197,11 +16196,11 @@ v28 = *(&a3.uDistance + v2++); v11 = __OFSUB__(v2, v37); v10 = ((v2 - v37) & 0x80000000u) != 0; - v1->pQueue[v28].field_4 = v27; + this->pQueue[v28].field_4 = v27; } while ( v10 ^ v11 ); } } } - return v1->_404544(); -} + return this->_404544(); +}
--- a/mm7_5.cpp Sat Apr 27 09:37:22 2013 +0600 +++ b/mm7_5.cpp Sun Apr 28 19:11:36 2013 +0600 @@ -7480,16 +7480,16 @@ bool stru262_TurnBased::_406D10(signed int a2) { int v2; // ecx@1 - int v3; // ecx@2 - Actor *v4; // ebx@2 - unsigned __int16 v5; // dx@2 + //int v3; // ecx@2 + Actor *actor; // ebx@2 + //unsigned __int16 v5; // dx@2 int *v6; // esi@7 TurnBased_QueueElem *v7; // edi@7 int v8; // eax@7 AIDirection *v9; // esi@10 int v10; // eax@10 unsigned int v11; // ecx@10 - unsigned __int8 v12; // al@12 + unsigned __int8 pHostileType; // al@12 unsigned __int8 v13; // sf@16 unsigned __int8 v14; // of@16 unsigned int v15; // edx@22 @@ -7509,26 +7509,26 @@ unsigned int uActorID; // [sp+50h] [bp-4h]@2 unsigned int a2a; // [sp+5Ch] [bp+8h]@7 - __debugbreak(); + __debugbreak();//срабатывает при пошаговом режиме после пяти шагов v2 = *(&this->field_0 + 4 * (a2 + 2)); if (PID_TYPE(v2) == OBJECT_Player) return 0; - v3 = PID_ID(v2); - uActorID = v3; - v4 = &pActors[v3]; - v5 = v4->uAIState; - if ( v5 == 5 || v5 == 4 || v5 == 11 || v5 == 19 || v5 == 17 ) + uActorID = PID_ID(v2); + //uActorID = v3; + actor = &pActors[uActorID]; + //v5 = v4->uAIState; + if ( actor->uAIState == 5 || actor->uAIState == 4 || actor->uAIState == 11 || actor->uAIState == 19 || actor->uAIState == 17 ) return 1; - v6 = &ai_near_actors_targets_pid[v3]; + v6 = &ai_near_actors_targets_pid[uActorID]; v7 = &pTurnEngine->pQueue[a2]; v8 = *v6; v29 = &pTurnEngine->pQueue[a2]; a2a = v8; - Actor::_SelectTarget(v3, &ai_near_actors_targets_pid[v3], true); - if ( v4->pMonsterInfo.uHostilityType && !*v6 ) - v4->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; + Actor::_SelectTarget(uActorID, &ai_near_actors_targets_pid[uActorID], true); + if ( actor->pMonsterInfo.uHostilityType && !*v6 ) + actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; v9 = Actor::GetDirectionInfo(v7->uPackedID, a2a, &a3, 0); - v10 = v4->uActorRadius; + v10 = actor->uActorRadius; memcpy(&a3, v9, sizeof(a3)); memcpy(&pDir, &a3, sizeof(pDir)); v11 = a3.uDistance - v10; @@ -7538,82 +7538,101 @@ v11 = 0; v28 = 0; } - v12 = v4->pMonsterInfo.uHostilityType; - if ( v12 == 1 ) + pHostileType = actor->pMonsterInfo.uHostilityType; + if ( pHostileType == 1 ) { if ( (double)(signed int)v28 >= 307.2 ) goto LABEL_21; -LABEL_20: - v4->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; + actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; goto LABEL_21; } - if ( v12 == 2 ) + if ( pHostileType == 2 ) { v14 = __OFSUB__(v11, 1024); v13 = ((v11 - 1024) & 0x80000000u) != 0; } else { - if ( v12 != 3 ) + if ( pHostileType != 3 ) goto LABEL_21; v14 = __OFSUB__(v11, 2560); v13 = ((v11 - 2560) & 0x80000000u) != 0; } if ( v13 ^ v14 ) - goto LABEL_20; + { + actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; + } LABEL_21: - if ( (signed __int64)v4->pActorBuffs[4].uExpireTime > 0 ) - { - v15 = a2a; + if ( (signed __int64)actor->pActorBuffs[4].uExpireTime > 0 ) + { if ( (signed int)v11 < 10240 ) { - v23 = &pDir; - v16 = uActorID; - v21 = 0; - goto LABEL_24; - } - v24 = 0; - v22 = 1024; - goto LABEL_58; - } - if ( v4->pMonsterInfo.uHostilityType != 4 ) + Actor::Flee(uActorID, a2a, 0, &pDir); + v29->field_C = 4; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + Actor::_4032B2(uActorID, a2a, 1024, 0); + v29->field_C = 2; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + if ( actor->pMonsterInfo.uHostilityType != 4 ) goto LABEL_46; - if ( !(v4->uAttributes & 0x020000) || v4->pMonsterInfo.uAIType == 1 ) - { - if ( v4->pMonsterInfo.uAIType == 1 ) - goto LABEL_36; - if ( v4->pMonsterInfo.uAIType == 2 ) - { - v27 = v4->sCurrentHP; + if ( !(actor->uAttributes & 0x020000) || actor->pMonsterInfo.uAIType == 1 ) + { + if ( actor->pMonsterInfo.uAIType == 1 ) + { + if ( actor->pMonsterInfo.uMovementType == 5 ) + { + Actor::AI_Stand(uActorID, a2a, 32, 0); + v29->field_C = 4; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + Actor::Flee(uActorID, a2a, 32, 0); + v29->field_C = 4; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + if ( actor->pMonsterInfo.uAIType == 2 ) + { + v27 = actor->sCurrentHP; v18 = (double)v27; - v19 = (double)(signed int)v4->pMonsterInfo.uHP * 0.2; - goto LABEL_34; - } - if ( v4->pMonsterInfo.uAIType == 3 ) - { - v27 = v4->sCurrentHP; - v18 = (double)v27; - v19 = (double)(signed int)v4->pMonsterInfo.uHP * 0.1; -LABEL_34: + v19 = (double)(signed int)actor->pMonsterInfo.uHP * 0.2; if ( v19 > v18 && (signed int)v11 < 10240 ) { -LABEL_36: - v16 = uActorID; - v15 = a2a; - v23 = 0; - v21 = 32; - if ( v4->pMonsterInfo.uMovementType == 5 ) - { - Actor::AI_Stand(uActorID, a2a, 0x20u, 0); - goto LABEL_25; - } -LABEL_24: - Actor::Flee(v16, v15, v21, v23); -LABEL_25: - v17 = v29; + if ( actor->pMonsterInfo.uMovementType == 5 ) + { + Actor::AI_Stand(uActorID, a2a, 32, 0); + v29->field_C = 4; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + Actor::Flee(uActorID, a2a, 32, 0); v29->field_C = 4; -LABEL_60: - v17->uActionLength = v4->uCurrentActionLength; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + goto LABEL_39; + } + if ( actor->pMonsterInfo.uAIType == 3 ) + { + v27 = actor->sCurrentHP; + v18 = (double)v27; + v19 = (double)(signed int)actor->pMonsterInfo.uHP * 0.1; + if ( v19 > v18 && (signed int)v11 < 10240 ) + { + if ( actor->pMonsterInfo.uMovementType == 5 ) + { + Actor::AI_Stand(uActorID, a2a, 32, 0); + v29->field_C = 4; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + Actor::Flee(uActorID, a2a, 32, 0); + v29->field_C = 4; + v29->uActionLength = actor->uCurrentActionLength; return 1; } goto LABEL_39; @@ -7624,50 +7643,49 @@ return 0; if ( (signed int)v11 < 5120 ) { - if ( v4->pMonsterInfo.uMissleAttack1Type && (signed int)v11 < 1024 ) + if ( actor->pMonsterInfo.uMissleAttack1Type && (signed int)v11 < 1024 ) Actor::Pursue1(uActorID, a2a, uActorID, 32, &pDir); else Actor::Pursue2(uActorID, a2a, 32, &pDir, 307); - goto LABEL_59; + v29->field_C = 2; + v29->uActionLength = actor->uCurrentActionLength; + return 1; } LABEL_46: - if ( !v4->pMonsterInfo.uMovementType ) - { - v24 = 32; - v22 = 1024; - goto LABEL_57; - } - if ( v4->pMonsterInfo.uMovementType == 1 ) - { - v24 = 32; - v22 = 2560; - goto LABEL_57; - } - if ( v4->pMonsterInfo.uMovementType == 2 ) - { - v24 = 32; - v22 = 5120; -LABEL_57: - v15 = a2a; -LABEL_58: - Actor::_4032B2(uActorID, v15, v22, v24); -LABEL_59: - v17 = v29; + if ( !actor->pMonsterInfo.uMovementType ) + { + Actor::_4032B2(uActorID, a2a, 1024, 32); + v29->field_C = 2; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + if ( actor->pMonsterInfo.uMovementType == 1 ) + { + Actor::_4032B2(uActorID, a2a, 2560, 32); v29->field_C = 2; - goto LABEL_60; - } - if ( v4->pMonsterInfo.uMovementType == 4 ) + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + if ( actor->pMonsterInfo.uMovementType == 2 ) + { + Actor::_4032B2(uActorID, a2a, 5120, 32); + v29->field_C = 2; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + if ( actor->pMonsterInfo.uMovementType == 4 ) { Actor::_4032B2(uActorID, a2a, 10240, 32); - goto LABEL_53; - } - if ( v4->pMonsterInfo.uMovementType == 5 ) - { - Actor::AI_Stand(uActorID, a2a, 0x20u, 0); -LABEL_53: - v17 = v29; v29->field_C = 2; - goto LABEL_60; + v29->uActionLength = actor->uCurrentActionLength; + return 1; + } + if ( actor->pMonsterInfo.uMovementType == 5 ) + { + Actor::AI_Stand(uActorID, a2a, 32, 0); + v29->field_C = 2; + v29->uActionLength = actor->uCurrentActionLength; + return 1; } return 1; }
--- a/stru6.cpp Sat Apr 27 09:37:22 2013 +0600 +++ b/stru6.cpp Sun Apr 28 19:11:36 2013 +0600 @@ -1297,8 +1297,8 @@ switch (uSpellID) { - case SPELL_153: - __debugbreak(); // spell id == 153 wtf , curse probably ? happening when attacked by harpies /disease(Ritor1)/ + case SPELL_DISEASE: + //__debugbreak(); // spell id == 153 wtf , curse probably ? happening when attacked by harpies /disease(Ritor1)/ v6 = "zapp"; break;