comparison mm7_2.cpp @ 484:4bd56919f075

avard quest guild bits
author Gloval
date Wed, 27 Feb 2013 02:25:31 +0400
parents 5b6e2021c6fe
children a3939d5067c4 0e27362ac1d9
comparison
equal deleted inserted replaced
481:5b6e2021c6fe 484:4bd56919f075
89 while ( 1 ) 89 while ( 1 )
90 { 90 {
91 v3 = 8 * *((char *)v2 + v1); 91 v3 = 8 * *((char *)v2 + v1);
92 if ( *(&byte_4F09B1[pParty->uDaysPlayed % 7] + v3 * 4) ) 92 if ( *(&byte_4F09B1[pParty->uDaysPlayed % 7] + v3 * 4) )
93 { 93 {
94 if ( !dword_4F09CC[v3] || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, LOWORD(dword_4F09CC[v3])) ) 94 if ( !dword_4F09CC[v3] || (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, LOWORD(dword_4F09CC[v3])) )
95 break; 95 break;
96 } 96 }
97 ++v1; 97 ++v1;
98 if ( v1 >= 4 ) 98 if ( v1 >= 4 )
99 return 0; 99 return 0;
3657 v0 = rand() % word_4F0F30[(signed int)v1] + 11 * v4 + 400; 3657 v0 = rand() % word_4F0F30[(signed int)v1] + 11 * v4 + 400;
3658 } 3658 }
3659 LABEL_12: 3659 LABEL_12:
3660 if ( v0 == 487 ) 3660 if ( v0 == 487 )
3661 { 3661 {
3662 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) ) 3662 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 239) )
3663 v0 = 486; 3663 v0 = 486;
3664 } 3664 }
3665 v5 = window_SpeakInHouse; 3665 v5 = window_SpeakInHouse;
3666 3666
3667 auto _u = (ItemGen *)&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + v2 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C; 3667 auto _u = (ItemGen *)&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + v2 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C;
3755 return; 3755 return;
3756 pRenderer->ClearZBuffer(0, 479); 3756 pRenderer->ClearZBuffer(0, 479);
3757 //v3 = dword_F8B198; 3757 //v3 = dword_F8B198;
3758 if ( dword_F8B19C != 1 ) 3758 if ( dword_F8B19C != 1 )
3759 goto LABEL_13; 3759 goto LABEL_13;
3760 if ( in_current_bilding_type == BildingType_Training ) 3760 if ( in_current_building_type == BildingType_Training )
3761 { 3761 {
3762 if ( uMessageParam == 17 ) 3762 if ( uMessageParam == 17 )
3763 { 3763 {
3764 v4 = 0; 3764 v4 = 0;
3765 v5 = 0; 3765 v5 = 0;
3776 return; 3776 return;
3777 } 3777 }
3778 goto LABEL_9; 3778 goto LABEL_9;
3779 } 3779 }
3780 v8 = window_SpeakInHouse; 3780 v8 = window_SpeakInHouse;
3781 if ( (in_current_bilding_type == BildingType_Stables || in_current_bilding_type == BildingType_Boats) 3781 if ( (in_current_building_type == BildingType_Stables || in_current_building_type == BildingType_Boats)
3782 && (v1 = 0, *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + uMessageParam)] + pParty->uDaysPlayed % 7)) 3782 && (v1 = 0, *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + uMessageParam)] + pParty->uDaysPlayed % 7))
3783 || in_current_bilding_type != BildingType_Temple || uMessageParam != BildingType_MindGuild ) 3783 || in_current_building_type != BildingType_Temple || uMessageParam != BildingType_MindGuild )
3784 { 3784 {
3785 LABEL_9: 3785 LABEL_9:
3786 pDialogueWindow->Release(); 3786 pDialogueWindow->Release();
3787 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, v1, v1); 3787 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, v1, v1);
3788 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, v1, 0x71u, v1, v1, pGlobalTXT_LocalizationStrings[74],// "End Conversation" 3788 pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, v1, 0x71u, v1, v1, pGlobalTXT_LocalizationStrings[74],// "End Conversation"
3799 return; 3799 return;
3800 goto LABEL_10; 3800 goto LABEL_10;
3801 } 3801 }
3802 LABEL_11: 3802 LABEL_11:
3803 dword_F8B19C = uMessageParam; 3803 dword_F8B19C = uMessageParam;
3804 if ( in_current_bilding_type < BildingType_19 ) 3804 if ( in_current_building_type < BildingType_19 )
3805 { 3805 {
3806 v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_bilding_type], TEXTURE_16BIT_PALETTE); 3806 v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_building_type], TEXTURE_16BIT_PALETTE);
3807 //v3 = dword_F8B198; 3807 //v3 = dword_F8B198;
3808 dword_F8B164 = &pIcons_LOD->pTextures[v9]; 3808 dword_F8B164 = &pIcons_LOD->pTextures[v9];
3809 LABEL_13: 3809 LABEL_13:
3810 v8 = window_SpeakInHouse; 3810 v8 = window_SpeakInHouse;
3811 } 3811 }
3812 if ( in_current_bilding_type > BildingType_Tavern ) 3812 if ( in_current_building_type > BildingType_Tavern )
3813 { 3813 {
3814 if ( in_current_bilding_type == BildingType_Bank ) 3814 if ( in_current_building_type == BildingType_Bank )
3815 { 3815 {
3816 if ( dword_F8B19C >= 7 && dword_F8B19C <= 8 ) 3816 if ( dword_F8B19C >= 7 && dword_F8B19C <= 8 )
3817 pKeyActionMap->EnterText(1, 10, v8); 3817 pKeyActionMap->EnterText(1, 10, v8);
3818 return; 3818 return;
3819 } 3819 }
3820 if ( in_current_bilding_type != BildingType_Temple && in_current_bilding_type != BildingType_Training ) 3820 if ( in_current_building_type != BildingType_Temple && in_current_building_type != BildingType_Training )
3821 return; 3821 return;
3822 } 3822 }
3823 else 3823 else
3824 { 3824 {
3825 if ( in_current_bilding_type != BildingType_Tavern ) 3825 if ( in_current_building_type != BildingType_Tavern )
3826 { 3826 {
3827 if ( in_current_bilding_type <= (signed int)v1 ) 3827 if ( in_current_building_type <= (signed int)v1 )
3828 return; 3828 return;
3829 if ( in_current_bilding_type > BildingType_AlchemistShop ) 3829 if ( in_current_building_type > BildingType_AlchemistShop )
3830 { 3830 {
3831 if ( in_current_bilding_type <= BildingType_16 ) 3831 if ( in_current_building_type <= BildingType_16 )
3832 { 3832 {
3833 if ( (signed __int64)__PAIR__( 3833 if ( (signed __int64)__PAIR__(
3834 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472], 3834 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44472],
3835 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed ) 3835 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)v8->ptr_1C + 44468]) >= (signed __int64)pParty->uTimePlayed )
3836 { 3836 {
3860 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31; 3860 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31;
3861 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31); 3861 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31);
3862 } 3862 }
3863 return; 3863 return;
3864 } 3864 }
3865 if ( in_current_bilding_type != BildingType_TownHall ) 3865 if ( in_current_building_type != BildingType_TownHall )
3866 return; 3866 return;
3867 if ( uMessageParam == 99 ) 3867 if ( uMessageParam == 99 )
3868 { 3868 {
3869 v10 = (int)((char *)v8->ptr_1C - 102); 3869 v10 = (int)((char *)v8->ptr_1C - 102);
3870 v56 = v10; 3870 v56 = v10;
4076 switch ( uMessageParam ) 4076 switch ( uMessageParam )
4077 { 4077 {
4078 case 96: 4078 case 96:
4079 pDialogueWindow->eWindowType = WINDOW_MainMenu; 4079 pDialogueWindow->eWindowType = WINDOW_MainMenu;
4080 UI_CreateEndConversationButton(); 4080 UI_CreateEndConversationButton();
4081 FillAviableSkillsToTeach(in_current_bilding_type); 4081 FillAviableSkillsToTeach(in_current_building_type);
4082 break; 4082 break;
4083 case 101: 4083 case 101:
4084 pDialogueWindow->eWindowType = WINDOW_MainMenu; 4084 pDialogueWindow->eWindowType = WINDOW_MainMenu;
4085 UI_CreateEndConversationButton(); 4085 UI_CreateEndConversationButton();
4086 sub_4B3A72(in_current_bilding_type); 4086 sub_4B3A72(in_current_building_type);
4087 break; 4087 break;
4088 case 102: 4088 case 102:
4089 dword_F8B19C = 102; 4089 dword_F8B19C = 102;
4090 break; 4090 break;
4091 case 103: 4091 case 103:
4146 if ( !*(short *)v38 ) 4146 if ( !*(short *)v38 )
4147 { 4147 {
4148 if ( pParty->uNumGold < v37 ) 4148 if ( pParty->uNumGold < v37 )
4149 { 4149 {
4150 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); 4150 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
4151 if ( in_current_bilding_type == BildingType_Training || in_current_bilding_type == BildingType_Tavern ) 4151 if ( in_current_building_type == BildingType_Training || in_current_building_type == BildingType_Tavern )
4152 v39 = 4; 4152 v39 = 4;
4153 else 4153 else
4154 v39 = 2; 4154 v39 = 2;
4155 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v39); 4155 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v39);
4156 } 4156 }
4168 { 4168 {
4169 if ( uMessageParam == 94 ) 4169 if ( uMessageParam == 94 )
4170 { 4170 {
4171 pDialogueWindow->eWindowType = WINDOW_MainMenu; 4171 pDialogueWindow->eWindowType = WINDOW_MainMenu;
4172 UI_CreateEndConversationButton(); 4172 UI_CreateEndConversationButton();
4173 sub_4B3AD4(in_current_bilding_type); 4173 sub_4B3AD4(in_current_building_type);
4174 } 4174 }
4175 } 4175 }
4176 } 4176 }
4177 return; 4177 return;
4178 } 4178 }
4218 ++v43; 4218 ++v43;
4219 } 4219 }
4220 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ); 4220 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
4221 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] ); 4221 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
4222 } 4222 }
4223 if ( in_current_bilding_type == BildingType_WeaponShop ) 4223 if ( in_current_building_type == BildingType_WeaponShop )
4224 { 4224 {
4225 v47 = v8->ptr_1C; 4225 v47 = v8->ptr_1C;
4226 v48 = 0; 4226 v48 = 0;
4227 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ) 4227 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
4228 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] ) 4228 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
4263 ++v43; 4263 ++v43;
4264 } 4264 }
4265 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ); 4265 //while ( v43 < (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] );
4266 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] ); 4266 while ( v43 < (unsigned __int8)uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] );
4267 } 4267 }
4268 if ( in_current_bilding_type == BildingType_WeaponShop ) 4268 if ( in_current_building_type == BildingType_WeaponShop )
4269 { 4269 {
4270 v52 = v8->ptr_1C; 4270 v52 = v8->ptr_1C;
4271 v53 = 0; 4271 v53 = 0;
4272 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ) 4272 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] )
4273 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] ) 4273 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] )
4332 { 4332 {
4333 if ( v0 == 3 || v0 == 5 || v0 == 4 ) 4333 if ( v0 == 3 || v0 == 5 || v0 == 4 )
4334 { 4334 {
4335 UI_CreateEndConversationButton(); 4335 UI_CreateEndConversationButton();
4336 dword_F8B19C = 94; 4336 dword_F8B19C = 94;
4337 sub_4B3AD4(in_current_bilding_type); 4337 sub_4B3AD4(in_current_building_type);
4338 } 4338 }
4339 else 4339 else
4340 { 4340 {
4341 if ( v0 != 102 && v0 != 103 && v0 != 104 ) 4341 if ( v0 != 102 && v0 != 103 && v0 != 104 )
4342 { 4342 {
4343 pVideoPlayer->_4BF5B2(); 4343 pVideoPlayer->_4BF5B2();
4344 LABEL_28: 4344 LABEL_28:
4345 dword_F8B19C = 1; 4345 dword_F8B19C = 1;
4346 sub_4B3B42(in_current_bilding_type); 4346 sub_4B3B42(in_current_building_type);
4347 return 1; 4347 return 1;
4348 } 4348 }
4349 pVideoPlayer->_4BF5B2(); 4349 pVideoPlayer->_4BF5B2();
4350 UI_CreateEndConversationButton(); 4350 UI_CreateEndConversationButton();
4351 dword_F8B19C = 101; 4351 dword_F8B19C = 101;
4352 sub_4B3A72(in_current_bilding_type); 4352 sub_4B3A72(in_current_building_type);
4353 } 4353 }
4354 return 1; 4354 return 1;
4355 } 4355 }
4356 pVideoPlayer->_4BF5B2(); 4356 pVideoPlayer->_4BF5B2();
4357 UI_CreateEndConversationButton(); 4357 UI_CreateEndConversationButton();
4510 { 4510 {
4511 if ( pParty->uNumGold < v44 ) 4511 if ( pParty->uNumGold < v44 )
4512 { 4512 {
4513 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold" 4513 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
4514 v13 = window_SpeakInHouse->ptr_1C; 4514 v13 = window_SpeakInHouse->ptr_1C;
4515 if ( in_current_bilding_type == BildingType_Training ) 4515 if ( in_current_building_type == BildingType_Training )
4516 v55 = 4; 4516 v55 = 4;
4517 else 4517 else
4518 v55 = 2; 4518 v55 = 2;
4519 goto LABEL_84; 4519 goto LABEL_84;
4520 } 4520 }
5035 pRenderer->BeginScene(); 5035 pRenderer->BeginScene();
5036 pRenderer->ClearBlack(); 5036 pRenderer->ClearBlack();
5037 pRenderer->EndScene(); 5037 pRenderer->EndScene();
5038 pRenderer->Present(); 5038 pRenderer->Present();
5039 pVideoPlayer->pResetflag = 0; 5039 pVideoPlayer->pResetflag = 0;
5040 _449B57_test_bit(pParty->_award_bits, 99); 5040 _449B57_test_bit(pParty->_quest_bits, 99);
5041 _this.Load("winbg.pcx", 2); 5041 _this.Load("winbg.pcx", 2);
5042 pRenderer->BeginScene(); 5042 pRenderer->BeginScene();
5043 pRenderer->DrawTextureRGB(0, 0, &_this); 5043 pRenderer->DrawTextureRGB(0, 0, &_this);
5044 pRenderer->EndScene(); 5044 pRenderer->EndScene();
5045 free(_this.pPixels); 5045 free(_this.pPixels);
5050 pWindow.uFrameWidth = 469; 5050 pWindow.uFrameWidth = 469;
5051 pWindow.uFrameHeight = 338; 5051 pWindow.uFrameHeight = 338;
5052 pWindow.uFrameZ = 543; 5052 pWindow.uFrameZ = 543;
5053 pWindow.uFrameW = 397; 5053 pWindow.uFrameW = 397;
5054 pFont = LoadFont("endgame.fnt", "FONTPAL", NULL); 5054 pFont = LoadFont("endgame.fnt", "FONTPAL", NULL);
5055 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 99) ) 5055 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 99) )
5056 { 5056 {
5057 v1 = pGlobalTXT_LocalizationStrings[675]; 5057 v1 = pGlobalTXT_LocalizationStrings[675];
5058 } 5058 }
5059 else 5059 else
5060 { 5060 {
5061 result = _449B57_test_bit(pParty->_award_bits, 100); 5061 result = _449B57_test_bit(pParty->_quest_bits, 100);
5062 if ( !(short)result ) 5062 if ( !(short)result )
5063 return result; 5063 return result;
5064 v1 = pGlobalTXT_LocalizationStrings[676]; 5064 v1 = pGlobalTXT_LocalizationStrings[676];
5065 } 5065 }
5066 pInString = v1; 5066 pInString = v1;
14952 return 1; 14952 return 1;
14953 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName; 14953 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName;
14954 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24); 14954 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24);
14955 ShowStatusBarString(pTmpBuf2, 2u); 14955 ShowStatusBarString(pTmpBuf2, 2u);
14956 if ( v19->uItemID == 506 ) 14956 if ( v19->uItemID == 506 )
14957 _449B7E_toggle_bit(pParty->_award_bits, 184, 1u); 14957 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u);
14958 if ( v19->uItemID == 455 ) 14958 if ( v19->uItemID == 455 )
14959 _449B7E_toggle_bit(pParty->_award_bits, 185, 1u); 14959 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u);
14960 if ( !pParty->AddItem(v19) ) 14960 if ( !pParty->AddItem(v19) )
14961 pParty->SetHoldingItem(v19); 14961 pParty->SetHoldingItem(v19);
14962 v21 = v26; 14962 v21 = v26;
14963 } 14963 }
14964 LayingItem::OnItemPickup(v21); 14964 LayingItem::OnItemPickup(v21);