Mercurial > mm7
changeset 336:ea55d6414029
Event_proceccor preliminary
author | Gloval |
---|---|
date | Thu, 21 Feb 2013 00:33:12 +0400 |
parents | f76027321087 |
children | d27e30e0158a |
files | Arcomage.cpp Events.cpp Events.h GUIButton.cpp GUIButton.h GUIWindow.cpp Player.cpp SaveLoad.cpp VideoPlayer.cpp mm7_1.cpp mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_5.cpp mm7_data.cpp mm7_data.h stru176.h |
diffstat | 17 files changed, 553 insertions(+), 628 deletions(-) [+] |
line wrap: on
line diff
--- a/Arcomage.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/Arcomage.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -5641,8 +5641,8 @@ pArcomageGame->uGameResult = v0; if ( v0 == 1 ) { - v7 = ptr_507BC0; - v8 = (signed int)ptr_507BC0->ptr_1C; + v7 = window_SpeakInHouse; + v8 = (signed int)window_SpeakInHouse->ptr_1C; if ( v8 >= 108 ) { if ( v8 <= 120 )
--- a/Events.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/Events.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -122,11 +122,11 @@ if (!uLevelEVT_Size) return; - memset(array_5B5928, 0, 3200); - memset(pLevelEVT_Index, 80, 52800); + memset(array_5B5928_timers, 0, 3200); + memset(pLevelEVT_Index, 80, sizeof(EventIndex)*4400); uLevelEVT_NumEvents = 0; - dword_5B65C8 = 0; + dword_5B65C8_timers_count = 0; for (uint i = 0, j = 0; j < uLevelEVT_Size; ++i) { @@ -143,7 +143,7 @@ void EventProcessor(int uEventID, int a2, int a3) { unsigned int v3; // eax@5 - //signed int v4; // esi@7 + signed int v4; // esi@7 //char *v5; // eax@8 Player *v6; // ecx@8 //char *v7; // ebp@8 @@ -263,10 +263,10 @@ int v121; // [sp-4h] [bp-4ACh]@294 int curr_seq_num; // [sp+10h] [bp-498h]@4 //char *v123; // [sp+14h] [bp-494h]@0 - //signed int v124; // [sp+18h] [bp-490h]@7 + signed int v124; // [sp+18h] [bp-490h]@7 signed int v125; // [sp+1Ch] [bp-48Ch]@155 int v126; // [sp+1Ch] [bp-48Ch]@262 - int v127; // [sp+20h] [bp-488h]@4 + int player_choose; // [sp+20h] [bp-488h]@4 int v128; // [sp+24h] [bp-484h]@21 int v129; // [sp+24h] [bp-484h]@262 signed int v130; // [sp+28h] [bp-480h]@0 @@ -294,54 +294,57 @@ ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here return; } - v127 = 2 * (uActiveCharacter == 0) + 4; //4 and 6 - curr_seq_num = dword_597F18; + player_choose = (uActiveCharacter == 0)?6:4; //4 - active or 6 - random player if active =0 + curr_seq_num = start_event_seq_number; if ( _5C3420_pDecoration ) { uSomeEVT_NumEvents = uGlobalEVT_NumEvents; pSomeEVT = pGlobalEVT; - memcpy(pSomeEVT_Events, pGlobalEVT_Index, 52800); //4400 evts + memcpy(pSomeEVT_Events, pGlobalEVT_Index, sizeof(EventIndex)*4400); //4400 evts } else { uSomeEVT_NumEvents = uLevelEVT_NumEvents; pSomeEVT = pLevelEVT; - memcpy(pSomeEVT_Events, pLevelEVT_Index, 52800); + memcpy(pSomeEVT_Events, pLevelEVT_Index, sizeof(EventIndex)*4400); } - //v4 = 0; - //v124 = 0; - for (uint i = 0; i < uSomeEVT_NumEvents; ++i) - { - //v5 = pSomeEVT; + v4 = 0; + v124 = 0; + //for (uint i = 0; i < uSomeEVT_NumEvents; ++i) + // { + //v6 = v123; //v7 = ""; - //while ( 1 ) - //{ + while ( 1 ) + { if ( dword_5B65C4 ) goto LABEL_301; //v8 = v4; - if ( pSomeEVT_Events[i/*v4*/].uEventID == uEventID && pSomeEVT_Events[i/*v4*/].event_sequence_num == curr_seq_num ) + if ( pSomeEVT_Events[v4].uEventID == uEventID && pSomeEVT_Events[v4].event_sequence_num == curr_seq_num ) { //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT; //v10 = (ByteArray *)&v5[v9]; - auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT); + auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[v4].uEventOffsetInEVT); switch (_evt->_e_type) { case EVENT_CheckSeason: + // if ( !sub_4465DF_check_season(_evt->v5) ) { ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; } - v11 = _evt->v6; - goto LABEL_130; + v124 = -1; + curr_seq_num = _evt->v6 - 1; + ++curr_seq_num; + break; case EVENT_ShowMovie: { strcpy(Source, (char *)&_evt->v7); @@ -380,8 +383,8 @@ if (pAsyncMouse) pAsyncMouse->Resume(); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -403,8 +406,8 @@ if (pAsyncMouse) pAsyncMouse->Resume(); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; @@ -427,8 +430,8 @@ if (pAsyncMouse) pAsyncMouse->Resume(); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; } @@ -436,21 +439,21 @@ case EVENT_CheckSkill: { v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8); - if ( v127 < 0 ) + if ( player_choose < 0 ) goto LABEL_47; - if ( v127 <= 3 ) + if ( player_choose <= 3 ) { - v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + _evt->v5]; + v24 = pParty->pPlayers[0].pActiveSkills[3486 * player_choose + _evt->v5]; } else { - if ( v127 == 4 ) + if ( player_choose == 4 ) { v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5]; } else { - if ( v127 == 5 ) + if ( player_choose == 5 ) { v20 = 0; v21 = 3486 * v130 + _evt->v5; @@ -467,8 +470,8 @@ if ( v20 >= 4 ) { ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -492,8 +495,8 @@ goto LABEL_130; } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; } @@ -517,8 +520,8 @@ + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8); } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -535,8 +538,8 @@ LOBYTE(v26->field_2) |= 0x20u; } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -546,8 +549,8 @@ pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu; pNPCStats->pNewNPCData[v27].greet = v28; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -605,25 +608,25 @@ if ( v30 == 78 ) { sub_4BD8B5(); - ptr_507BC0->Release(); + window_SpeakInHouse->Release(); pParty->uFlags &= 0xFFFFFFFDu; if ( EnterHouse((enum HOUSE_TYPE)170) ) { pAudioPlayer->StopChannels(-1, -1); - ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0); - ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); - ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); - ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); - ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); - ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); + window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0); + window_SpeakInHouse->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); + window_SpeakInHouse->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); + window_SpeakInHouse->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); + window_SpeakInHouse->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); + window_SpeakInHouse->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); ptr_F8B1E8 = pNPCTopics[90].pText; } } } ++curr_seq_num; } - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -631,8 +634,8 @@ sub_448518_npc_set_item(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -640,16 +643,16 @@ Actor::GiveItem(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_SetNPCGroupNews: pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -657,8 +660,8 @@ __debugbreak(); *(&pActors[0].uGroup + 0x11000000 * _evt->v8 + 209 * (_evt->v5 + ((_evt->v6 + ((uint)_evt->v7 << 8)) << 8))) = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -680,8 +683,8 @@ while ( v40 ); } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -703,8 +706,8 @@ while ( v44 ); } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -712,21 +715,21 @@ { pNPCStats->pNewNPCData[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)].Location2D = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); - if ( ptr_507BC0 ) + if ( window_SpeakInHouse ) { - v46 = ptr_507BC0->ptr_1C; + v46 = window_SpeakInHouse->ptr_1C; if ( v46 == (void *)165 ) { sub_4BD8B5(); pVideoPlayer->Unload(); - ptr_507BC0->Release(); + window_SpeakInHouse->Release(); pParty->uFlags &= 0xFFFFFFFDu; _5C3420_pDecoration = (LevelDecoration *)1; if ( EnterHouse((enum HOUSE_TYPE)165) ) { pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0); v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0); - ptr_507BC0 = v47; + window_SpeakInHouse = v47; v48 = v47->pControlsHead; if ( v48 ) { @@ -737,11 +740,11 @@ v48 = v49; } while ( v49 ); - v47 = ptr_507BC0; + v47 = window_SpeakInHouse; } v47->pControlsHead = 0; - ptr_507BC0->pControlsTail = 0; - ptr_507BC0->uNumControls = 0; + window_SpeakInHouse->pControlsTail = 0; + window_SpeakInHouse->uNumControls = 0; } } else @@ -752,127 +755,58 @@ } ++curr_seq_num; } - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_Jmp: - //v124 = -1; curr_seq_num = _evt->v5 - 1; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + //v4 = -1; + //v6 = v123; //v7 = ""; break; case EVENT_ShowFace: - v50 = _evt->v5; - if ( (unsigned __int8)v50 <= 3u ) + if ( _evt->v5 <= 3u ) //someone + pParty->pPlayers[_evt->v5].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); + else if ( _evt->v5 == 4 ) //active + pParty->pPlayers[uActiveCharacter].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); + else if ( _evt->v5 == 5 ) //all players { - v117 = 0; - v113 = _evt->v6; - v53 = (unsigned __int8)v50; - v52 = &pParty->pPlayers[v53]; - v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); - ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; - //v6 = v123; - //v7 = ""; - break; + for(int i=0; i<4; ++i) + pParty->pPlayers[i].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); } - if ( v50 == 4 ) - { - v117 = 0; - v113 = _evt->v6; - v52 = pPlayers[uActiveCharacter]; - v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); + else //random player + pParty->pPlayers[rand() % 4].PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; - //v6 = v123; - //v7 = ""; - break; - } - if ( v50 != 5 ) - { - v117 = 0; - v113 = _evt->v6; - v53 = rand() % 4; - v52 = &pParty->pPlayers[v53]; - v52->PlayEmotion((CHARACTER_EXPRESSION_ID)v113, v117); - ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; - //v6 = v123; - //v7 = ""; - break; - } - v51 = pParty->pPlayers; - do - { - v51->PlayEmotion((CHARACTER_EXPRESSION_ID)_evt->v6, 0); - ++v51; - } - while ( (signed int)v51 < (signed int)pParty->pHirelings ); - //LABEL_291: - ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_CharacterAnimation: - v54 = _evt->v5; - if ( (unsigned __int8)v54 <= 3u ) - { - v118 = 0; - v114 = _evt->v6; - v57 = (unsigned __int8)v54; - goto LABEL_119; - } - if ( v54 == 4 ) - { - v118 = 0; - v114 = _evt->v6; - v56 = pPlayers[uActiveCharacter]; - goto LABEL_120; - } - if ( v54 != 5 ) - { - v118 = 0; - v114 = _evt->v6; - v57 = rand() % 4; -LABEL_119: - v56 = &pParty->pPlayers[v57]; -LABEL_120: - v56->PlaySound((PlayerSpeech)v114, v118); - ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + if ( _evt->v5 <= 3u ) //someone + pParty->pPlayers[_evt->v5].PlaySound((PlayerSpeech) _evt->v6, 0); + else if ( _evt->v5 == 4 ) //active + pParty->pPlayers[uActiveCharacter].PlaySound((PlayerSpeech) _evt->v6, 0); + else if ( _evt->v5 == 5 ) //all + for(int i=0; i<4; ++i) + pParty->pPlayers[i].PlaySound((PlayerSpeech) _evt->v6, 0); + else //random + pParty->pPlayers[rand() % 4].PlaySound((PlayerSpeech) _evt->v6, 0); + ++curr_seq_num; + v4 = v124; + //v6 = v123; //v7 = ""; - break; - } - v55 = pParty->pPlayers; - for (int iii = 0; iii < 4; ++iii) - { - v55->PlaySound((PlayerSpeech)_evt->v6, 0); - ++v55; - } - //while ( (signed int)v55 < (signed int)pParty->pHirelings ); - ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; - //v6 = v123; - //v7 = ""; break; case EVENT_ForPartyMember: - v127 = _evt->v5; + player_choose = _evt->v5; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -884,14 +818,14 @@ _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8), _evt->v25, _evt->v26, 0, 0); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_Compare: v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); - if ( v127 == 5 ) + if ( player_choose == 5 ) { v130 = 0; v59 = pParty->pPlayers; @@ -905,8 +839,8 @@ if ( (signed int)v59 >= (signed int)pParty->pHirelings ) { ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -916,12 +850,12 @@ v11 = _evt->v11; goto LABEL_130; } - if ( v127 < 0 ) + if ( player_choose < 0 ) goto LABEL_139; - v61 = v127; - if ( v127 <= 3 ) + v61 = player_choose; + if ( player_choose <= 3 ) goto LABEL_137; - if ( v127 == 4 ) + if ( player_choose == 4 ) { if ( uActiveCharacter ) { @@ -931,11 +865,11 @@ } else { - if ( v127 != 6 ) + if ( player_choose != 6 ) goto LABEL_139; } v61 = rand() % 4; - //v5 = pSomeEVT; + LABEL_137: v6 = &pParty->pPlayers[v61]; LABEL_138: @@ -948,8 +882,8 @@ if ( v62 ) goto LABEL_129; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -968,8 +902,8 @@ { pMouse->RemoveHoldingItem(); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -983,8 +917,8 @@ { v66->RemoveItemAtInventoryIndex(v65); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1001,8 +935,8 @@ { *(&v66->pEquipment.uOffHand + v68) = 0; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1049,30 +983,30 @@ if ( v125 > (signed int)&pPlayers[4] ) { ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; } } } - v75 = v127; - if ( v127 != 5 ) + v75 = player_choose; + if ( player_choose != 5 ) { - if ( v127 < 0 ) + if ( player_choose < 0 ) goto LABEL_183; - if ( v127 > 3 ) + if ( player_choose > 3 ) { - if ( v127 != 4 ) + if ( player_choose != 4 ) { - if ( v127 == 6 ) + if ( player_choose == 6 ) goto LABEL_180; LABEL_183: ((Player *)v6)->SubtractVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1084,7 +1018,7 @@ } LABEL_180: v75 = rand() % 4; - //v5 = pSomeEVT; + } v6 = &pParty->pPlayers[v75]; LABEL_182: @@ -1102,29 +1036,29 @@ } while ( (signed int)v76 < (signed int)pParty->pHirelings ); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_Set: v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); - v78 = v127; - if ( v127 != 5 ) + v78 = player_choose; + if ( player_choose != 5 ) { - if ( v127 < 0 ) + if ( player_choose < 0 ) goto LABEL_197; - if ( v127 > 3 ) + if ( player_choose > 3 ) { - if ( v127 != 4 ) + if ( player_choose != 4 ) { - if ( v127 == 6 ) + if ( player_choose == 6 ) goto LABEL_194; LABEL_197: ((Player *)v6)->SetVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v77); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1136,7 +1070,7 @@ } LABEL_194: v78 = rand() % 4; - //v5 = pSomeEVT; + } v6 = &pParty->pPlayers[v78]; LABEL_196: @@ -1154,23 +1088,23 @@ } while ( (signed int)v79 < (signed int)pParty->pHirelings ); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_Add: v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); - v81 = v127; - if ( v127 != 5 ) + v81 = player_choose; + if ( player_choose != 5 ) { - if ( v127 < 0 ) + if ( player_choose < 0 ) goto LABEL_211; - if ( v127 > 3 ) + if ( player_choose > 3 ) { - if ( v127 != 4 ) + if ( player_choose != 4 ) { - if ( v127 == 6 ) + if ( player_choose == 6 ) goto LABEL_208; LABEL_211: ((Player *)v6)->AddVariable( @@ -1185,7 +1119,7 @@ } LABEL_208: v81 = rand() % 4; - //v5 = pSomeEVT; + } v6 = &pParty->pPlayers[v81]; LABEL_210: @@ -1207,13 +1141,13 @@ if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 ) viewparams->bRedrawGameUI = 1; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_InputString: - if ( !dword_597F18 ) + if ( !start_event_seq_number ) { strcpy( GameUI_StatusBar_TimedString, @@ -1244,8 +1178,8 @@ curr_seq_num = v11 - 1; } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1269,8 +1203,8 @@ if ( !uActiveCharacter ) { ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1290,8 +1224,8 @@ LABEL_234: v88->ReceiveDamage(v115, v119); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1304,16 +1238,16 @@ } while ( (signed int)v87 < (signed int)pParty->pHirelings ); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_ToggleIndoorLight: pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1321,8 +1255,8 @@ sub_44892E_set_faces_bit(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1330,8 +1264,8 @@ Chest::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1339,8 +1273,8 @@ Actor::ToggleFlag(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1350,8 +1284,8 @@ _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8), _evt->v13); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1359,8 +1293,8 @@ if ( !_evt->v5 ) pWeather->bRenderSnow = _evt->v6 != 0; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1372,8 +1306,8 @@ { ptr_F8B1E8 = pNPCTopics[v90-1].pText;//(&dword_721664)[8 * v90]; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1384,8 +1318,8 @@ //LABEL_248: ShowStatusBarString(v91, 2u); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1398,16 +1332,16 @@ v91 = &pLevelStr[pLevelStrOffsets[v90]]; ShowStatusBarString(v91, 2u); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; } } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1424,8 +1358,8 @@ strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]); } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1437,24 +1371,24 @@ _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8), _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8)); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_SetTexture: sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_SetSprite: SetDecorationSprite(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9, (char *)&_evt->v10); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1466,8 +1400,8 @@ _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8), _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8)); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1475,16 +1409,16 @@ case EVENT_LocationName: --curr_seq_num; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; case EVENT_ChangeDoorState: sub_449A49_door_switch_animation(_evt->v5, _evt->v6); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1492,8 +1426,8 @@ if ( !Chest::Open(_evt->v5) ) goto LABEL_301; ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1578,8 +1512,8 @@ while ( sub_4BD8B5() ) ; pVideoPlayer->Unload(); - ptr_507BC0->Release(); - ptr_507BC0 = 0; + window_SpeakInHouse->Release(); + window_SpeakInHouse = 0; if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; pCurrentScreen = SCREEN_GAME; @@ -1594,8 +1528,8 @@ } } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1619,13 +1553,12 @@ item.uItemID = v102; pParty->SetHoldingItem(&item); ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; - case EVENT_SpeakInHouse: - v103 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + case EVENT_SpeakInHouse: if ( EnterHouse((enum HOUSE_TYPE)(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8))) ) { if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode ) @@ -1634,17 +1567,17 @@ pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0); v104 = 187; if ( uCurrentHouse_Animation != 167 ) - v104 = v103; - ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0); - ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); - ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); - ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); - ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); - ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); + v104 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); + window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0); + window_SpeakInHouse->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); + window_SpeakInHouse->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); + window_SpeakInHouse->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); + window_SpeakInHouse->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); + window_SpeakInHouse->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); } ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; @@ -1656,17 +1589,17 @@ goto LABEL_301; default: ++curr_seq_num; - //v4 = v124; - //v5 = pSomeEVT; + v4 = v124; + //v6 = v123; //v7 = ""; break; } } - //++v4; - //v124 = v4; - //if ( v4 >= (signed int)uSomeEVT_NumEvents ) - //goto LABEL_301; + ++v4; + v124 = v4; + if ( v4 >= uSomeEVT_NumEvents ) + goto LABEL_301; //} } }
--- a/Events.h Wed Feb 20 21:35:13 2013 +0400 +++ b/Events.h Thu Feb 21 00:33:12 2013 +0400 @@ -292,8 +292,10 @@ VAR_ItemEquipped = 0x13B, }; - - +#define EVT_WORD(x) *(unsigned __int16*)&x +#define EVT_DWORD(x) *(unsigned int*)&x +#define EVT_STRING(x) (unsigned char*)&x +#define EVT_BYTE(x) (unsigned char)x extern EventIndex pSomeOtherEVT_Events[4400]; extern unsigned int uSomeOtherEVT_NumEvents;
--- a/GUIButton.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/GUIButton.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -73,7 +73,7 @@ struct GUIWindow *pPrimaryWindow; struct GUIWindow *pChestWindow; struct GUIWindow *pDialogueWindow; -struct GUIWindow *ptr_507BC0; +struct GUIWindow *window_SpeakInHouse; struct GUIWindow *pGUIWindow_ScrollWindow; struct GUIWindow *ptr_507BC8; struct GUIWindow *pGUIWindow_CurrentMenu;
--- a/GUIButton.h Wed Feb 20 21:35:13 2013 +0400 +++ b/GUIButton.h Thu Feb 21 00:33:12 2013 +0400 @@ -99,7 +99,7 @@ extern struct GUIWindow *pPrimaryWindow; extern struct GUIWindow *pChestWindow; extern struct GUIWindow *pDialogueWindow; -extern struct GUIWindow *ptr_507BC0; +extern struct GUIWindow *window_SpeakInHouse; extern struct GUIWindow *pGUIWindow_ScrollWindow; extern struct GUIWindow *ptr_507BC8; extern struct GUIWindow *pGUIWindow_CurrentMenu;
--- a/GUIWindow.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/GUIWindow.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -1047,7 +1047,7 @@ GUIWindow v18; // [sp+60h] [bp-58h]@2 int v19; // [sp+B4h] [bp-4h]@2 - if ( !ptr_507BC0 ) + if ( !window_SpeakInHouse ) return; memcpy(&v18, this, sizeof(v18)); v18.uFrameWidth -= 18; @@ -1062,7 +1062,7 @@ w.uFrameHeight = 2 * LOBYTE(pFontCreate->uFontHeight); //v2 = (const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C]; - v2 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pName; + v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName; if ( v2 ) { @@ -1071,7 +1071,7 @@ v3 = 0; v18.DrawTitleText(pFontCreate, 0x1EAu, v3 / 2 + 4, v1, //(const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C], - p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pName, 3); + p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName, 3); } } v18.uFrameWidth += 8; @@ -1094,7 +1094,7 @@ (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - (v5 + 7)); pRenderer->DrawTextureIndexed(8u, 347 - v6, pTexture_591428); v7 = FitTextInAWindow(ptr_F8B1E8, pFontArrus, &w, 0xDu, 0); - ptr_507BC0->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0); + window_SpeakInHouse->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0); } v8 = 0; if ( uNumDialogueNPCPortraits <= 0 ) @@ -1125,7 +1125,7 @@ { v15 = 3; //v13 = (char *)p2DEvents_minus1__10[13 * (unsigned int)ptr_507BC0->ptr_1C]; - v13 = (char *)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pProprieterTitle; + v13 = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle; v11 = v19; v10 = 113; LABEL_56: @@ -1157,9 +1157,9 @@ { sprintfex( pTmpBuf, pGlobalTXT_LocalizationStrings[429], //p2DEvents_minus1_::08[13 * (unsigned int)ptr_507BC0->ptr_1C], - p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pProprieterName, + p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName, //p2DEvents_minus1__10[13 * (unsigned int)ptr_507BC0->ptr_1C]); - p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].pProprieterTitle); + p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle); v18.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, v19, pTmpBuf, 3u); if ( dword_F8B198 <= 18 ) { @@ -1992,7 +1992,7 @@ } if ( v25 == 1 ) { - ptr_507BC0 = &pWindowList[uNextFreeWindowID]; + window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; _4B4224_UpdateNPCTopics(0); } }
--- a/Player.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/Player.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -445,7 +445,7 @@ char v3; // zf@4 v1 = this; - v2 = (signed int)ptr_507BC0->ptr_1C; + v2 = (signed int)window_SpeakInHouse->ptr_1C; if ( v2 == 78 || v2 > 80 && v2 <= 82 ) { if ( GetMajorConditionIdx() == 18 )
--- a/SaveLoad.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/SaveLoad.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -51,7 +51,7 @@ SavegameHeader header; // [sp+Ch] [bp-E4h]@23 char Str[123]; // [sp+70h] [bp-80h]@25 - dword_5B65C8 = 0; + dword_5B65C8_timers_count = 0; if (!pSavegameUsedSlots[uSlot]) { pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
--- a/VideoPlayer.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/VideoPlayer.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -1117,20 +1117,20 @@ } } pMouse->_469E24(); - if ( ptr_507BC0 && ptr_507BC0->ptr_1C == (void *)165 && !v1->pSmackerMovie ) + if ( window_SpeakInHouse && window_SpeakInHouse->ptr_1C == (void *)165 && !v1->pSmackerMovie ) { bGameoverLoop = 1; sub_4BD8B5(); - ptr_507BC0->Release(); + window_SpeakInHouse->Release(); pParty->uFlags &= 0xFFFFFFFDu; if ( EnterHouse((enum HOUSE_TYPE)165) ) { pAudioPlayer->PlaySound(SOUND_0, 0, 0, -1, 0, 0, 0, 0); - ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0); - ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); - ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); - ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); - ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); + window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0); + window_SpeakInHouse->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); + window_SpeakInHouse->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); + window_SpeakInHouse->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); + window_SpeakInHouse->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); } bGameoverLoop = 0; }
--- a/mm7_1.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/mm7_1.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -5194,7 +5194,7 @@ uLastPointedObjectID = pMouse->uPointingObjectID; return; } - pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 4); + pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); //LABEL_49: v17 = pItemGen->GetDisplayName(); sub_41C0B8_set_status_string(v17); @@ -5789,7 +5789,7 @@ uActiveCharacter = uPlayerID; return; } - if ( ptr_507BC0->field_40 == 1 ) + if ( window_SpeakInHouse->field_40 == 1 ) return; viewparams->bRedrawGameUI = true; if ( uActiveCharacter != uPlayerID )
--- a/mm7_2.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/mm7_2.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -64,7 +64,7 @@ int v3; // eax@1 GUIWindow v5; // [sp+8h] [bp-54h]@1 - memcpy(&v5, ptr_507BC0, sizeof(v5)); + memcpy(&v5, window_SpeakInHouse, sizeof(v5)); v0 = pGlobalTXT_LocalizationStrings[672]; v1 = pGlobalTXT_LocalizationStrings[672]; v5.uFrameX = 483; @@ -140,7 +140,7 @@ int v31; // [sp+114h] [bp-8h]@29 GUIFont *pOutString; // [sp+118h] [bp-4h]@21 - memcpy(&_this, ptr_507BC0, sizeof(_this)); + memcpy(&_this, window_SpeakInHouse, sizeof(_this)); _this.uFrameX = 483; _this.uFrameWidth = 148; _this.uFrameZ = 334; @@ -204,8 +204,8 @@ { if ( dword_F8B19C != 100 ) return; - v0 = ptr_507BC0; - if ( ptr_507BC0->field_40 == 1 ) + v0 = window_SpeakInHouse; + if ( window_SpeakInHouse->field_40 == 1 ) { sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u); @@ -215,7 +215,7 @@ _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3); return; } - if ( ptr_507BC0->field_40 == 2 ) + if ( window_SpeakInHouse->field_40 == 2 ) { v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); v2 = v1; @@ -233,7 +233,7 @@ } if ( v1 > pParty->uNumGold ) { - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); v2 = pParty->uNumGold; } if ( v2 > pParty->uFine ) @@ -244,11 +244,11 @@ pParty->uFine = 0; if ( uActiveCharacter ) pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0); - v0 = ptr_507BC0; + v0 = window_SpeakInHouse; } else { - if ( ptr_507BC0->field_40 != 3 ) + if ( window_SpeakInHouse->field_40 != 3 ) return; } v0->field_40 = 0; @@ -305,7 +305,7 @@ __int16 v13[2]; // [sp+60h] [bp-8h]@1 __int16 v14[2]; // [sp+64h] [bp-4h]@1 - memcpy(&_this, ptr_507BC0, sizeof(_this)); + memcpy(&_this, window_SpeakInHouse, sizeof(_this)); _this.uFrameX = 483; _this.uFrameWidth = 148; _this.uFrameZ = 334; @@ -317,11 +317,11 @@ { if ( dword_F8B19C == 7 ) { - v0 = ptr_507BC0; - if ( ptr_507BC0->field_40 != 1 ) - { - v1 = ptr_507BC0->field_40 - 2; - if ( ptr_507BC0->field_40 == 2 ) + v0 = window_SpeakInHouse; + if ( window_SpeakInHouse->field_40 != 1 ) + { + v1 = window_SpeakInHouse->field_40 - 2; + if ( window_SpeakInHouse->field_40 == 2 ) { v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); v7 = v6; @@ -339,7 +339,7 @@ } if ( v6 > pParty->uNumGold ) { - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); v7 = pParty->uNumGold; } if ( v7 ) @@ -349,7 +349,7 @@ if ( uActiveCharacter ) pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0); } - v0 = ptr_507BC0; + v0 = window_SpeakInHouse; LABEL_16: v0->field_40 = 0; goto LABEL_17; @@ -366,20 +366,20 @@ { if ( dword_F8B19C != 8 ) return; - v0 = ptr_507BC0; - if ( ptr_507BC0->field_40 != 1 ) - { - v1 = ptr_507BC0->field_40 - 2; - if ( ptr_507BC0->field_40 == 2 ) - { - ptr_507BC0->field_40 = 0; + v0 = window_SpeakInHouse; + if ( window_SpeakInHouse->field_40 != 1 ) + { + v1 = window_SpeakInHouse->field_40 - 2; + if ( window_SpeakInHouse->field_40 == 2 ) + { + window_SpeakInHouse->field_40 = 0; v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); v3 = v2; if ( v2 ) { if ( v2 > pParty->uNumGoldInBank ) { - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); v3 = pParty->uNumGoldInBank; } if ( v3 ) @@ -510,8 +510,8 @@ unsigned __int8 v90; // [sp+26Fh] [bp-5h]@55 GUIFont *pOutString; // [sp+270h] [bp-4h]@3 - v0 = ptr_507BC0; - memcpy(&v79, ptr_507BC0, sizeof(v79)); + v0 = window_SpeakInHouse; + memcpy(&v79, window_SpeakInHouse, sizeof(v79)); v85 = pPlayers[uActiveCharacter]; v1 = v85; v79.uFrameX = 483; @@ -597,7 +597,7 @@ v66 = (174 - pFontArrus->CalcTextHeight(v26, &v79, 0, 0)) / 2 + 138; goto LABEL_98; } - strcpy(pTmpBuf, pNPCTopics[(uint)ptr_507BC0->ptr_1C + 247].pText); + strcpy(pTmpBuf, pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText); v78.uFrameWidth = 460; v78.uFrameZ = 452; v61 = pFontArrus->CalcTextHeight(pTmpBuf, &v78, 12, 0); @@ -617,7 +617,7 @@ v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &v78, 0xCu, 0); v64 = pFontArrus; } - ptr_507BC0->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73); + window_SpeakInHouse->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73); return; } if ( dword_F8B19C != 101 ) @@ -629,15 +629,15 @@ if ( pParty->uNumGold >= (unsigned int)pOutString ) { Party::TakeGold((unsigned int)pOutString); - v27 = (int)ptr_507BC0->ptr_1C; - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); + v27 = (int)window_SpeakInHouse->ptr_1C; + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); dword_F8B19C = 0; while ( sub_4BD8B5() ) ; sub_4B1D27(); pVideoPlayer->Unload(); - ptr_507BC0->Release(); - ptr_507BC0 = 0; + window_SpeakInHouse->Release(); + window_SpeakInHouse = 0; if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; pMessageQueue_50CBD0->pMessages[0].eType = (UIMessageType)409; @@ -658,7 +658,7 @@ *(float *)&v89 = 0.0; //v9 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); - v9 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0); + v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); pOutString = (GUIFont *)(v9 * (100 - v85->GetMerchant()) / 100); if ( (signed int)pOutString < v9 / 3 ) @@ -739,7 +739,7 @@ } *(_QWORD *)Str = pParty->uNumFoodRations; //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] ) - if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier ) + if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier ) { ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2u); if ( uActiveCharacter ) @@ -750,8 +750,8 @@ { Party::TakeGold(v7); //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; - pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier; - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 3); + pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3); v5 = 1; LABEL_43: if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) @@ -763,7 +763,7 @@ } } ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 4); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 4); goto LABEL_43; } if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) @@ -783,7 +783,7 @@ sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[86], //(signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C], - (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier, + (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, v83); strcat(&a1, pTmpBuf2); v88 = pFontArrus->CalcTextHeight(&a1, &v79, 0, 0); @@ -797,7 +797,7 @@ strcat(&v77, "\n \n"); v75 = 0; v87 = 0; - v31 = (signed int)ptr_507BC0->ptr_1C; + v31 = (signed int)window_SpeakInHouse->ptr_1C; if ( v31 >= 108 && v31 <= 120 ) { v32 = *(int *)v84; @@ -939,11 +939,11 @@ void *result; // eax@15 signed int v9; // [sp-Ch] [bp-14h]@7 - v0 = ptr_507BC0; + v0 = window_SpeakInHouse; v1 = 0; - v2 = (signed int)ptr_507BC0->ptr_1C; + v2 = (signed int)window_SpeakInHouse->ptr_1C; //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] ) - if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType] ) + if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] ) { while ( v2 > 14 ) { @@ -974,14 +974,14 @@ v5 = v9; LABEL_13: pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]); - v0 = ptr_507BC0; - pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 5] = 1; + v0 = window_SpeakInHouse; + pParty->field_777C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 5] = 1; goto LABEL_14; } auto _t = (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]; _t->Reset(); - v0 = ptr_507BC0; - pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] = 220; + v0 = window_SpeakInHouse; + pParty->field_777C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] = 220; } LABEL_14: v2 = (signed int)v0->ptr_1C; @@ -1121,7 +1121,7 @@ v0 = pPlayers[uActiveCharacter]; _this = pPlayers[uActiveCharacter]; - memcpy(&v101, ptr_507BC0, sizeof(v101)); + memcpy(&v101, window_SpeakInHouse, sizeof(v101)); v101.uFrameX = 483; v101.uFrameWidth = 148; v101.uFrameZ = 334; @@ -1191,7 +1191,7 @@ { v30 = pDialogueWindow; v3 = 0; - v31 = ptr_507BC0->ptr_1C; + v31 = window_SpeakInHouse->ptr_1C; v106.y = 0; //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0); v32 = (signed __int64)(p2DEvents[(signed int)v31 - 1].flt_24 * 500.0); @@ -1309,9 +1309,9 @@ { v85 = 0; v83 = 5; - v81 = ptr_507BC0->ptr_1C; + v81 = window_SpeakInHouse->ptr_1C; v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5]; - v28 = (int)ptr_507BC0->ptr_1C; + v28 = (int)window_SpeakInHouse->ptr_1C; v110 = uActiveCharacter - 1; v29 = _this->_490EEE( (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5], @@ -1407,9 +1407,9 @@ { v85 = 0; v83 = 3; - v81 = ptr_507BC0->ptr_1C; + v81 = window_SpeakInHouse->ptr_1C; v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; - v12 = (int)ptr_507BC0->ptr_1C; + v12 = (int)window_SpeakInHouse->ptr_1C; v110 = uActiveCharacter - 1; v13 = _this->_490EEE(v79, 1, v12, 3); v6 = v110; @@ -1448,16 +1448,16 @@ v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; if (!v4->Identified()) { - v81 = ptr_507BC0->ptr_1C; + v81 = window_SpeakInHouse->ptr_1C; v79 = v4; - v9 = (int)ptr_507BC0->ptr_1C; + v9 = (int)window_SpeakInHouse->ptr_1C; v110 = uActiveCharacter - 1; v10 = _this->_490EEE(v4, 1, v9, 4); v6 = v110; v5 = (char *)pMerchantsIdentifyPhrases[v10]; goto LABEL_14; } - v81 = ptr_507BC0->ptr_1C; + v81 = window_SpeakInHouse->ptr_1C; v5 = "%24"; v79 = v4; LABEL_13: @@ -1491,7 +1491,7 @@ v109 = 0; do { - if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)ptr_507BC0->ptr_1C]] ) + if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] ) { v49 = word_F8B158[(signed int)v48]; v50 = dword_F8B168[(signed int)v48]; @@ -1516,7 +1516,7 @@ v108 = 0; do { - if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)ptr_507BC0->ptr_1C] + 724] ) + if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] ) { v52 = word_F8B158[(signed int)v109] + 30; v53 = dword_F8B168[(signed int)v109]; @@ -1542,7 +1542,7 @@ v106.x = 0; do { - if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) + if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) ++v106.x; ++v55; } @@ -1552,7 +1552,7 @@ { do { - if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) + if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) ++v106.x; ++v55; } @@ -1580,7 +1580,7 @@ { v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; v106.x = v60; - v61 = (int)ptr_507BC0->ptr_1C; + v61 = (int)window_SpeakInHouse->ptr_1C; v62 = 9 * (v60 + 12 * v61); v63 = (ItemGen *)&pParty->field_777C[v62]; if ( dword_F8B19C != 2 ) @@ -1589,7 +1589,7 @@ { v85 = 0; v83 = 2; - v81 = ptr_507BC0->ptr_1C; + v81 = window_SpeakInHouse->ptr_1C; v79 = v63; v110 = uActiveCharacter - 1; v64 = _this->_490EEE(v63, 1, v61, 2); @@ -1600,7 +1600,7 @@ v5 = pGlobalTXT_LocalizationStrings[181]; v85 = 0; v83 = 2; - v81 = ptr_507BC0->ptr_1C; + v81 = window_SpeakInHouse->ptr_1C; v79 = v63; goto LABEL_13; } @@ -1609,8 +1609,8 @@ { result = v101._4B1854( __PAIR__( - pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1], - pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C]) + pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1], + pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) - pParty->uTimePlayed); } } @@ -1739,7 +1739,7 @@ v0 = pPlayers[uActiveCharacter]; _this = pPlayers[uActiveCharacter]; - memcpy(&v104, ptr_507BC0, sizeof(v104)); + memcpy(&v104, window_SpeakInHouse, sizeof(v104)); v104.uFrameX = 483; v104.uFrameWidth = 148; v104.uFrameZ = 334; @@ -1819,9 +1819,9 @@ return result; v93 = 0; v91 = 3; - v89 = ptr_507BC0->ptr_1C; + v89 = window_SpeakInHouse->ptr_1C; v87 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; - v44 = (int)ptr_507BC0->ptr_1C; + v44 = (int)window_SpeakInHouse->ptr_1C; v113 = uActiveCharacter - 1; v45 = _this->_490EEE(v87, 4, v44, 3); v39 = v113; @@ -1847,16 +1847,16 @@ v37 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; if (!v37->Identified()) { - v89 = ptr_507BC0->ptr_1C; + v89 = window_SpeakInHouse->ptr_1C; v87 = v37; - v41 = (int)ptr_507BC0->ptr_1C; + v41 = (int)window_SpeakInHouse->ptr_1C; v113 = uActiveCharacter - 1; v42 = _this->_490EEE(v37, 4, v41, 4); v39 = v113; v38 = (char *)pMerchantsIdentifyPhrases[v42]; goto LABEL_45; } - v89 = ptr_507BC0->ptr_1C; + v89 = window_SpeakInHouse->ptr_1C; v38 = "%24"; v87 = v37; LABEL_44: @@ -1931,7 +1931,7 @@ return result; v2 = pDialogueWindow; v3 = 0; - v4 = ptr_507BC0->ptr_1C; + v4 = window_SpeakInHouse->ptr_1C; v112 = 0; //v5 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v4] * 500.0); v5 = (signed __int64)(p2DEvents[(signed int)v4 - 1].flt_24 * 500.0); @@ -2029,7 +2029,7 @@ { do { - if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) + if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) { v46 = dword_F8B168[v114]; v47 = 152 - v46->uTextureHeight; @@ -2059,7 +2059,7 @@ v114 = 0; do { - if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 54] ) + if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] ) { v50 = dword_F8B168[v114 + 6]; v51 = 308 - v50->uTextureHeight; @@ -2091,7 +2091,7 @@ { do { - if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) + if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) { v54 = dword_F8B168[v114]; v55 = 152 - v54->uTextureHeight; @@ -2121,7 +2121,7 @@ v114 = 0; do { - if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 778] ) + if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) { v58 = dword_F8B168[v114 + 6]; v59 = 308 - v58->uTextureHeight; @@ -2158,7 +2158,7 @@ { do { - if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) + if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) ++v109; ++v62; } @@ -2168,7 +2168,7 @@ { do { - if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) + if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) ++v109; ++v62; } @@ -2191,8 +2191,8 @@ if ( !v109 ) return (POINT *)v104._4B1854( __PAIR__( - pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1], - pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C]) + pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1], + pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) - pParty->uTimePlayed); v66 = pMouse->GetCursorPos(&v98); result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]); @@ -2200,7 +2200,7 @@ { v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; v109 = v67; - v68 = (int)ptr_507BC0->ptr_1C; + v68 = (int)window_SpeakInHouse->ptr_1C; v69 = 9 * (v67 + 12 * v68); v70 = (ItemGen *)&pParty->field_777C[v69]; if ( dword_F8B19C != 2 ) @@ -2209,7 +2209,7 @@ { v93 = 0; v91 = 2; - v89 = ptr_507BC0->ptr_1C; + v89 = window_SpeakInHouse->ptr_1C; v87 = v70; v113 = uActiveCharacter - 1; v71 = _this->_490EEE(v70, 4, v68, 2); @@ -2220,7 +2220,7 @@ v38 = pGlobalTXT_LocalizationStrings[181]; v93 = 0; v91 = 2; - v89 = ptr_507BC0->ptr_1C; + v89 = window_SpeakInHouse->ptr_1C; v87 = v70; goto LABEL_44; } @@ -2390,7 +2390,7 @@ v0 = pPlayers[uActiveCharacter]; _this = pPlayers[uActiveCharacter]; - memcpy(&v144, ptr_507BC0, sizeof(v144)); + memcpy(&v144, window_SpeakInHouse, sizeof(v144)); v144.uFrameX = 483; v144.uFrameWidth = 148; v144.uFrameZ = 334; @@ -2408,7 +2408,7 @@ v93 = 0; do { - if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) + if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) ++v149; ++v93; } @@ -2421,13 +2421,13 @@ if ( v149 && v149 != -65536 ) { --v149; - v96 = ptr_507BC0->ptr_1C; + v96 = window_SpeakInHouse->ptr_1C; v97 = uActiveCharacter - 1; v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724]; v99 = _this->_490EEE( (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724], 2, - (int)ptr_507BC0->ptr_1C, + (int)window_SpeakInHouse->ptr_1C, 2); v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0); v101 = v100; @@ -2439,7 +2439,7 @@ v153 = 0; do { - if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) + if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) { v105 = dword_F8B168[v104]; if ( v104 >= 4 ) @@ -2467,7 +2467,7 @@ while ( v104 < 8 ); return; } - v72 = ptr_507BC0->ptr_1C; + v72 = window_SpeakInHouse->ptr_1C; goto LABEL_96; } if ( dword_F8B19C == 94 ) @@ -2528,7 +2528,7 @@ v152 = 0; v37 = pDialogueWindow; //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); - v38 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0); + v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100); if ( (signed int)_this < v38 / 3 ) _this = (Player *)(v38 / 3); @@ -2626,7 +2626,7 @@ v153 = 0; do { - if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) + if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) { v56 = dword_F8B168[v55]; if ( v55 >= 4 ) @@ -2660,7 +2660,7 @@ v153 = 0; do { - if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 ) + if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 ) { v62 = dword_F8B168[v61]; if ( v61 >= 4 ) @@ -2696,7 +2696,7 @@ { do { - if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] != v11 ) + if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 ) ++v149; ++v68; } @@ -2706,7 +2706,7 @@ { do { - if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 ) + if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 ) ++v149; ++v68; } @@ -2733,7 +2733,7 @@ if ( !v74 ) return; v149 = v74 - 1; - v75 = (int)ptr_507BC0->ptr_1C; + v75 = (int)window_SpeakInHouse->ptr_1C; v76 = 9 * (v74 - 1 + 12 * v75); if ( dword_F8B19C == 2 ) v77 = (ItemGen *)&pParty->field_777C[v76]; @@ -2743,7 +2743,7 @@ { v124 = (__int64 *)v11; v122 = 2; - v120 = ptr_507BC0->ptr_1C; + v120 = window_SpeakInHouse->ptr_1C; v116 = v77; v78 = uActiveCharacter - 1; v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)]; @@ -2753,7 +2753,7 @@ { v124 = (__int64 *)v11; v122 = 2; - v120 = ptr_507BC0->ptr_1C; + v120 = window_SpeakInHouse->ptr_1C; v116 = v77; v15 = pGlobalTXT_LocalizationStrings[181]; v14 = uActiveCharacter - 1; @@ -2768,7 +2768,7 @@ v111 = &v144; goto LABEL_63; } - v72 = ptr_507BC0->ptr_1C; + v72 = window_SpeakInHouse->ptr_1C; LABEL_96: v144._4B1854( __PAIR__(pParty->field_3C.field_50[2 * (int)v72 + 1], pParty->field_3C.field_50[2 * (int)v72]) @@ -2790,9 +2790,9 @@ return; v124 = 0; v122 = 5; - v120 = ptr_507BC0->ptr_1C; + v120 = window_SpeakInHouse->ptr_1C; v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5]; - v34 = (int)ptr_507BC0->ptr_1C; + v34 = (int)window_SpeakInHouse->ptr_1C; uPlayerID = uActiveCharacter - 1; v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5); v14 = uPlayerID; @@ -2868,9 +2868,9 @@ return; v124 = 0; v122 = 3; - v120 = ptr_507BC0->ptr_1C; + v120 = window_SpeakInHouse->ptr_1C; v116 = (ItemGen *)&v0->pInventoryItems[v10-1]; - v12 = (int)ptr_507BC0->ptr_1C; + v12 = (int)window_SpeakInHouse->ptr_1C; uPlayerID = uActiveCharacter - 1; v13 = v0->_490EEE(v116, 2, v12, 3); v14 = uPlayerID; @@ -2896,16 +2896,16 @@ v3 = (ItemGen *)&v0->pInventoryItems[v2-1]; if (v3->Identified()) { - v118 = ptr_507BC0->ptr_1C; + v118 = window_SpeakInHouse->ptr_1C; v4 = uActiveCharacter - 1; v5 = "%24"; v114 = v3; } else { - v118 = ptr_507BC0->ptr_1C; + v118 = window_SpeakInHouse->ptr_1C; v114 = v3; - v7 = (int)ptr_507BC0->ptr_1C; + v7 = (int)window_SpeakInHouse->ptr_1C; uPlayerID = uActiveCharacter - 1; v8 = v0->_490EEE(v3, 2, v7, 4); v4 = uPlayerID; @@ -3166,7 +3166,7 @@ pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, 0, 0x53u, 0, "", 0); pDialogueWindow->_41D08F(1, 1, 0, 2); dword_F8B19C = -1; - v0 = (int)((char *)ptr_507BC0->ptr_1C - 102); + v0 = (int)((char *)window_SpeakInHouse->ptr_1C - 102); if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v0 + 1], pParty->field_3C.field_0[2 * v0]) < (signed __int64)pParty->uTimePlayed ) { pParty->field_75A[v0] = 0; @@ -3623,19 +3623,19 @@ int v7; // [sp+10h] [bp-4h]@0 v0 = v7; - v1 = (char *)ptr_507BC0->ptr_1C - 139; + v1 = (char *)window_SpeakInHouse->ptr_1C - 139; v2 = 0; do { //v3 = p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]; - v3 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType; + v3 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType; if ( v3 < 5 ) goto LABEL_12; if ( v3 <= 13 ) { v0 = rand() % word_4F0F30[(signed int)v1] //+ 11 * p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C] - + 11 * p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType + + 11 * p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType + 345; } else @@ -3665,9 +3665,9 @@ if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) ) v0 = 486; } - v5 = ptr_507BC0; - - auto _u = (ItemGen *)&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + v2 + 12 * (unsigned int)ptr_507BC0->ptr_1C; + v5 = window_SpeakInHouse; + + auto _u = (ItemGen *)&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + v2 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C; _u->Reset(); *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v2 + 12 * (unsigned int)v5->ptr_1C)) = v0; *(&pParty->pPlayers[1].pInstalledBeacons[1].field_10 + 9 * (v2++ + 12 * (unsigned int)v5->ptr_1C)) = 1; @@ -3783,16 +3783,16 @@ v4 += v5++ + 1; while ( v5 < v7 ); } - if ( v7 < (unsigned __int16)word_4F0866[(unsigned int)ptr_507BC0->ptr_1C] + if ( v7 < (unsigned __int16)word_4F0866[(unsigned int)window_SpeakInHouse->ptr_1C] && (signed __int64)v6->uExperience < 1000 * v4 ) return; } goto LABEL_9; } - v8 = ptr_507BC0; + v8 = window_SpeakInHouse; if ( (dword_F8B198 == 27 || dword_F8B198 == 28) && (v1 = 0, - *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + v2)] + *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + v2)] + pParty->uDaysPlayed % 7)) || dword_F8B198 != 23 || v55 != 10 ) @@ -3816,7 +3816,7 @@ pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, v1, 0x51u, v1, v1, "", (Texture *)v1); LABEL_10: v3 = dword_F8B198; - v8 = ptr_507BC0; + v8 = window_SpeakInHouse; goto LABEL_11; } if ( uActiveCharacter != v1 ) @@ -3833,7 +3833,7 @@ v3 = dword_F8B198; dword_F8B164 = &pIcons_LOD->pTextures[v9]; LABEL_13: - v8 = ptr_507BC0; + v8 = window_SpeakInHouse; } if ( v3 > 21 ) { @@ -3869,7 +3869,7 @@ v34 = pIcons_LOD->LoadTexture( pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE); - v8 = ptr_507BC0; + v8 = window_SpeakInHouse; dword_F8B168[v32] = &pIcons_LOD->pTextures[v34]; } ++v32; @@ -3879,11 +3879,11 @@ else { sub_4BC8D5(); - v30 = ptr_507BC0->ptr_1C; + v30 = window_SpeakInHouse->ptr_1C; v31 = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C]) - * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C) + * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335); *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31; *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31); @@ -3910,7 +3910,7 @@ * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335); v14 = rand() % 258; - v15 = ptr_507BC0; + v15 = window_SpeakInHouse; pParty->field_750[v12] = v14 + 1; v16 = (int)((char *)v15->ptr_1C - 102); if ( v16 ) @@ -4181,7 +4181,7 @@ v39 = 4; else v39 = 2; - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v39); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v39); } else { @@ -4217,12 +4217,12 @@ { GenerateShopItems(); sub_4B8F94(); - v8 = ptr_507BC0; - v40 = ptr_507BC0->ptr_1C; + v8 = window_SpeakInHouse; + v40 = window_SpeakInHouse->ptr_1C; v3 = dword_F8B198; v41 = pParty->uTimePlayed //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C]) - + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C) + + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335); pParty->field_3C.field_50[2 * (int)v40] = v41; pParty->field_3C.field_50[2 * (int)v40 + 1] = HIDWORD(v41); @@ -4242,7 +4242,7 @@ { v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE); v3 = dword_F8B198; - v8 = ptr_507BC0; + v8 = window_SpeakInHouse; dword_F8B168[v43] = &pIcons_LOD->pTextures[v46]; } v42 = v8->ptr_1C; @@ -4263,7 +4263,7 @@ if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] ) { v49 = rand(); - v8 = ptr_507BC0; + v8 = window_SpeakInHouse; word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight); } v47 = v8->ptr_1C; @@ -4285,7 +4285,7 @@ { v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE); v3 = dword_F8B198; - v8 = ptr_507BC0; + v8 = window_SpeakInHouse; dword_F8B168[v43] = &pIcons_LOD->pTextures[v51]; } v42 = v8->ptr_1C; @@ -4306,7 +4306,7 @@ if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] ) { v54 = rand(); - v8 = ptr_507BC0; + v8 = window_SpeakInHouse; word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight); } v52 = v8->ptr_1C; @@ -4394,13 +4394,13 @@ if ( uNumDialogueNPCPortraits != 1 ) { v2 = 0; - pBtn_ExitCancel = ptr_507BC0->pControlsHead; + pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; if ( uNumDialogueNPCPortraits > 0 ) { v3 = byte_591180; do { - array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton(*(&pNPCPortraits_x + v2 + 6 * v1 - 6), *(&pNPCPortraits_y + v2 + 6 * v1 - 6), + array_5913D8[v2 + 7] = (NPCData *)window_SpeakInHouse->CreateButton(*(&pNPCPortraits_x + v2 + 6 * v1 - 6), *(&pNPCPortraits_y + v2 + 6 * v1 - 6), 0x3Fu, 0x49u, 1, 0, 0x19Au, v2, 0, v3, 0, 0, 0); v1 = uNumDialogueNPCPortraits; ++v2; @@ -4527,7 +4527,7 @@ { v42 = dword_F8B19C - 36; //v43 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); - v43 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0); + v43 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); v44 = v43 * (100 - v0->GetMerchant()) / 100; if ( v44 < v43 / 3 ) v44 = v43 / 3; @@ -4539,7 +4539,7 @@ if ( pParty->uNumGold < v44 ) { ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold" - v13 = ptr_507BC0->ptr_1C; + v13 = window_SpeakInHouse->ptr_1C; if ( dword_F8B198 == 30 ) v55 = 4; else @@ -4573,7 +4573,7 @@ v18 = pRenderer->pActiveZBuffer[v17->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v61)->y]] & 0xFFFF; if ( !v18 ) return; - v19 = ptr_507BC0->ptr_1C; + v19 = window_SpeakInHouse->ptr_1C; v20 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)v19)); //v21 = p2DEvents_minus1__20[13 * (signed int)v19]; v21 = p2DEvents[(signed int)v19 - 1].fPriceMultiplier; @@ -4586,7 +4586,7 @@ { v24 = 2; LABEL_62: - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v24); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v24); v9 = pGlobalTXT_LocalizationStrings[155]; v54 = 2; goto LABEL_71; @@ -4612,7 +4612,7 @@ v29 = pRenderer->pActiveZBuffer[v28->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v57)->y]] & 0xFFFF; if ( !v29 ) return; - v30 = ptr_507BC0->ptr_1C; + v30 = window_SpeakInHouse->ptr_1C; v31 = 9 * (v29 - 1 + 12 * (int)v30); if ( dword_F8B19C == 2 ) { @@ -4646,7 +4646,7 @@ uNumSeconds = v0->StealFromShop(v32, a3, v38, 0, &a6); if ( !uNumSeconds ) { - sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, 0, a6); + sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, 0, a6); return; } } @@ -4675,7 +4675,7 @@ if ( uNumSeconds == 1 || uNumSeconds == 2 ) { *(char *)(v40 + 517) |= 1u; - sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, v41, a6); + sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, v41, a6); goto LABEL_43; } } @@ -4706,8 +4706,8 @@ || pMouse->GetCursorPos(&v65)->x >= 462 || (v15 = v0->GetItemIDAtInventoryIndex((int *)&v79), (v77 = (Player *)v15) == 0) ) return; - v16 = ptr_507BC0; - if ( sub_4BDAAF((ItemGen *)&v0->pInventoryItems[v15-1], (int)ptr_507BC0->ptr_1C) ) + v16 = window_SpeakInHouse; + if ( sub_4BDAAF((ItemGen *)&v0->pInventoryItems[v15-1], (int)window_SpeakInHouse->ptr_1C) ) { dword_F8B1E4 = 1; v0->_4BE2DD(v79, (int)((char *)v77 - 1), (int)v16->ptr_1C); @@ -4741,11 +4741,11 @@ if ( v11 ) { //v80 = v0->_4B8179(p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]); - v80 = v0->_4B8179(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier); + v80 = v0->_4B8179(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier); v12 = (int)&v0->pInventoryItems[v11-1]; if ( !(*(char *)(v12 + 20) & 1) ) { - _this = (ItemGen *)ptr_507BC0->ptr_1C; + _this = (ItemGen *)window_SpeakInHouse->ptr_1C; if ( sub_4BDAAF((ItemGen *)v12, (int)_this) ) { if ( pParty->uNumGold >= v80 ) @@ -4786,7 +4786,7 @@ { v3 = (int)&v0->pInventoryItems[v2-1]; //v4 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; - v4 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier; + v4 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; auto _v = (ItemGen *)&v0->pInventoryItems[v2-1]; v5 = _v->GetValue(); @@ -4796,7 +4796,7 @@ v80 = v6; if ( !v7 ) { - _this = (ItemGen *)ptr_507BC0->ptr_1C; + _this = (ItemGen *)window_SpeakInHouse->ptr_1C; if ( sub_4BDAAF((ItemGen *)v3, (int)_this) ) { if ( pParty->uNumGold >= v80 ) @@ -5099,7 +5099,7 @@ pRenderer->EndScene(); free(_this.pPixels); _this.pPixels = 0; - ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); + window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); pWindow.uFrameX = 75; pWindow.uFrameY = 60; pWindow.uFrameWidth = 469; @@ -5175,8 +5175,8 @@ pRenderer->pBeforePresentFunction(); pRenderer->_49F1BC("MM7_Win.Pcx"); pAllocator->FreeChunk(pFont); - ptr_507BC0->Release(); - ptr_507BC0 = 0; + window_SpeakInHouse->Release(); + window_SpeakInHouse = 0; if ( v15 == (void *)2 ) { result = pMessageQueue_50CBD0->uNumMessages; @@ -11975,7 +11975,7 @@ { if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) { - v12 = ptr_507BC0 == 0; + v12 = window_SpeakInHouse == 0; pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = !v12; *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
--- a/mm7_3.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/mm7_3.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -14170,7 +14170,7 @@ max_string_length = 0; string_num = 1; prev_string_offset = 0; - + pLevelStrOffsets[0]=0; for (uint i = 0; i < uLevelStrFileSize; ++i) { if ( !pLevelStr[i] ) @@ -14192,7 +14192,7 @@ if ( uLevelStrNumStrings > 0 ) { - for(uint i = 1; i <uLevelStrNumStrings ; ++i) + for(uint i = 0; i <uLevelStrNumStrings ; ++i) { if ( RemoveQuotes(&pLevelStr[pLevelStrOffsets[i]]) != &pLevelStr[pLevelStrOffsets[i]] ) ++pLevelStrOffsets[i]; @@ -14204,27 +14204,19 @@ //----- (00443F95) -------------------------------------------------------- void __cdecl OnMapLeave() { - signed int v0; // edi@1 - char *v1; // esi@2 - int v2; // ecx@4 - - v0 = 0; - if ( (signed int)uLevelEVT_NumEvents > 0 ) - { - v1 = (char *)&pLevelEVT_Index[0].event_sequence_num; - do - { - if ( pLevelEVT[*((short *)v1 + 2) + 4] == 53 ) - { - v2 = *((int *)v1 - 1); - dword_597F18 = *(int *)v1; - EventProcessor(v2, 0, 1); - dword_597F18 = 0; - } - ++v0; - v1 += 12; - } - while ( v0 < (signed int)uLevelEVT_NumEvents ); + _evt_raw *test_event; + if ( uLevelEVT_NumEvents > 0 ) + { + for (uint i = 0; i < uLevelEVT_NumEvents; ++i) + { + test_event=(_evt_raw*)&pLevelEVT[pLevelEVT_Index[i].uEventOffsetInEVT]; + if ( test_event->_e_type== EVENT_OnMapLeave ) + { + start_event_seq_number = pLevelEVT_Index[i].event_sequence_num; + EventProcessor(pLevelEVT_Index[i].uEventID, 0, 1); + start_event_seq_number = 0; + } + } } } @@ -14276,38 +14268,34 @@ } else if (_evt->_e_type == EVENT_OnMapReload) { - dword_597F18 = pEvent.event_sequence_num; + start_event_seq_number = pEvent.event_sequence_num; EventProcessor(pEvent.uEventID, 0, 0); - dword_597F18 = 0; + start_event_seq_number = 0; } else if (_evt->_e_type == EVENT_OnTimer || _evt->_e_type == EVENT_OnLongTimer) { - v3 = &array_5B5928[dword_5B65C8]; + v3 = &array_5B5928_timers[dword_5B65C8_timers_count]; v20 = pOutdoor->uLastVisitDay; if (uCurrentlyLoadedLevelType == LEVEL_Indoor) v20 = pIndoor->stru1.uLastVisitDay; - v4 = _evt->_e_type; - v3->field_1C = v4; - v3->field_8 = pEvent.uEventID; - v3->field_A = pEvent.event_sequence_num; - v33 = _evt->v6; - v3->field_12 = v33; - v32 = _evt->v7; - v3->field_14 = v32; - v31 = _evt->v8; - v3->field_16 = v31; - v5 = _evt->v5; - v30 = _evt->v9; - v3->field_18 = v30; - v29 = _evt->v10; - v3->field_1A = v29; + v3->timer_evt_type = _evt->_e_type; + v3->timer_evt_ID = pEvent.uEventID; + v3->timer_evt_seq_num = pEvent.event_sequence_num; + + v3->field_10 = _evt->v5; + v3->field_12 = _evt->v6; + v3->field_14 = _evt->v7; + v3->field_16 = _evt->v8; + v3->field_18 = _evt->v9; + v3->field_1A = _evt->v10; + v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11; - v3->field_10 = v5; - v3->field_C = v6; - v3->field_E = v6; - if ( v4 == 38 && !(short)v6 ) + + v3->field_C = ((unsigned short)_evt->v12 << 8) + _evt->v11; + v3->field_E = ((unsigned short)_evt->v12 << 8) + _evt->v11; + if (v3->timer_evt_type == EVENT_OnLongTimer && !(short)v6 ) { if ( v20 ) v18 = pParty->uTimePlayed - v20; @@ -14319,7 +14307,7 @@ { if ( v5 ) { - ++dword_5B65C8; + ++dword_5B65C8_timers_count; v3->field_0_time = 0; continue; } @@ -14328,12 +14316,13 @@ v26 / 7 != 0 && v32 != 0 || v26 != 0 || !v20) { - ++dword_5B65C8; + ++dword_5B65C8_timers_count; v3->field_0_time = 0; continue; } } - + else + { v8 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375); v9 = v8; v10 = (signed int)v8 / 60; @@ -14391,7 +14380,8 @@ + 0x24EA00 * (v28 + 12i64 * month)) << 7) * 0.033333335); - ++dword_5B65C8; + ++dword_5B65C8_timers_count; + } } } } @@ -14880,7 +14870,7 @@ { if ( pParty->uFlags & 2 ) pGame->Draw(); - if ( !dword_597F18 ) + if ( !start_event_seq_number ) pAudioPlayer->StopChannels(-1, -1); pMiscTimer->Pause(); pEventTimer->Pause(); @@ -14901,9 +14891,9 @@ pGUIWindow2->Release(); pGUIWindow2 = 0; _5C3420_pDecoration = _591094_decoration; - dword_597F18 = dword_5C341C; + start_event_seq_number = dword_5C341C; EventProcessor(dword_5C3418, 0, 1); - dword_597F18 = 0; + start_event_seq_number = 0; _5C3420_pDecoration = 0; pEventTimer->Resume(); } @@ -15709,7 +15699,7 @@ v13 = _this; if ( !_this ) return 0; - v3 = dword_597F18; + v3 = start_event_seq_number; pSomeOtherEVT = pGlobalEVT; uSomeOtherEVT_NumEvents = uGlobalEVT_NumEvents; memcpy(pSomeOtherEVT_Events, pGlobalEVT_Index, 0xCE40u); @@ -16200,9 +16190,9 @@ { _5773B8_event_timer = pParty->uTimePlayed; v12 = 0; - if ( dword_5B65C8 > 0 ) - { - v4 = (char *)&array_5B5928[0].field_C; + if ( dword_5B65C8_timers_count > 0 ) + { + v4 = (char *)&array_5B5928_timers[0].field_C; while ( 1 ) { v5 = *(short *)v4; @@ -16236,9 +16226,9 @@ *((int *)v4 - 2) = v3; } v11 = *((short *)v4 - 2); - dword_597F18 = *((short *)v4 - 1); + start_event_seq_number = *((short *)v4 - 1); EventProcessor(v11, 0, 1); - dword_597F18 = 0; + start_event_seq_number = 0; LABEL_25: v3 = HIDWORD(pParty->uTimePlayed); v2 = LODWORD(pParty->uTimePlayed); @@ -16246,7 +16236,7 @@ LABEL_26: ++v12; v4 += 32; - if ( v12 >= dword_5B65C8 ) + if ( v12 >= dword_5B65C8_timers_count ) return; v1 = 0; } @@ -16257,9 +16247,9 @@ } v6 = *((short *)v4 - 2); *(short *)v4 = *((short *)v4 + 1); - dword_597F18 = *((short *)v4 - 1); + start_event_seq_number = *((short *)v4 - 1); EventProcessor(v6, 0, 1); - dword_597F18 = v1; + start_event_seq_number = v1; goto LABEL_25; } }
--- a/mm7_4.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/mm7_4.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -9113,7 +9113,7 @@ v18 = v5; if ( !v5 ) return; - v6 = 9 * (v5 + 12 * (unsigned int)ptr_507BC0->ptr_1C); + v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C); v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4); if ( dword_F8B19C != 2 ) v7 = (ItemGen *)&pParty->field_C59C[v6 + 715]; @@ -9126,7 +9126,7 @@ v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; if ( v18 ) - sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)ptr_507BC0->ptr_1C)); + sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)); } } // F8B198: using guessed type int dword_F8B198; @@ -9198,12 +9198,12 @@ if ( dword_F8B198 != 23 ) return; } - v1 = (unsigned int)ptr_507BC0->ptr_1C; + v1 = (unsigned int)window_SpeakInHouse->ptr_1C; LABEL_28: HousePlaySomeSound(v1, v0); return; } - v1 = (unsigned int)ptr_507BC0->ptr_1C; + v1 = (unsigned int)window_SpeakInHouse->ptr_1C; if ( (signed __int64)__PAIR__(pParty->field_3C._shop_ban_times[2 * v1 + 1], pParty->field_3C._shop_ban_times[2 * v1]) <= (signed __int64)pParty->uTimePlayed ) { if ( pParty->uNumGold <= 0x2710 ) @@ -9649,7 +9649,7 @@ strcpy(v22, v24); pParty->field_709 = 0; sub_44A56A(); - PrepareHouse((unsigned int)ptr_507BC0->ptr_1C); + PrepareHouse((unsigned int)window_SpeakInHouse->ptr_1C); dword_F8B19C = 1; if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) { @@ -10444,7 +10444,7 @@ v19 = 1; do { - v20 = (char *)ptr_507BC0->ptr_1C + 4 * (unsigned int)ptr_507BC0->ptr_1C + v19; + v20 = (char *)window_SpeakInHouse->ptr_1C + 4 * (unsigned int)window_SpeakInHouse->ptr_1C + v19; if ( v1 ) v21 = word_4F063E[(signed int)v20]; else @@ -10524,7 +10524,7 @@ v12 = 1; do { - v13 = v11 + 2 * (unsigned int)ptr_507BC0->ptr_1C - 30; + v13 = v11 + 2 * (unsigned int)window_SpeakInHouse->ptr_1C - 30; v14 = v12 + 4 * v13 + v13; if ( v10 ) v15 = word_4F06D8[v14]; @@ -10924,7 +10924,7 @@ sub_4B36CC(1, 0x10u); v4 = 3; sub_4B36CC(2, 0x60u); - v5 = (signed int)ptr_507BC0->ptr_1C; + v5 = (signed int)window_SpeakInHouse->ptr_1C; if ( v5 < 108 || v5 > 120 ) goto LABEL_28; v4 = 4; @@ -11544,7 +11544,7 @@ int v73; // [sp+80h] [bp-4h]@14 v0 = pPlayers[uActiveCharacter]; - memcpy(&v65, ptr_507BC0, sizeof(v65)); + memcpy(&v65, window_SpeakInHouse, sizeof(v65)); v65.uFrameX = 483; v65.uFrameWidth = 148; v65.uFrameZ = 334; @@ -11558,7 +11558,7 @@ v3 += v4 + 1; v5 = 1000 * v3; v6 = HIDWORD(v0->uExperience); - v7 = ptr_507BC0->ptr_1C; + v7 = window_SpeakInHouse->ptr_1C; v68 = (unsigned __int16)word_4F0866[(signed int)v7]; v66 = 1000 * v3; if ( (signed __int64)__PAIR__(v6, LODWORD(v0->uExperience)) >= v66 ) @@ -11592,7 +11592,7 @@ i = 0; v13 = pDialogueWindow; //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); - v14 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0); + v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); v73 = v14 * (100 - v0->GetMerchant()) / 100; if ( v73 < v14 / 3 ) v73 = v14 / 3; @@ -11695,7 +11695,7 @@ if ( pParty->uNumGold >= i ) { Party::TakeGold(i); - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); ++v0->uLevel; v0->uSkillPoints += v0->uLevel / 10 + 5; v0->sHealth = v0->GetMaxHealth(); @@ -11714,7 +11714,7 @@ if ( *v39 > v37 ) { v40 = sub_494820(pParty->uCurrentHour); - v41 = ptr_507BC0->ptr_1C; + v41 = window_SpeakInHouse->ptr_1C; v42 = 60 * (v40 + 4) - pParty->uCurrentMinute; if ( v41 == (void *)94 || v41 == (void *)95 ) v42 += 720; @@ -11731,7 +11731,7 @@ ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold" v63 = 4; LABEL_55: - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v63); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v63); LABEL_56: result = pMessageQueue_50CBD0->uNumMessages; if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) @@ -11990,7 +11990,7 @@ v0 = pPlayers[uActiveCharacter]; _this = pPlayers[uActiveCharacter]; - memcpy(&v112, ptr_507BC0, sizeof(v112)); + memcpy(&v112, window_SpeakInHouse, sizeof(v112)); v112.uFrameX = 483; v112.uFrameWidth = 148; v112.uFrameZ = 334; @@ -12060,7 +12060,7 @@ { v31 = pDialogueWindow; v3 = 0; - v32 = ptr_507BC0->ptr_1C; + v32 = window_SpeakInHouse->ptr_1C; v118 = 0; //v33 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v32] * 500.0); v33 = (signed __int64)(p2DEvents[(signed int)v32 - 1].flt_24 * 500.0); @@ -12171,9 +12171,9 @@ return result; v96 = 0; v94 = 5; - v93 = ptr_507BC0->ptr_1C; + v93 = window_SpeakInHouse->ptr_1C; v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5]; - v28 = (int)ptr_507BC0->ptr_1C; + v28 = (int)window_SpeakInHouse->ptr_1C; uPlayerID = uActiveCharacter - 1; v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5); v9 = uPlayerID; @@ -12265,16 +12265,16 @@ v4 = (char *)&_this->pInventoryItems[result-1]; if ( v4[20] & 1 ) { - v5 = BuilDialogueString("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)ptr_507BC0->ptr_1C, 4, 0); + v5 = BuilDialogueString("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0); v97 = 3; v95 = v5; v92 = white; v6 = (212 - pFontArrus->CalcTextHeight(v5, &v112, 0, 0)) / 2 + 101; return (int)v112.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97); } - v93 = ptr_507BC0->ptr_1C; + v93 = window_SpeakInHouse->ptr_1C; v90 = (ItemGen *)v4; - v7 = (int)ptr_507BC0->ptr_1C; + v7 = (int)window_SpeakInHouse->ptr_1C; uPlayerID = uActiveCharacter - 1; v8 = ((Player *)_this)->_490EEE((ItemGen *)v4, 3, v7, 4); v9 = uPlayerID; @@ -12301,9 +12301,9 @@ return result; v96 = 0; v94 = 3; - v93 = ptr_507BC0->ptr_1C; + v93 = window_SpeakInHouse->ptr_1C; v90 = (ItemGen *)&_this->pInventoryItems[result-1]; - v12 = (int)ptr_507BC0->ptr_1C; + v12 = (int)window_SpeakInHouse->ptr_1C; uPlayerID = uActiveCharacter - 1; v13 = _this->_490EEE(v90, 3, v12, 3); v9 = uPlayerID; @@ -12329,7 +12329,7 @@ { do { - if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) + if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) { v50 = dword_F8B168[v49]; v51 = 152 - v50->uTextureHeight; @@ -12361,7 +12361,7 @@ v122 = 0; do { - if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 54] ) + if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] ) { v54 = dword_F8B168[v122 + 6]; v55 = 306 - v54->uTextureHeight; @@ -12391,7 +12391,7 @@ { do { - if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) + if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) { v58 = dword_F8B168[v49]; v59 = 152 - v58->uTextureHeight; @@ -12423,7 +12423,7 @@ v122 = 0; do { - if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 778] ) + if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) { v62 = dword_F8B168[v122 + 6]; v63 = 306 - v62->uTextureHeight; @@ -12460,7 +12460,7 @@ { do { - if ( pParty->field_777C[9 * (v66 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) + if ( pParty->field_777C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) ++v117; ++v66; } @@ -12470,7 +12470,7 @@ { do { - if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) + if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) ++v117; ++v66; } @@ -12493,8 +12493,8 @@ if ( !v117 ) return (int)v112._4B1854( __PAIR__( - pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1], - pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C]) + pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1], + pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) - pParty->uTimePlayed); v70 = pMouse->GetCursorPos(&v102); result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; @@ -12502,7 +12502,7 @@ { v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; v117 = v71; - v72 = (int)ptr_507BC0->ptr_1C; + v72 = (int)window_SpeakInHouse->ptr_1C; v73 = 9 * (v71 + 12 * v72); v74 = (ItemGen *)&pParty->field_777C[v73]; if ( dword_F8B19C != 2 ) @@ -12512,7 +12512,7 @@ v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" v96 = 0; v94 = 2; - v93 = ptr_507BC0->ptr_1C; + v93 = window_SpeakInHouse->ptr_1C; v90 = v74; v9 = uActiveCharacter - 1; } @@ -12520,7 +12520,7 @@ { v96 = 0; v94 = 2; - v93 = ptr_507BC0->ptr_1C; + v93 = window_SpeakInHouse->ptr_1C; v90 = v74; uPlayerID = uActiveCharacter - 1; v75 = _this->_490EEE(v74, 3, v72, 2); @@ -12927,8 +12927,8 @@ unsigned int v62; // [sp+2E4h] [bp-8h]@13 int v63; // [sp+2E8h] [bp-4h]@1 - v0 = ptr_507BC0; - memcpy(&v52, ptr_507BC0, sizeof(v52)); + v0 = window_SpeakInHouse; + memcpy(&v52, window_SpeakInHouse, sizeof(v52)); v58 = pPlayers[uActiveCharacter]; v1 = v58; v52.uFrameX = 483; @@ -12964,7 +12964,7 @@ if ( pParty->uNumGold < v63 ) { ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); } else { @@ -12991,7 +12991,7 @@ v63 = 32; do { - if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)ptr_507BC0->ptr_1C)) ) + if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) ) { pRenderer->DrawTextureTransparent(v63, 0x5Au, dword_F8B168[v6]); ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), dword_F8B168[v6], v6 + 1); @@ -13007,7 +13007,7 @@ v63 = 32; do { - if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)ptr_507BC0->ptr_1C)) ) + if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) ) { pRenderer->DrawTextureTransparent(v63, 0xFAu, dword_F8B168[v7]); ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), dword_F8B168[v7], v7 + 1); @@ -13023,7 +13023,7 @@ { v8 = 0; v9 = 12; - v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)ptr_507BC0->ptr_1C); + v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)window_SpeakInHouse->ptr_1C); do { if ( *(int *)v10 ) @@ -13040,17 +13040,17 @@ if ( !v8 ) return (int)v52._4B1854( __PAIR__( - *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)ptr_507BC0->ptr_1C + 44472], - *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)ptr_507BC0->ptr_1C + 44468]) + *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472], + *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468]) - pParty->uTimePlayed); v12 = pMouse->GetCursorPos(&v51); result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y]; v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF; if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) { - v14 = ptr_507BC0->ptr_1C; + v14 = window_SpeakInHouse->ptr_1C; v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14)); - v16 = (int)ptr_507BC0->ptr_1C; + v16 = (int)window_SpeakInHouse->ptr_1C; uPlayerID = uActiveCharacter - 1; v17 = v1->_490EEE( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, @@ -13073,7 +13073,7 @@ } if ( !(unsigned __int16)_449B57_test_bit( (unsigned __int8 *)v1->field_152, - word_4F0704[2 * (unsigned int)ptr_507BC0->ptr_1C]) ) + word_4F0704[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) ) { v36 = pNPCTopics[121].pText; v37 = v57; @@ -13277,8 +13277,8 @@ unsigned int v65; // [sp+1BCh] [bp-8h]@6 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6 - v0 = ptr_507BC0; - memcpy(&v57, ptr_507BC0, sizeof(v57)); + v0 = window_SpeakInHouse; + memcpy(&v57, window_SpeakInHouse, sizeof(v57)); v57.uFrameX = 483; v57.uFrameWidth = 148; v57.uFrameZ = 334; @@ -13302,7 +13302,7 @@ { v4 = pDialogueWindow; v61 = pDialogueWindow; - v5 = ptr_507BC0->ptr_1C; + v5 = window_SpeakInHouse->ptr_1C; v66 = 0; //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0); v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0); @@ -13395,7 +13395,7 @@ return result; } //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; - v24 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier; + v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; v25 = 0; if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 ) { @@ -13469,7 +13469,7 @@ { LABEL_55: ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); goto LABEL_46; } Party::TakeGold(v2); @@ -13481,7 +13481,7 @@ memset(v1, 0, 0xA0u); v1->sHealth = v1->GetMaxHealth(); v1->sMana = v1->GetMaxMana(); - v36 = (signed int)ptr_507BC0->ptr_1C; + v36 = (signed int)window_SpeakInHouse->ptr_1C; if ( v36 != 78 && (v36 <= 80 || v36 > 82) ) { if ( (unsigned int)v61 | v35 ) @@ -13615,12 +13615,12 @@ void *result; // eax@15 signed int v12; // [sp-4h] [bp-18h]@7 - v0 = ptr_507BC0; + v0 = window_SpeakInHouse; v1 = 0; - v2 = (int)&ptr_507BC0->ptr_1C; - v3 = (signed int)ptr_507BC0->ptr_1C; + v2 = (int)&window_SpeakInHouse->ptr_1C; + v3 = (signed int)window_SpeakInHouse->ptr_1C; //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] ) - if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType] ) + if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] ) { while ( v3 > 14 ) { @@ -13650,16 +13650,16 @@ v6 = v12; LABEL_13: pItemsTable->GenerateItem(v5, v6, (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]); - v0 = ptr_507BC0; - v2 = (int)&ptr_507BC0->ptr_1C; - pParty->field_C59C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 729] = 1; + v0 = window_SpeakInHouse; + v2 = (int)&window_SpeakInHouse->ptr_1C; + pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1; goto LABEL_14; } auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]; _a->Reset(); v2 = (int)&v0->ptr_1C; v10 = rand(); - v0 = ptr_507BC0; + v0 = window_SpeakInHouse; pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740; } LABEL_14: @@ -13722,8 +13722,8 @@ int v34; // [sp+74h] [bp-8h]@17 int v35; // [sp+78h] [bp-4h]@17 - v0 = ptr_507BC0; - memcpy(&v28, ptr_507BC0, sizeof(v28)); + v0 = window_SpeakInHouse; + memcpy(&v28, window_SpeakInHouse, sizeof(v28)); v1 = pPlayers[uActiveCharacter]; v28.uFrameX = 483; v28.uFrameWidth = 148; @@ -13774,7 +13774,7 @@ *(short *)v6 = 1; v27 = 2; } - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v27); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v27); } } else @@ -13794,7 +13794,7 @@ } if ( !(unsigned __int16)_449B57_test_bit( (unsigned __int8 *)v1->field_152, - word_4F0754[2 * (unsigned int)ptr_507BC0->ptr_1C]) ) + word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) ) { v24 = pNPCTopics[171].pText; v25 = v31; @@ -13965,8 +13965,8 @@ unsigned int s1; // [sp+288h] [bp-8h]@1 int v66; // [sp+28Ch] [bp-4h]@48 - v0 = ptr_507BC0; - memcpy(&v53, ptr_507BC0, sizeof(v53)); + v0 = window_SpeakInHouse; + memcpy(&v53, window_SpeakInHouse, sizeof(v53)); v2 = 255; v61 = pPlayers[uActiveCharacter]; v1 = v61; @@ -14009,7 +14009,7 @@ while ( 1 ) { v47[1] = (const char *)v60; - v22 = ptr_507BC0->ptr_1C; + v22 = window_SpeakInHouse->ptr_1C; v23 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62); v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62); v24 = v16->GetControl(v60); @@ -14027,7 +14027,7 @@ v47[1] = v27; sprintf(a1, format_4E2DC8, v27); v66 = (unsigned __int8)byte_4F09B8[v26 * 4]; - if ( (signed int)ptr_507BC0->ptr_1C >= 63 ) + if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 ) { if ( CheckHiredNPCSpeciality(8u) ) v66 -= 2; @@ -14130,7 +14130,7 @@ if ( pParty->uNumGold < s1 ) { ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 3); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3); if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) return; pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; @@ -14139,7 +14139,7 @@ } Party::TakeGold(s1); v47[1] = (const char *)7; - v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + dword_F8B19C)]; + v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + dword_F8B19C)]; if ( v5[pParty->uDaysPlayed % 7 + 1] ) { if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename) ) @@ -14173,9 +14173,9 @@ pParty->uFallStartY = pParty->vPosition.z; pParty->sRotationY = *((int *)v5 + 6); } - HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); + HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); v12 = (unsigned __int8)v5[8]; - if ( (signed int)ptr_507BC0->ptr_1C >= 63 ) + if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 ) { v63 = SPEECH_72; v13 = 2500; @@ -15082,7 +15082,7 @@ pParty->field_3C._shop_ban_times[2 * v25] = 0; pParty->field_3C._shop_ban_times[2 * v10 + 1] = 0; LABEL_21: - if ( !dword_597F18 ) + if ( !start_event_seq_number ) pAudioPlayer->StopChannels(-1, -1); //uCurrentHouse_Animation = p2DEvents_minus1___02[v2]; uCurrentHouse_Animation = p2DEvents[v2 / sizeof(_2devent) - 1].uAnimationID;
--- a/mm7_5.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/mm7_5.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -1278,8 +1278,8 @@ if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) uActiveCharacter = pParty->GetNextActiveCharacter(); pGUIWindow_CurrentMenu->Release(); - if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) - ptr_507BC0 = 0; + if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) + window_SpeakInHouse = 0; pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; @@ -1311,8 +1311,8 @@ if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) uActiveCharacter = pParty->GetNextActiveCharacter(); pGUIWindow_CurrentMenu->Release(); - if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) - ptr_507BC0 = 0; + if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) + window_SpeakInHouse = 0; pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; @@ -1518,8 +1518,8 @@ if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) uActiveCharacter = pParty->GetNextActiveCharacter(); pGUIWindow_CurrentMenu->Release(); - if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) - ptr_507BC0 = 0; + if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) + window_SpeakInHouse = 0; pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; @@ -1547,7 +1547,7 @@ sub_4B1D27(); pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 814, 0, -1, 0, 0, 0, 0); pVideoPlayer->Unload(); - pGUIWindow_CurrentMenu = ptr_507BC0; + pGUIWindow_CurrentMenu = window_SpeakInHouse; //goto LABEL_322; if ( pGUIWindow_Settings ) { @@ -1568,8 +1568,8 @@ if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) uActiveCharacter = pParty->GetNextActiveCharacter(); pGUIWindow_CurrentMenu->Release(); - if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) - ptr_507BC0 = 0; + if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) + window_SpeakInHouse = 0; pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; @@ -1641,8 +1641,8 @@ if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) uActiveCharacter = pParty->GetNextActiveCharacter(); pGUIWindow_CurrentMenu->Release(); - if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) - ptr_507BC0 = 0; + if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) + window_SpeakInHouse = 0; pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; @@ -1670,8 +1670,8 @@ if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) uActiveCharacter = pParty->GetNextActiveCharacter(); pGUIWindow_CurrentMenu->Release(); - if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) - ptr_507BC0 = 0; + if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) + window_SpeakInHouse = 0; pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; @@ -1705,8 +1705,8 @@ if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) uActiveCharacter = pParty->GetNextActiveCharacter(); pGUIWindow_CurrentMenu->Release(); - if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) - ptr_507BC0 = 0; + if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) + window_SpeakInHouse = 0; pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; @@ -1849,10 +1849,10 @@ } else { - dword_597F18 = dword_5C341C; + start_event_seq_number = dword_5C341C; EventProcessor(dword_5C3418, 0, v0); } - dword_597F18 = 0; + start_event_seq_number = 0; if ( !_strcmpi(byte_6BE3B0, "d05.blv") ) pParty->uTimePlayed += 1474560i64; continue; @@ -1860,7 +1860,7 @@ CloseWindowBackground(); pVideoPlayer->Unload(); sub_44603D(); - dword_597F18 = 0; + start_event_seq_number = 0; goto LABEL_422; case UIMSG_CycleCharacters: v39 = GetAsyncKeyState(VK_SHIFT); @@ -2126,7 +2126,7 @@ dword_6BE364_game_settings_1 |= v0; uGameState = 2; //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; - v53 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1]._quest_related; + v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related; if ( v53 < 0 ) { v54 = abs(v53) - 1; @@ -12572,7 +12572,7 @@ int v2; // ecx@1 int v3; // eax@1 - v0 = ptr_507BC0->ptr_1C; + v0 = window_SpeakInHouse->ptr_1C; dword_4E1874 = 5; v1 = &stru_4E1890[(int)((char *)v0 - 108)]; amuint_4E1860 = v1->field_4; @@ -15815,9 +15815,9 @@ continue; } pWindowList[pVisibleWindowsIdxs[i] - 1]._4B3157(); - if ( !ptr_507BC0 ) - continue; - v10 = ptr_507BC0->ptr_1C; + if ( !window_SpeakInHouse ) + continue; + v10 = window_SpeakInHouse->ptr_1C; if ( (signed int)v10 >= 53 ) continue; v11 = pParty->field_3C._shop_ban_times[2 * (_DWORD)v10 + 1];
--- a/mm7_data.cpp Wed Feb 20 21:35:13 2013 +0400 +++ b/mm7_data.cpp Thu Feb 21 00:33:12 2013 +0400 @@ -308,7 +308,7 @@ stru220 stru_76E5C8[16384]; #include "stru176.h" -stru176 array_5B5928[100]; +stru176 array_5B5928_timers[100]; #include "ObjectList.h" struct ObjectList *pObjectList; @@ -1796,7 +1796,7 @@ struct Texture *pTexture_outside; // idb struct Texture *pTexture_Dialogue_Background; _UNKNOWN unk_597F10; // weak -int dword_597F18; // weak +int start_event_seq_number; // weak char byte_5B0938[2000]; int dword_5B5920; // weak int dword_5B5924; // weak @@ -1808,7 +1808,7 @@ int dword_5B65BC; // weak int dword_5B65C0; // weak int dword_5B65C4; // weak -int dword_5B65C8; // weak +int dword_5B65C8_timers_count; // weak int dword_5B65CC; // weak int dword_5B65D0_dialogue_actor_npc_id; // weak int dword_5C3418; // weak
--- a/mm7_data.h Wed Feb 20 21:35:13 2013 +0400 +++ b/mm7_data.h Thu Feb 21 00:33:12 2013 +0400 @@ -1341,7 +1341,7 @@ extern struct Texture *pTexture_outside; // idb extern struct Texture *pTexture_Dialogue_Background; extern _UNKNOWN unk_597F10; // weak -extern int dword_597F18; // weak +extern int start_event_seq_number; // weak extern char byte_5B0938[2000]; extern int dword_5B5920; // weak extern int dword_5B5924; // weak @@ -1353,7 +1353,7 @@ extern int dword_5B65BC; // weak extern int dword_5B65C0; // weak extern int dword_5B65C4; // weak -extern int dword_5B65C8; // weak +extern int dword_5B65C8_timers_count; // weak extern int dword_5B65CC; // weak extern int dword_5B65D0_dialogue_actor_npc_id; // weak extern int dword_5C3418; // weak
--- a/stru176.h Wed Feb 20 21:35:13 2013 +0400 +++ b/stru176.h Thu Feb 21 00:33:12 2013 +0400 @@ -6,8 +6,8 @@ struct stru176 { signed __int64 field_0_time; - __int16 field_8; - __int16 field_A; + __int16 timer_evt_ID; + __int16 timer_evt_seq_num; __int16 field_C; __int16 field_E; __int16 field_10; @@ -16,9 +16,9 @@ __int16 field_16; __int16 field_18; __int16 field_1A; - __int16 field_1C; + __int16 timer_evt_type; __int16 field_1E; }; #pragma pack(pop) -extern stru176 array_5B5928[100]; +extern stru176 array_5B5928_timers[100];