Mercurial > mm7
comparison mm7_4.cpp @ 727:da130dd3092a
Big time Travel ouverhaul
author | Nomad |
---|---|
date | Fri, 22 Mar 2013 00:02:31 +0200 |
parents | 735dab8d3c9a |
children | 9f596a163257 |
comparison
equal
deleted
inserted
replaced
710:735dab8d3c9a | 727:da130dd3092a |
---|---|
10058 GUIWindow *v0; // ebx@1 | 10058 GUIWindow *v0; // ebx@1 |
10059 Player *v1; // esi@1 | 10059 Player *v1; // esi@1 |
10060 signed int v2; // edi@1 | 10060 signed int v2; // edi@1 |
10061 unsigned int v3; // eax@1 | 10061 unsigned int v3; // eax@1 |
10062 signed int v4; // ebx@1 | 10062 signed int v4; // ebx@1 |
10063 char *v5; // esi@7 | 10063 stru365_travel_info *v5; // esi@7 |
10064 int v6; // eax@9 | 10064 int v6; // eax@9 |
10065 int v7; // eax@9 | 10065 int v7; // eax@9 |
10066 int v8; // eax@12 | 10066 int v8; // eax@12 |
10067 int v9; // edi@12 | 10067 int v9; // edi@12 |
10068 int v10; // edx@12 | 10068 int v10; // edx@12 |
10076 int v18; // eax@36 | 10076 int v18; // eax@36 |
10077 int v19; // ecx@36 | 10077 int v19; // ecx@36 |
10078 int v20; // esi@36 | 10078 int v20; // esi@36 |
10079 int v21; // eax@36 | 10079 int v21; // eax@36 |
10080 void *v22; // eax@39 | 10080 void *v22; // eax@39 |
10081 Player *v23; // esi@39 | 10081 int v23; // esi@39 |
10082 GUIButton *v24; // ebx@39 | 10082 GUIButton *v24; // ebx@39 |
10083 signed int v25; // eax@41 | 10083 signed int v25; // eax@41 |
10084 int v26; // esi@44 | 10084 //int v26; // esi@44 |
10085 const char *v27; // eax@46 | 10085 const char *v27; // eax@46 |
10086 char *v28; // eax@62 | 10086 char *v28; // eax@62 |
10087 int v29; // eax@62 | 10087 int v29; // eax@62 |
10088 unsigned int v30; // ecx@62 | 10088 unsigned int v30; // ecx@62 |
10089 char *v31; // eax@63 | 10089 char *v31; // eax@63 |
10111 GUIWindow v53; // [sp+208h] [bp-88h]@1 | 10111 GUIWindow v53; // [sp+208h] [bp-88h]@1 |
10112 int v54; // [sp+25Ch] [bp-34h]@36 | 10112 int v54; // [sp+25Ch] [bp-34h]@36 |
10113 int v55; // [sp+260h] [bp-30h]@36 | 10113 int v55; // [sp+260h] [bp-30h]@36 |
10114 unsigned int v56; // [sp+264h] [bp-2Ch]@1 | 10114 unsigned int v56; // [sp+264h] [bp-2Ch]@1 |
10115 int v57; // [sp+268h] [bp-28h]@1 | 10115 int v57; // [sp+268h] [bp-28h]@1 |
10116 Player *v58; // [sp+26Ch] [bp-24h]@36 | 10116 int v58; // [sp+26Ch] [bp-24h]@36 |
10117 GUIWindow *v59; // [sp+270h] [bp-20h]@1 | 10117 GUIWindow *v59; // [sp+270h] [bp-20h]@1 |
10118 unsigned int v60; // [sp+274h] [bp-1Ch]@36 | 10118 unsigned int v60; // [sp+274h] [bp-1Ch]@36 |
10119 Player *v61; // [sp+278h] [bp-18h]@1 | 10119 //Player *v61; // [sp+278h] [bp-18h]@1 |
10120 int v62; // [sp+27Ch] [bp-14h]@36 | 10120 int v62; // [sp+27Ch] [bp-14h]@36 |
10121 int v63; // [sp+280h] [bp-10h]@14 | 10121 int v63; // [sp+280h] [bp-10h]@14 |
10122 char *a1; // [sp+284h] [bp-Ch]@37 | 10122 char *a1; // [sp+284h] [bp-Ch]@37 |
10123 unsigned int s1; // [sp+288h] [bp-8h]@1 | 10123 unsigned int s1; // [sp+288h] [bp-8h]@1 |
10124 int v66; // [sp+28Ch] [bp-4h]@48 | 10124 int v66; // [sp+28Ch] [bp-4h]@48 |
10125 | 10125 |
10126 v0 = window_SpeakInHouse; | 10126 v0 = window_SpeakInHouse; |
10127 memcpy(&v53, window_SpeakInHouse, sizeof(v53)); | 10127 memcpy(&v53, window_SpeakInHouse, sizeof(v53)); |
10128 v2 = 255; | 10128 v2 = 255; |
10129 v61 = pPlayers[uActiveCharacter]; | 10129 //v61 = pPlayers[uActiveCharacter]; |
10130 v1 = v61; | 10130 v1 = pPlayers[uActiveCharacter]; |
10131 v53.uFrameX = 483; | 10131 v53.uFrameX = 483; |
10132 v53.uFrameWidth = 148; | 10132 v53.uFrameWidth = 148; |
10133 v53.uFrameZ = 334; | 10133 v53.uFrameZ = 334; |
10134 v57 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 10134 v57 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
10135 v56 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 10135 v56 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
10144 if ( dialog_menu_id == 1 ) | 10144 if ( dialog_menu_id == 1 ) |
10145 { | 10145 { |
10146 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 10146 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
10147 { | 10147 { |
10148 v16 = pDialogueWindow; | 10148 v16 = pDialogueWindow; |
10149 v58 = (Player *)-1; | 10149 v58 = -1; |
10150 v62 = 0; | 10150 v62 = 0; |
10151 v17 = LOBYTE(pFontArrus->uFontHeight) - 3; | 10151 v17 = LOBYTE(pFontArrus->uFontHeight) - 3; |
10152 v59 = pDialogueWindow; | 10152 v59 = pDialogueWindow; |
10153 v54 = v17; | 10153 v54 = v17; |
10154 strcpy(Dest, ""); | 10154 strcpy(Dest, ""); |
10166 a1 = v48; | 10166 a1 = v48; |
10167 while ( 1 ) | 10167 while ( 1 ) |
10168 { | 10168 { |
10169 int v47 = v60; | 10169 int v47 = v60; |
10170 v22 = window_SpeakInHouse->ptr_1C; | 10170 v22 = window_SpeakInHouse->ptr_1C; |
10171 v23 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36 | 10171 v23 = byte_4F0E10[(unsigned int)v22 - HOUSE_STABLES_HARMONDALE][v62]; |
10172 v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land | 10172 //v23 = (unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // negindex. actual address is around + 0x36 |
10173 //v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (unsigned int)v22] + v62); // + 0x3F for sea travels, less for land | |
10173 v24 = v16->GetControl(v60); | 10174 v24 = v16->GetControl(v60); |
10174 if ( v23 != v58 | 10175 if ( v23 != v58 |
10175 && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = (unsigned __int8)*(&byte_4F09B1[32 * (int)v23] | 10176 && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = array_4F09B0[v23].pSchedule[pParty->uDaysPlayed % 7]), |
10176 + pParty->uDaysPlayed % 7)), | |
10177 v25 | 10177 v25 |
10178 && ((v26 = 8 * (int)v23, !dword_4F09CC[v26]) | 10178 && (array_4F09B0[v23].uQuestBit || _449B57_test_bit(pParty->_quest_bits, array_4F09B0[v23].uQuestBit))) ) |
10179 || (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, LOWORD(dword_4F09CC[v26])))) ) | 10179 { |
10180 { | 10180 v58 = v23; |
10181 v58 = v61; | |
10182 v27 = (const char *)v56; | 10181 v27 = (const char *)v56; |
10183 if ( pDialogueWindow->pCurrentPosActiveItem != s1 ) | 10182 if ( pDialogueWindow->pCurrentPosActiveItem != s1 ) |
10184 v27 = (const char *)v57; | 10183 v27 = (const char *)v57; |
10185 //v32.uRedbookTrackID = v27; | 10184 //v32.uRedbookTrackID = v27; |
10186 sprintf(a1, "\f%05d", v27); | 10185 sprintf(a1, "\f%05d", v27); |
10187 v66 = (unsigned __int8)byte_4F09B8[v26 * 4]; | 10186 v66 = array_4F09B0[v23].uTravelTime; |
10188 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 ) | 10187 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 ) |
10189 { | 10188 { |
10190 if ( CheckHiredNPCSpeciality(Sailor) ) | 10189 if ( CheckHiredNPCSpeciality(Sailor) ) |
10191 v66 -= 2; | 10190 v66 -= 2; |
10192 if ( CheckHiredNPCSpeciality(Navigator) ) | 10191 if ( CheckHiredNPCSpeciality(Navigator) ) |
10203 } | 10202 } |
10204 if ( CheckHiredNPCSpeciality(Explorer) ) | 10203 if ( CheckHiredNPCSpeciality(Explorer) ) |
10205 --v66; | 10204 --v66; |
10206 if ( v66 < 1 ) | 10205 if ( v66 < 1 ) |
10207 v66 = 1; | 10206 v66 = 1; |
10208 if ( v61 != (Player *)v2 ) | 10207 if ( v23 != v2 ) |
10209 { | 10208 { |
10210 memcpy(&v32, &pMapStats->pInfos[(unsigned __int8)byte_4F09B0[v26 * 4]], 0x44u); | 10209 memcpy(&v32, &pMapStats->pInfos[array_4F09B0[v23].uMapInfoID], 0x44u); |
10211 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s | 10210 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[404], // Time - %d days, destination %s |
10212 v66, v32.pName); | 10211 v66, v32.pName); |
10213 strcat(a1, pTmpBuf); | 10212 strcat(a1, pTmpBuf); |
10214 v28 = a1; | 10213 v28 = a1; |
10215 a1 += 100; | 10214 a1 += 100; |
10279 goto LABEL_33;*/ | 10278 goto LABEL_33;*/ |
10280 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 10279 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
10281 } | 10280 } |
10282 Party::TakeGold(s1); | 10281 Party::TakeGold(s1); |
10283 //v47[1] = (const char *)7; | 10282 //v47[1] = (const char *)7; |
10284 v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + dialog_menu_id)]; // negindex with ptr_1C around +0x36 | 10283 v5 = &array_4F09B0[byte_4F0CD0[(unsigned int)window_SpeakInHouse->ptr_1C - 1][dialog_menu_id - 1]]; |
10285 if ( v5[pParty->uDaysPlayed % 7 + 1] ) | 10284 if ( v5->pSchedule[pParty->uDaysPlayed % 7] ) |
10286 { | 10285 { |
10287 if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename) ) | 10286 if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename) ) |
10288 { | 10287 { |
10289 SaveGame(1, 0); | 10288 SaveGame(1, 0); |
10290 strcpy(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename); | 10289 strcpy(pCurrentMapName, pMapStats->pInfos[v5->uMapInfoID].pFilename); |
10291 v8 = *((int *)v5 + 6); | 10290 v8 = v5->field_18; |
10292 v9 = *((int *)v5 + 5); | 10291 v9 = v5->field_14; |
10293 v10 = *((int *)v5 + 4); | 10292 v10 = v5->field_10; |
10294 dword_6BE364_game_settings_1 |= 1u; | 10293 dword_6BE364_game_settings_1 |= 1u; |
10295 _5B65B8_npcdata_hiword_house_or_other = 0; | 10294 _5B65B8_npcdata_hiword_house_or_other = 0; |
10296 dword_5B65BC = 0; | 10295 dword_5B65BC = 0; |
10297 _5B65B4_npcdata_loword_house_or_other = v8; | 10296 _5B65B4_npcdata_loword_house_or_other = v8; |
10298 v11 = *((int *)v5 + 3); | 10297 v11 = *((int *)v5 + 3); |
10302 _5B65B0_npcdata_rep_or_other = v9; | 10301 _5B65B0_npcdata_rep_or_other = v9; |
10303 dword_5B65C0 = v11 | v10 | v9 | v8; | 10302 dword_5B65C0 = v11 | v10 | v9 | v8; |
10304 } | 10303 } |
10305 else | 10304 else |
10306 { | 10305 { |
10307 v6 = *((int *)v5 + 3); | 10306 v6 = v5->field_C; |
10308 pParty->sRotationX = 0; | 10307 pParty->sRotationX = 0; |
10309 pParty->vPosition.x = v6; | 10308 pParty->vPosition.x = v6; |
10310 v7 = *((int *)v5 + 4); | 10309 v7 = v5->field_10; |
10311 pIndoorCamera->sRotationY = 0; | 10310 pIndoorCamera->sRotationY = 0; |
10312 pParty->uFlags |= 2u; | 10311 pParty->uFlags |= 2u; |
10313 pParty->vPosition.y = v7; | 10312 pParty->vPosition.y = v7; |
10314 pParty->vPosition.z = *((int *)v5 + 5); | 10313 pParty->vPosition.z = v5->field_14; |
10315 pParty->uFallStartY = pParty->vPosition.z; | 10314 pParty->uFallStartY = pParty->vPosition.z; |
10316 pParty->sRotationY = *((int *)v5 + 6); | 10315 pParty->sRotationY = v5->field_18; |
10317 } | 10316 } |
10318 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); | 10317 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); |
10319 v12 = (unsigned __int8)v5[8]; | 10318 v12 = v5->uTravelTime; |
10320 int _v47; | 10319 int _v47; |
10321 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 ) | 10320 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 ) |
10322 { | 10321 { |
10323 v63 = SPEECH_SetSail; | 10322 v63 = SPEECH_SetSail; |
10324 v13 = 2500; | 10323 v13 = 2500; |
10341 if ( CheckHiredNPCSpeciality(Explorer) ) | 10340 if ( CheckHiredNPCSpeciality(Explorer) ) |
10342 --v12; | 10341 --v12; |
10343 if ( v12 < 1 ) | 10342 if ( v12 < 1 ) |
10344 v12 = 1; | 10343 v12 = 1; |
10345 RestAndHeal(1440 * v12); | 10344 RestAndHeal(1440 * v12); |
10346 v61->PlaySound((PlayerSpeech)v63, 0); | 10345 v1->PlaySound((PlayerSpeech)v63, 0); |
10347 v14 = GetTickCount(); | 10346 v14 = GetTickCount(); |
10348 v15 = v14 + v13; | 10347 v15 = v14 + v13; |
10349 if ( v15 < v14 ) | 10348 if ( v15 < v14 ) |
10350 v15 = v14; | 10349 v15 = v14; |
10351 while ( GetTickCount() < v15 ) | 10350 while ( GetTickCount() < v15 ) |