comparison mm7_4.cpp @ 484:4bd56919f075

avard quest guild bits
author Gloval
date Wed, 27 Feb 2013 02:25:31 +0400
parents 5b6e2021c6fe
children d5da524ec901 a3939d5067c4 00ce82758c72
comparison
equal deleted inserted replaced
481:5b6e2021c6fe 484:4bd56919f075
4987 v11 = pGlobalTXT_LocalizationStrings[386];// "Sir" 4987 v11 = pGlobalTXT_LocalizationStrings[386];// "Sir"
4988 goto _continue_strcat; 4988 goto _continue_strcat;
4989 case 8: 4989 case 8:
4990 v19 = 0; 4990 v19 = 0;
4991 v63 = 0; 4991 v63 = 0;
4992 v20 = (unsigned __int8 *)pPlayer->field_152; 4992 v20 = (unsigned __int8 *)pPlayer->_guilds_member_bits;
4993 do 4993 do
4994 { 4994 {
4995 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[v19]) ) 4995 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[v19]) )
4996 { 4996 {
4997 v21 = v63; 4997 v21 = v63;
5256 default: 5256 default:
5257 if ( v17 <= 50 || v17 > 70 ) 5257 if ( v17 <= 50 || v17 > 70 )
5258 goto _continue_strncpy; 5258 goto _continue_strncpy;
5259 if ( v17 - 51 >= 20 ) 5259 if ( v17 - 51 >= 20 )
5260 goto _continue_strcat; 5260 goto _continue_strcat;
5261 HIDWORD(v49) = pParty->field_3C.field_440[2 * v17 + 1]; 5261 v49 = pParty->field_3C._s_times[v17-51];
5262 LODWORD(v49) = pParty->field_3C.field_440[2 * v17]; 5262
5263 sub_493F79(&v56, v49); 5263 sub_493F79(&v56, v49);
5264 v54 = v56.field_18_expire_year; 5264 v54 = v56.field_18_expire_year;
5265 v53 = v56.field_C_expire_day + 1; 5265 v53 = v56.field_C_expire_day + 1;
5266 v50 = v56.field_14_exprie_month; 5266 v50 = v56.field_14_exprie_month;
5267 sprintf(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54); 5267 sprintf(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54);
8936 do 8936 do
8937 { 8937 {
8938 result = *v8; 8938 result = *v8;
8939 if ( pParty->uFine ) 8939 if ( pParty->uFine )
8940 { 8940 {
8941 v10 = result->field_152; 8941 v10 = result->_guilds_member_bits;
8942 result = (Player *)_449B57_test_bit((unsigned __int8 *)result->field_152, 1); 8942 result = (Player *)_449B57_test_bit((unsigned __int8 *)result->_guilds_member_bits, 1);
8943 if ( !(short)result ) 8943 if ( !(short)result )
8944 result = (Player *)_449B7E_toggle_bit((unsigned char *)v10, 1, 1u); 8944 result = (Player *)_449B7E_toggle_bit((unsigned char *)v10, 1, 1u);
8945 } 8945 }
8946 ++v8; 8946 ++v8;
8947 } 8947 }
9078 POINT v16; // [sp+38h] [bp-14h]@5 9078 POINT v16; // [sp+38h] [bp-14h]@5
9079 POINT a2; // [sp+40h] [bp-Ch]@5 9079 POINT a2; // [sp+40h] [bp-Ch]@5
9080 int v18; // [sp+48h] [bp-4h]@5 9080 int v18; // [sp+48h] [bp-4h]@5
9081 9081
9082 //v0 = pPlayers[uActiveCharacter]; 9082 //v0 = pPlayers[uActiveCharacter];
9083 if ( in_current_bilding_type <= 0 ) 9083 if ( in_current_building_type <= 0 )
9084 return; 9084 return;
9085 if ( in_current_bilding_type <= BildingType_AlchemistShop ) 9085 if ( in_current_building_type <= BildingType_AlchemistShop )
9086 { 9086 {
9087 if ( dword_F8B19C != 2 ) 9087 if ( dword_F8B19C != 2 )
9088 { 9088 {
9089 if ( dword_F8B19C <= 2 ) 9089 if ( dword_F8B19C <= 2 )
9090 return; 9090 return;
9114 if ( dword_F8B19C != 2 ) 9114 if ( dword_F8B19C != 2 )
9115 // v7 = (ItemGen *)&pParty->field_C59C[v6 + 715]; 9115 // v7 = (ItemGen *)&pParty->field_C59C[v6 + 715];
9116 v7 =&pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5]; 9116 v7 =&pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][v5];
9117 goto LABEL_15; 9117 goto LABEL_15;
9118 } 9118 }
9119 if ( in_current_bilding_type <= BildingType_16 && dword_F8B19C == BildingType_18 ) 9119 if ( in_current_building_type <= BildingType_16 && dword_F8B19C == BildingType_18 )
9120 { 9120 {
9121 v1 = pMouse->GetCursorPos(&a2); 9121 v1 = pMouse->GetCursorPos(&a2);
9122 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y]; 9122 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v16)->y];
9123 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; 9123 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
9124 v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; 9124 v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
9178 __int16 v4; // ax@15 9178 __int16 v4; // ax@15
9179 signed int v5; // edi@20 9179 signed int v5; // edi@20
9180 int v6; // esi@20 9180 int v6; // esi@20
9181 int v7[4]; // [sp+Ch] [bp-10h]@12 9181 int v7[4]; // [sp+Ch] [bp-10h]@12
9182 9182
9183 if ( in_current_bilding_type > 0 ) 9183 if ( in_current_building_type > 0 )
9184 { 9184 {
9185 v0 = 3; 9185 v0 = 3;
9186 if ( in_current_bilding_type > BildingType_MagicShop ) 9186 if ( in_current_building_type > BildingType_MagicShop )
9187 { 9187 {
9188 if ( in_current_bilding_type == BildingType_Bank ) 9188 if ( in_current_building_type == BildingType_Bank )
9189 { 9189 {
9190 if ( !dword_F8B1E4 ) 9190 if ( !dword_F8B1E4 )
9191 return; 9191 return;
9192 } 9192 }
9193 else 9193 else
9194 { 9194 {
9195 if ( in_current_bilding_type != BildingType_Temple ) 9195 if ( in_current_building_type != BildingType_Temple )
9196 return; 9196 return;
9197 } 9197 }
9198 v1 = (unsigned int)window_SpeakInHouse->ptr_1C; 9198 v1 = (unsigned int)window_SpeakInHouse->ptr_1C;
9199 LABEL_28: 9199 LABEL_28:
9200 HousePlaySomeSound(v1, v0); 9200 HousePlaySomeSound(v1, v0);
9201 return; 9201 return;
9202 } 9202 }
9203 v1 = (unsigned int)window_SpeakInHouse->ptr_1C; 9203 v1 = (unsigned int)window_SpeakInHouse->ptr_1C;
9204 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 ) 9204 if ( (signed __int64)pParty->field_3C._shop_ban_times[v1 ]<= (signed __int64)pParty->uTimePlayed )
9205 { 9205 {
9206 if ( pParty->uNumGold <= 0x2710 ) 9206 if ( pParty->uNumGold <= 0x2710 )
9207 { 9207 {
9208 if ( !dword_F8B1E4 ) 9208 if ( !dword_F8B1E4 )
9209 return; 9209 return;
9260 9260
9261 //----- (004B1E92) -------------------------------------------------------- 9261 //----- (004B1E92) --------------------------------------------------------
9262 void __fastcall HousePlaySomeSound(unsigned int uHouseID, int a2) 9262 void __fastcall HousePlaySomeSound(unsigned int uHouseID, int a2)
9263 { 9263 {
9264 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) ) 9264 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
9265 if ( BYTE1(pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].field_C) ) 9265 if ( BYTE1(pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uBuildingType) )
9266 pAudioPlayer->PlaySound( 9266 pAudioPlayer->PlaySound(
9267 //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)), 9267 //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
9268 (SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].field_C) + 300)), 9268 (SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uBuildingType) + 300)),
9269 806, 9269 806,
9270 0, 9270 0,
9271 -1, 9271 -1,
9272 0, 9272 0,
9273 0, 9273 0,
9290 ItemGen *v9; // [sp+Ch] [bp-Ch]@11 9290 ItemGen *v9; // [sp+Ch] [bp-Ch]@11
9291 signed int v10; // [sp+10h] [bp-8h]@13 9291 signed int v10; // [sp+10h] [bp-8h]@13
9292 int v11; // [sp+14h] [bp-4h]@1 9292 int v11; // [sp+14h] [bp-4h]@1
9293 Player *v12; // [sp+14h] [bp-4h]@11 9293 Player *v12; // [sp+14h] [bp-4h]@11
9294 9294
9295 dword_F8B1A8 = 0; 9295 contract_approved = 0;
9296 v11 = 0; 9296 v11 = 0;
9297 uDialogueType = 84; 9297 uDialogueType = 84;
9298 ptr_F8B1E8 = (char *)pNPCTopics[667].pText; 9298 ptr_F8B1E8 = (char *)pNPCTopics[667].pText;
9299 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals; 9299 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals;
9300 while ( 1 ) 9300 while ( 1 )
9301 { 9301 {
9302 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, *v0) ) 9302 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0) )
9303 { 9303 {
9304 v1 = 0; 9304 v1 = 0;
9305 v2 = pParty->pPlayers; 9305 v2 = pParty->pPlayers;
9306 do 9306 do
9307 { 9307 {
9322 } 9322 }
9323 if ( v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) 9323 if ( v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53] )
9324 { 9324 {
9325 ptr_F8B1E8 = (char *)pNPCTopics[666].pText; 9325 ptr_F8B1E8 = (char *)pNPCTopics[666].pText;
9326 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; 9326 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11];
9327 dword_F8B1A8 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; 9327 contract_approved = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11];
9328 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4); 9328 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4);
9329 } 9329 }
9330 if ( dword_F8B1A8 == 601 ) 9330 if ( contract_approved == 601 )
9331 { 9331 {
9332 v5 = 0; 9332 v5 = 0;
9333 v12 = pParty->pPlayers;//[0].uClass; 9333 v12 = pParty->pPlayers;//[0].uClass;
9334 v9 = 0; 9334 v9 = 0;
9335 while ( 1 ) 9335 while ( 1 )
9496 } 9496 }
9497 else 9497 else
9498 { 9498 {
9499 if ( uMessageParam == 79 ) 9499 if ( uMessageParam == 79 )
9500 { 9500 {
9501 if ( dword_F8B1A8 ) 9501 if ( contract_approved )
9502 { 9502 {
9503 Party::TakeGold(gold_transaction_amount); 9503 Party::TakeGold(gold_transaction_amount);
9504 if ( uActiveCharacter ) 9504 if ( uActiveCharacter )
9505 { 9505 {
9506 v12 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards]; 9506 v12 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards];
9532 }*/ 9532 }*/
9533 } 9533 }
9534 } 9534 }
9535 else 9535 else
9536 { 9536 {
9537 if ( uMessageParam == 82 && dword_F8B1A8 ) 9537 if ( uMessageParam == 82 && contract_approved )
9538 { 9538 {
9539 Party::TakeGold(gold_transaction_amount); 9539 Party::TakeGold(gold_transaction_amount);
9540 v4 = pParty->pPlayers; 9540 v4 = pParty->pPlayers;
9541 do 9541 do
9542 { 9542 {
9692 int v33; // [sp+20h] [bp-Ch]@7 9692 int v33; // [sp+20h] [bp-Ch]@7
9693 int v34; // [sp+24h] [bp-8h]@7 9693 int v34; // [sp+24h] [bp-8h]@7
9694 char *v35; // [sp+28h] [bp-4h]@1 9694 char *v35; // [sp+28h] [bp-4h]@1
9695 9695
9696 v1 = pPlayers[uActiveCharacter]; 9696 v1 = pPlayers[uActiveCharacter];
9697 dword_F8B1A8 = 0; 9697 contract_approved = 0;
9698 v2 = (_this - 200) % 3; 9698 v2 = (_this - 200) % 3;
9699 v3 = (_this - 200) / 3; 9699 v3 = (_this - 200) / 3;
9700 v4 = v2; 9700 v4 = v2;
9701 v35 = (char *)pNPCTopics[127].pText; 9701 v35 = (char *)pNPCTopics[127].pText;
9702 dword_F8B1AC_something_todo_with_awards = v3; 9702 dword_F8B1AC_something_todo_with_awards = v3;
9813 v19 = 114; 9813 v19 = 114;
9814 goto LABEL_57; 9814 goto LABEL_57;
9815 case 20: 9815 case 20:
9816 v19 = 110; 9816 v19 = 110;
9817 LABEL_57: 9817 LABEL_57:
9818 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, v19) ) 9818 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) )
9819 return v35; 9819 return v35;
9820 goto LABEL_40; 9820 goto LABEL_40;
9821 case 22: 9821 case 22:
9822 v20 = v1->GetBaseWillpower(); 9822 v20 = v1->GetBaseWillpower();
9823 goto LABEL_61; 9823 goto LABEL_61;
9955 gold_transaction_amount = 1000; 9955 gold_transaction_amount = 1000;
9956 LABEL_42: 9956 LABEL_42:
9957 if ( gold_transaction_amount > pParty->uNumGold ) 9957 if ( gold_transaction_amount > pParty->uNumGold )
9958 return (char *)pNPCTopics[124].pText; 9958 return (char *)pNPCTopics[124].pText;
9959 LABEL_79: 9959 LABEL_79:
9960 dword_F8B1A8 = 1; 9960 contract_approved = 1;
9961 if ( v34 == 2 ) 9961 if ( v34 == 2 )
9962 { 9962 {
9963 v27 = gold_transaction_amount; 9963 v27 = gold_transaction_amount;
9964 v24 = pSkillNames[v17]; 9964 v24 = pSkillNames[v17];
9965 v21 = pGlobalTXT_LocalizationStrings[433]; 9965 v21 = pGlobalTXT_LocalizationStrings[433];
9986 9986
9987 9987
9988 //----- (004B29F2) -------------------------------------------------------- 9988 //----- (004B29F2) --------------------------------------------------------
9989 const char *__fastcall ContractSelectText(int pEventNumber) 9989 const char *__fastcall ContractSelectText(int pEventNumber)
9990 { 9990 {
9991 dword_F8B1A8 = 0; 9991 contract_approved = 0;
9992 dword_F8B1AC_something_todo_with_awards = pEventNumber + 50; 9992 dword_F8B1AC_something_todo_with_awards = pEventNumber + 50;
9993 gold_transaction_amount = dword_4F08EC[pEventNumber]; 9993 gold_transaction_amount = price_for_membership[pEventNumber];
9994 if ( pPlayers[uActiveCharacter]->CanAct() ) 9994 if ( pPlayers[uActiveCharacter]->CanAct() )
9995 { 9995 {
9996 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->field_152, dword_F8B1AC_something_todo_with_awards) ) 9996 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_guilds_member_bits, dword_F8B1AC_something_todo_with_awards) )
9997 { 9997 {
9998 return pNPCTopics[123].pText; 9998 return pNPCTopics[123].pText;
9999 } 9999 }
10000 else 10000 else
10001 { 10001 {
10002 if ( gold_transaction_amount <= pParty->uNumGold ) 10002 if ( gold_transaction_amount <= pParty->uNumGold )
10003 { 10003 {
10004 dword_F8B1A8 = 1; 10004 contract_approved = 1;
10005 return pNPCTopics[pEventNumber + 110].pText; 10005 return pNPCTopics[pEventNumber + 110].pText;
10006 } 10006 }
10007 else 10007 else
10008 { 10008 {
10009 return pNPCTopics[124].pText; 10009 return pNPCTopics[124].pText;
10010 } 10010 }
10011 } 10011 }
10012 } 10012 }
10013 else 10013 else
10014 { 10014 {
10015 return pNPCTopics[122].pText; 10015 return pNPCTopics[122].pText;
10016 } 10016 }
10017 } 10017 }
10018 10018
10019 10019
10020 //----- (004B2A74) -------------------------------------------------------- 10020 //----- (004B2A74) --------------------------------------------------------
10230 v16->uControlParam = 0; 10230 v16->uControlParam = 0;
10231 v15 = ""; 10231 v15 = "";
10232 } 10232 }
10233 if ( uDialogueType != 84 ) 10233 if ( uDialogueType != 84 )
10234 goto LABEL_49; 10234 goto LABEL_49;
10235 sprintf(pTmpBuf, format_4E2D80, v55, pItemsTable->pItems[dword_F8B1A8].pUnidentifiedName); 10235 sprintf(pTmpBuf, format_4E2D80, v55, pItemsTable->pItems[contract_approved].pUnidentifiedName);
10236 sprintf(pTmpBuf2, ptr_F8B1E8, pTmpBuf); 10236 sprintf(pTmpBuf2, ptr_F8B1E8, pTmpBuf);
10237 ptr_F8B1E8 = pTmpBuf2; 10237 ptr_F8B1E8 = pTmpBuf2;
10238 goto LABEL_45; 10238 goto LABEL_45;
10239 } 10239 }
10240 v21 = v20 - 1; 10240 v21 = v20 - 1;
10663 0, 10663 0,
10664 pGlobalTXT_LocalizationStrings[34], 10664 pGlobalTXT_LocalizationStrings[34],
10665 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 10665 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
10666 0); 10666 0);
10667 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); 10667 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0);
10668 if ( dword_F8B1A8 ) 10668 if ( contract_approved )
10669 v2 = pGlobalTXT_LocalizationStrings[535]; 10669 v2 = pGlobalTXT_LocalizationStrings[535];
10670 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Fu, 0, v2, 0); 10670 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Fu, 0, v2, 0);
10671 pDialogueWindow->_41D08F(1, 1, 0, 2); 10671 pDialogueWindow->_41D08F(1, 1, 0, 2);
10672 dword_F8B19C = -1; 10672 dword_F8B19C = -1;
10673 } 10673 }
10778 pGlobalTXT_LocalizationStrings[74],// "End Conversation" 10778 pGlobalTXT_LocalizationStrings[74],// "End Conversation"
10779 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); 10779 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0);
10780 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0); 10780 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0);
10781 if ( pDialogueNPCCount == 1 && dword_591080 ) 10781 if ( pDialogueNPCCount == 1 && dword_591080 )
10782 { 10782 {
10783 sub_4B3B42(in_current_bilding_type); 10783 sub_4B3B42(in_current_building_type);
10784 } 10784 }
10785 else 10785 else
10786 { 10786 {
10787 if ( v17->joins ) 10787 if ( v17->joins )
10788 { 10788 {
12495 } 12495 }
12496 } 12496 }
12497 return result; 12497 return result;
12498 } 12498 }
12499 if ( !(unsigned __int16)_449B57_test_bit( 12499 if ( !(unsigned __int16)_449B57_test_bit(
12500 (unsigned __int8 *)v1->field_152, 12500 (unsigned __int8 *)v1->_guilds_member_bits,
12501 word_4F0704[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) ) 12501 word_4F0704[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
12502 { 12502 {
12503 v36 = pNPCTopics[121].pText; 12503 v36 = pNPCTopics[121].pText;
12504 v37 = v57; 12504 v37 = v57;
12505 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &v52, 0, 0); 12505 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &v52, 0, 0);
12506 v52.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, v37, v36, 3u); 12506 v52.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, v37, v36, 3u);
13131 ++pMessageQueue_50CBD0->uNumMessages; 13131 ++pMessageQueue_50CBD0->uNumMessages;
13132 }*/ 13132 }*/
13133 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5); 13133 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5);
13134 return result; // void func 13134 return result; // void func
13135 } 13135 }
13136 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->field_152, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) ) 13136 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
13137 { 13137 {
13138 v24 = pNPCTopics[171].pText; 13138 v24 = pNPCTopics[171].pText;
13139 v25 = v31; 13139 v25 = v31;
13140 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0); 13140 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0);
13141 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u); 13141 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u);
13355 if ( v23 != v58 13355 if ( v23 != v58
13356 && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = (unsigned __int8)*(&byte_4F09B1[32 * (int)v23] 13356 && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = (unsigned __int8)*(&byte_4F09B1[32 * (int)v23]
13357 + pParty->uDaysPlayed % 7)), 13357 + pParty->uDaysPlayed % 7)),
13358 v25 13358 v25
13359 && ((v26 = 8 * (int)v23, !dword_4F09CC[v26]) 13359 && ((v26 = 8 * (int)v23, !dword_4F09CC[v26])
13360 || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, LOWORD(dword_4F09CC[v26])))) ) 13360 || (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, LOWORD(dword_4F09CC[v26])))) )
13361 { 13361 {
13362 v58 = v61; 13362 v58 = v61;
13363 v27 = (const char *)v56; 13363 v27 = (const char *)v56;
13364 if ( pDialogueWindow->pCurrentPosActiveItem != s1 ) 13364 if ( pDialogueWindow->pCurrentPosActiveItem != s1 )
13365 v27 = *(const char **)v57; 13365 v27 = *(const char **)v57;
14160 pTexture_outside = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v13, TEXTURE_16BIT_PALETTE)]; 14160 pTexture_outside = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v13, TEXTURE_16BIT_PALETTE)];
14161 if ( v9 ) 14161 if ( v9 )
14162 { 14162 {
14163 if ( !v23 ) 14163 if ( !v23 )
14164 //pVideoPlayer->_4BF28F(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_0, 1u); 14164 //pVideoPlayer->_4BF28F(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_0, 1u);
14165 pVideoPlayer->_4BF28F(pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].field_0, 1u); 14165 pVideoPlayer->_4BF28F(pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].video_name, 1u);
14166 } 14166 }
14167 else 14167 else
14168 { 14168 {
14169 if ( !v23 ) 14169 if ( !v23 )
14170 { 14170 {
14195 LABEL_19: 14195 LABEL_19:
14196 strcpy(sHouseName, v21); 14196 strcpy(sHouseName, v21);
14197 LABEL_20: 14197 LABEL_20:
14198 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)26, 0, (int)sHouseName); 14198 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)26, 0, (int)sHouseName);
14199 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) ) 14199 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) )
14200 if ( BYTE1(pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].field_C) ) 14200 if ( BYTE1(pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].uBuildingType) )
14201 HousePlaySomeSound(v9, 1); 14201 HousePlaySomeSound(v9, 1);
14202 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 ) 14202 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
14203 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0); 14203 pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0);
14204 result = v23; 14204 result = v23;
14205 if ( v23 ) 14205 if ( v23 )
14245 //uExitMapID = *(__int16 *)((char *)p2DEvents_minus1_::30 + v1); 14245 //uExitMapID = *(__int16 *)((char *)p2DEvents_minus1_::30 + v1);
14246 uExitMapID = p2DEvents[house - 1]._quest_related; 14246 uExitMapID = p2DEvents[house - 1]._quest_related;
14247 if ( uExitMapID > 0 ) 14247 if ( uExitMapID > 0 )
14248 { 14248 {
14249 //v17 = (unsigned int *)(uExitMapID - 1); 14249 //v17 = (unsigned int *)(uExitMapID - 1);
14250 if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_award_bits[(uExitMapID - 1) >> 3]) ) 14250 if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_quest_bits[(uExitMapID - 1) >> 3]) )
14251 { 14251 {
14252 //uExitPic = 0; 14252 //uExitPic = 0;
14253 uHouse_ExitPic = 0; 14253 uHouse_ExitPic = 0;
14254 } 14254 }
14255 } 14255 }
14329 } 14329 }
14330 14330
14331 14331
14332 14332
14333 //----- (0044622E) -------------------------------------------------------- 14333 //----- (0044622E) --------------------------------------------------------
14334 bool __fastcall EnterHouse(enum HOUSE_ID uHouseID) 14334 bool EnterHouse(enum HOUSE_ID uHouseID)
14335 { 14335 {
14336 //enum HOUSE_ID v1; // edi@1 14336 //enum HOUSE_ID v1; // edi@1
14337 //int v2; // edi@5 14337 //int v2; // edi@5
14338 unsigned int uOpenTime; // eax@5 14338 signed int uOpenTime; // eax@5
14339 int uCloseTime; // esi@5 14339 signed int uCloseTime; // esi@5
14340 unsigned int v5; // esi@5 14340 unsigned int v5; // esi@5
14341 int v6; // edx@5 14341 int v6; // edx@5
14342 signed int v7; // ecx@10 14342 signed int am_pm_flag_open; // ecx@10
14343 signed int v8; // eax@10 14343 signed int am_pm_flag_close; // eax@10
14344 int v9; // esi@10 14344 int v9; // esi@10
14345 //unsigned int v10; // esi@16 14345 //unsigned int v10; // esi@16
14346 int v11; // ecx@17 14346 int v11; // ecx@17
14347 unsigned int v12; // kr00_4@25 14347 unsigned int v12; // kr00_4@25
14348 //Player *v13; // esi@25 14348 //Player *v13; // esi@25
14362 //v25 = uHouseID; 14362 //v25 = uHouseID;
14363 GameUI_StatusBar_TimedString[0] = 0; 14363 GameUI_StatusBar_TimedString[0] = 0;
14364 pStatusBarString[0] = 0; 14364 pStatusBarString[0] = 0;
14365 ShowStatusBarString("", 2u); 14365 ShowStatusBarString("", 2u);
14366 if ( pMessageQueue_50CBD0->uNumMessages ) 14366 if ( pMessageQueue_50CBD0->uNumMessages )
14367 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 14367 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
14368 viewparams->bRedrawGameUI = 1; 14368 viewparams->bRedrawGameUI = 1;
14369 uDialogueType = 0; 14369 uDialogueType = 0;
14370 pKeyActionMap->_459ED1(3); 14370 pKeyActionMap->_459ED1(3);
14371 pKeyActionMap->ResetKeys(); 14371 pKeyActionMap->ResetKeys();
14372 if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601) 14372 if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601)
14373 { 14373 {
14374 GameOverMenu(0); 14374 GameOverMenu(0);
14375 return 0; 14375 return 0;
14376 } 14376 }
14377 //v2 = 26 * v1;
14378 //uOpenTime = p2DEvents_minus1_::uOpenTime[v2];
14379 uOpenTime = p2DEvents[uHouseID - 1].uOpenTime; 14377 uOpenTime = p2DEvents[uHouseID - 1].uOpenTime;
14380 //uCloseTime = p2DEvents_minus1_::uCloseTime[v2];
14381 uCloseTime = p2DEvents[uHouseID - 1].uCloseTime; 14378 uCloseTime = p2DEvents[uHouseID - 1].uCloseTime;
14382 ptr_F8B1E8 = 0; 14379 ptr_F8B1E8 = 0;
14383 v24 = uOpenTime;
14384 v5 = uCloseTime - 1;
14385 dword_F8B1E4 = 0; 14380 dword_F8B1E4 = 0;
14386 dword_F8B1F4 = 0; 14381 dword_F8B1F4 = 0;
14387 memset(byte_F8B1F0, 0, 4u); 14382 memset(byte_F8B1F0, 0, 4);
14388 memset(byte_F8B148, 0, 0x10u); 14383 memset(byte_F8B148, 0, 16);
14389 pRenderer->ClearZBuffer(0, 479); 14384 pRenderer->ClearZBuffer(0, 479);
14390 v6 = v24; 14385 if ( uCloseTime - 1 <= uOpenTime )
14391 if ( (signed int)v5 <= (signed int)v24 ) 14386 {
14392 { 14387 if ( pParty->uCurrentHour >= uOpenTime )
14393 if ( pParty->uCurrentHour >= v24 ) 14388 {
14394 goto LABEL_16; 14389 //v10 = uHouseID;
14395 } 14390 if ( (signed int)uHouseID < 53 )
14391 {
14392 if ( !(pParty->field_3C._shop_ban_times[uHouseID])
14393 || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) )
14394 {
14395 pParty->field_3C._shop_ban_times[uHouseID] = 0;
14396
14397 }
14398 else
14399 {
14400 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
14401 return 0;
14402 }
14403 }
14404 if ( !start_event_seq_number )
14405 pAudioPlayer->StopChannels(-1, -1);
14406
14407 uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
14408 in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType;
14409 if ( in_current_building_type == BildingType_20 && pParty->uFine ) // going 2 jail
14410 {
14411 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
14412 uHouseID = HOUSE_JAIL;
14413 pParty->uTimePlayed = pParty->uTimePlayed+ 0x7620000;
14414 in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE].uAnimationID].uBuildingType;
14415 ++pParty->uNumPrisonTerms;
14416 pParty->uFine = 0;
14417 for (uint i = 0; i < 4; ++i)
14418 {
14419 pParty->pPlayers[i].uTimeToRecovery = 0;
14420 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
14421 pParty->pPlayers[i].SetVariable(VAR_Award, 87);
14422 }
14423 }
14424 ++pIcons_LOD->uTexturePacksCount;
14425 if ( !pIcons_LOD->uNumPrevLoadedFiles )
14426 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
14427
14428 switch (pParty->alignment)
14429 {
14430 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break;
14431 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break;
14432 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
14433 default: assert(false);
14434 }
14435
14436 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
14437 pDialogueNPCCount = 0;
14438 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
14439 uTextureID_507B04 = uTextureID_right_panel;
14440 PrepareHouse(uHouseID);
14441 v18 = 1;
14442 uTextureID_507B04 = uTextureID_right_panel;
14443 if ( uNumDialogueNPCPortraits == 1 )
14444 pDialogueNPCCount = 1;
14445 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
14446 dword_5C35D4 = 1;
14447 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
14448 {
14449 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) )
14450 {
14451 return 1;
14452 }
14453 }
14454 else
14455 { //guilds
14456 v19 = word_4F0704[uHouseID-139] - 1; //some gild flag check
14457 //v20 = uHouseID;
14458 if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) )
14459 {
14460 HousePlaySomeSound(uHouseID, 3);
14461 return 1;
14462 }
14463 }
14464 HousePlaySomeSound(uHouseID, 1);
14465 dword_5C35D4 = 1;
14466 return 1;
14467 }
14468 }
14396 else 14469 else
14397 { 14470 {
14398 if ( pParty->uCurrentHour < v24 ) 14471 if (( pParty->uCurrentHour < uOpenTime)||( pParty->uCurrentHour > uCloseTime - 1 ))
14399 { 14472 {
14400 LABEL_10: 14473 am_pm_flag_open = 0;
14401 v7 = 0; 14474 am_pm_flag_close = 0;
14402 v8 = 0; 14475 if (uOpenTime > 12 )
14403 v9 = v5 + 1; 14476 {
14404 if ( (signed int)v24 > 12 ) 14477 uOpenTime -= 12;
14405 { 14478 am_pm_flag_open = 1;
14406 v6 = v24 - 12; 14479 }
14407 v7 = 1; 14480 if ( uCloseTime > 12 )
14408 } 14481 {
14409 if ( v9 > 12 ) 14482 uCloseTime -= 12;
14410 { 14483 am_pm_flag_close = 1;
14411 v9 -= 12; 14484 }
14412 v8 = 1; 14485 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open],
14413 } 14486 uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s"
14414 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[414], v6, aAMPMNames[v7], v9, aAMPMNames[v8]); 14487 ShowStatusBarString(pTmpBuf, 2u);
14415 ShowStatusBarString(pTmpBuf, 2u); 14488 if ( uActiveCharacter )
14416 if ( uActiveCharacter ) 14489 pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0);
14417 pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0); 14490 return 0;
14418 return 0; 14491 }
14419 } 14492 }
14420 } 14493
14421 if ( pParty->uCurrentHour > v5 )
14422 goto LABEL_10;
14423 LABEL_16:
14424 //v10 = uHouseID;
14425 if ( (signed int)uHouseID >= 53 )
14426 goto LABEL_21;
14427 v11 = pParty->field_3C._shop_ban_times[2 * uHouseID + 1];
14428 if ( !(v11 | pParty->field_3C._shop_ban_times[2 * uHouseID])
14429 || (signed __int64)__PAIR__(v11, pParty->field_3C._shop_ban_times[2 * uHouseID]) <= (signed __int64)pParty->uTimePlayed )
14430 {
14431 pParty->field_3C._shop_ban_times[2 * uHouseID] = 0;
14432 pParty->field_3C._shop_ban_times[2 * uHouseID + 1] = 0;
14433 LABEL_21:
14434 if ( !start_event_seq_number )
14435 pAudioPlayer->StopChannels(-1, -1);
14436 //uCurrentHouse_Animation = p2DEvents_minus1___02[v2];
14437 uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID;
14438 in_current_bilding_type = LOBYTE(pAnimatedRooms[uCurrentHouse_Animation].field_C);
14439 if ( in_current_bilding_type == BildingType_20 && pParty->uFine ) // going 2 jail
14440 {
14441 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
14442 //v25 = HOUSE_187;
14443 uHouseID = HOUSE_JAIL;
14444 v12 = LODWORD(pParty->uTimePlayed);
14445 LODWORD(pParty->uTimePlayed) += 0x7620000u;
14446 v14 = LOBYTE(pAnimatedRooms[(signed __int16)p2DEvents[HOUSE_LORD_AND_JUDGE].uAnimationID].field_C);
14447 pParty->uTimePlayed = __PAIR__(HIDWORD(pParty->uTimePlayed), v12) + 0x7620000;
14448 in_current_bilding_type = v14;
14449 //v13 = pParty->pPlayers;//[0].uNumDivineInterventionCastsThisDay;
14450 //do
14451 ++pParty->uNumPrisonTerms;
14452 pParty->uFine = 0;
14453 for (uint i = 0; i < 4; ++i)
14454 {
14455 pParty->pPlayers[i].uTimeToRecovery = 0;
14456 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
14457 pParty->pPlayers[i].SetVariable(VAR_Award, 87);
14458 //v13->uTimeToRecovery = 0;
14459 //memset(&v13->uTimeToRecovery, 0, 4u);
14460 //++v13;
14461 }
14462 //while ( v13 <= &pParty->pPlayers[3] );
14463 /*v15 = pParty->pPlayers;
14464 do
14465 {
14466 ++v15;
14467 }
14468 while ( v15 <= &pParty->pPlayers[3] );*/
14469 //v10 = v25;
14470 }
14471 ++pIcons_LOD->uTexturePacksCount;
14472 if ( !pIcons_LOD->uNumPrevLoadedFiles )
14473 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
14474
14475 /*v16 = const_2();
14476 sprintf(pContainer, "evt%02d", v16);
14477 if ( pParty->uAlignment )
14478 {
14479 if ( pParty->uAlignment != 2 )
14480 goto LABEL_37;
14481 v22 = "-c";
14482 }
14483 else
14484 {
14485 v22 = "-b";
14486 }
14487 strcat(pContainer, v22);*/
14488 //LABEL_37:
14489 switch (pParty->alignment)
14490 {
14491 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break;
14492 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break;
14493 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
14494 default: assert(false);
14495 }
14496
14497 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
14498 pDialogueNPCCount = 0;
14499 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
14500 uTextureID_507B04 = uTextureID_right_panel;
14501 PrepareHouse(uHouseID);
14502 v18 = 1;
14503 uTextureID_507B04 = uTextureID_right_panel;
14504 if ( uNumDialogueNPCPortraits == 1 )
14505 pDialogueNPCCount = 1;
14506 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
14507 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
14508 {
14509 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) )
14510 goto LABEL_49;
14511 //v20 = uHouseID;
14512 }
14513 else
14514 {
14515 v19 = word_4F0704[2 * uHouseID] - 1;
14516 //v20 = uHouseID;
14517 if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->field_152[v19 >> 3]) )
14518 {
14519 HousePlaySomeSound(uHouseID, 3);
14520 v18 = 1;
14521 LABEL_49:
14522 dword_5C35D4 = v18;
14523 return v18;
14524 }
14525 v18 = 1;
14526 }
14527 HousePlaySomeSound(uHouseID, v18);
14528 goto LABEL_49;
14529 }
14530 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
14531 return 0;
14532 } 14494 }