comparison mm7_4.cpp @ 336:ea55d6414029

Event_proceccor preliminary
author Gloval
date Thu, 21 Feb 2013 00:33:12 +0400
parents 8e23edf57e27
children a8ee15a20bea
comparison
equal deleted inserted replaced
329:f76027321087 336:ea55d6414029
9111 v4 = pMouse->GetCursorPos((POINT *)&v11); 9111 v4 = pMouse->GetCursorPos((POINT *)&v11);
9112 v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v10)->y]] & 0xFFFF; 9112 v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v10)->y]] & 0xFFFF;
9113 v18 = v5; 9113 v18 = v5;
9114 if ( !v5 ) 9114 if ( !v5 )
9115 return; 9115 return;
9116 v6 = 9 * (v5 + 12 * (unsigned int)ptr_507BC0->ptr_1C); 9116 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C);
9117 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4); 9117 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
9118 if ( dword_F8B19C != 2 ) 9118 if ( dword_F8B19C != 2 )
9119 v7 = (ItemGen *)&pParty->field_C59C[v6 + 715]; 9119 v7 = (ItemGen *)&pParty->field_C59C[v6 + 715];
9120 goto LABEL_15; 9120 goto LABEL_15;
9121 } 9121 }
9124 v1 = pMouse->GetCursorPos(&a2); 9124 v1 = pMouse->GetCursorPos(&a2);
9125 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v16)->y]; 9125 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v16)->y];
9126 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; 9126 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
9127 v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF; 9127 v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
9128 if ( v18 ) 9128 if ( v18 )
9129 sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)ptr_507BC0->ptr_1C)); 9129 sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C));
9130 } 9130 }
9131 } 9131 }
9132 // F8B198: using guessed type int dword_F8B198; 9132 // F8B198: using guessed type int dword_F8B198;
9133 // F8B19C: using guessed type int dword_F8B19C; 9133 // F8B19C: using guessed type int dword_F8B19C;
9134 9134
9196 else 9196 else
9197 { 9197 {
9198 if ( dword_F8B198 != 23 ) 9198 if ( dword_F8B198 != 23 )
9199 return; 9199 return;
9200 } 9200 }
9201 v1 = (unsigned int)ptr_507BC0->ptr_1C; 9201 v1 = (unsigned int)window_SpeakInHouse->ptr_1C;
9202 LABEL_28: 9202 LABEL_28:
9203 HousePlaySomeSound(v1, v0); 9203 HousePlaySomeSound(v1, v0);
9204 return; 9204 return;
9205 } 9205 }
9206 v1 = (unsigned int)ptr_507BC0->ptr_1C; 9206 v1 = (unsigned int)window_SpeakInHouse->ptr_1C;
9207 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 ) 9207 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 )
9208 { 9208 {
9209 if ( pParty->uNumGold <= 0x2710 ) 9209 if ( pParty->uNumGold <= 0x2710 )
9210 { 9210 {
9211 if ( !dword_F8B1E4 ) 9211 if ( !dword_F8B1E4 )
9647 v22 = pParty->pHireling1Name; 9647 v22 = pParty->pHireling1Name;
9648 } 9648 }
9649 strcpy(v22, v24); 9649 strcpy(v22, v24);
9650 pParty->field_709 = 0; 9650 pParty->field_709 = 0;
9651 sub_44A56A(); 9651 sub_44A56A();
9652 PrepareHouse((unsigned int)ptr_507BC0->ptr_1C); 9652 PrepareHouse((unsigned int)window_SpeakInHouse->ptr_1C);
9653 dword_F8B19C = 1; 9653 dword_F8B19C = 1;
9654 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 9654 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
9655 { 9655 {
9656 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 9656 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
9657 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; 9657 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
10442 while ( 1 ) 10442 while ( 1 )
10443 { 10443 {
10444 v19 = 1; 10444 v19 = 1;
10445 do 10445 do
10446 { 10446 {
10447 v20 = (char *)ptr_507BC0->ptr_1C + 4 * (unsigned int)ptr_507BC0->ptr_1C + v19; 10447 v20 = (char *)window_SpeakInHouse->ptr_1C + 4 * (unsigned int)window_SpeakInHouse->ptr_1C + v19;
10448 if ( v1 ) 10448 if ( v1 )
10449 v21 = word_4F063E[(signed int)v20]; 10449 v21 = word_4F063E[(signed int)v20];
10450 else 10450 else
10451 v21 = word_4F03FE[(signed int)v20]; 10451 v21 = word_4F03FE[(signed int)v20];
10452 v22 = v21 - 23; 10452 v22 = v21 - 23;
10522 do 10522 do
10523 { 10523 {
10524 v12 = 1; 10524 v12 = 1;
10525 do 10525 do
10526 { 10526 {
10527 v13 = v11 + 2 * (unsigned int)ptr_507BC0->ptr_1C - 30; 10527 v13 = v11 + 2 * (unsigned int)window_SpeakInHouse->ptr_1C - 30;
10528 v14 = v12 + 4 * v13 + v13; 10528 v14 = v12 + 4 * v13 + v13;
10529 if ( v10 ) 10529 if ( v10 )
10530 v15 = word_4F06D8[v14]; 10530 v15 = word_4F06D8[v14];
10531 else 10531 else
10532 v15 = word_4F0498[v14]; 10532 v15 = word_4F0498[v14];
10922 goto LABEL_43; 10922 goto LABEL_43;
10923 sub_4B36CC(0, 0xFu); 10923 sub_4B36CC(0, 0xFu);
10924 sub_4B36CC(1, 0x10u); 10924 sub_4B36CC(1, 0x10u);
10925 v4 = 3; 10925 v4 = 3;
10926 sub_4B36CC(2, 0x60u); 10926 sub_4B36CC(2, 0x60u);
10927 v5 = (signed int)ptr_507BC0->ptr_1C; 10927 v5 = (signed int)window_SpeakInHouse->ptr_1C;
10928 if ( v5 < 108 || v5 > 120 ) 10928 if ( v5 < 108 || v5 > 120 )
10929 goto LABEL_28; 10929 goto LABEL_28;
10930 v4 = 4; 10930 v4 = 4;
10931 v6 = 101; 10931 v6 = 101;
10932 v7 = 3; 10932 v7 = 3;
11542 int v71; // [sp+78h] [bp-Ch]@1 11542 int v71; // [sp+78h] [bp-Ch]@1
11543 int v72; // [sp+7Ch] [bp-8h]@16 11543 int v72; // [sp+7Ch] [bp-8h]@16
11544 int v73; // [sp+80h] [bp-4h]@14 11544 int v73; // [sp+80h] [bp-4h]@14
11545 11545
11546 v0 = pPlayers[uActiveCharacter]; 11546 v0 = pPlayers[uActiveCharacter];
11547 memcpy(&v65, ptr_507BC0, sizeof(v65)); 11547 memcpy(&v65, window_SpeakInHouse, sizeof(v65));
11548 v65.uFrameX = 483; 11548 v65.uFrameX = 483;
11549 v65.uFrameWidth = 148; 11549 v65.uFrameWidth = 148;
11550 v65.uFrameZ = 334; 11550 v65.uFrameZ = 334;
11551 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 11551 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
11552 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 11552 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
11556 v4 = 0; 11556 v4 = 0;
11557 for ( i = v2; v4 < (signed int)v2; ++v4 ) 11557 for ( i = v2; v4 < (signed int)v2; ++v4 )
11558 v3 += v4 + 1; 11558 v3 += v4 + 1;
11559 v5 = 1000 * v3; 11559 v5 = 1000 * v3;
11560 v6 = HIDWORD(v0->uExperience); 11560 v6 = HIDWORD(v0->uExperience);
11561 v7 = ptr_507BC0->ptr_1C; 11561 v7 = window_SpeakInHouse->ptr_1C;
11562 v68 = (unsigned __int16)word_4F0866[(signed int)v7]; 11562 v68 = (unsigned __int16)word_4F0866[(signed int)v7];
11563 v66 = 1000 * v3; 11563 v66 = 1000 * v3;
11564 if ( (signed __int64)__PAIR__(v6, LODWORD(v0->uExperience)) >= v66 ) 11564 if ( (signed __int64)__PAIR__(v6, LODWORD(v0->uExperience)) >= v66 )
11565 { 11565 {
11566 v8 = v0->classType % 4 + 1; 11566 v8 = v0->classType % 4 + 1;
11590 if ( result ) 11590 if ( result )
11591 { 11591 {
11592 i = 0; 11592 i = 0;
11593 v13 = pDialogueWindow; 11593 v13 = pDialogueWindow;
11594 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); 11594 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
11595 v14 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0); 11595 v14 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0);
11596 v73 = v14 * (100 - v0->GetMerchant()) / 100; 11596 v73 = v14 * (100 - v0->GetMerchant()) / 100;
11597 if ( v73 < v14 / 3 ) 11597 if ( v73 < v14 / 3 )
11598 v73 = v14 / 3; 11598 v73 = v14 / 3;
11599 v15 = v13->pStartingPosActiveItem; 11599 v15 = v13->pStartingPosActiveItem;
11600 v16 = v13->pNumPresenceButton; 11600 v16 = v13->pNumPresenceButton;
11693 if ( (signed __int64)v0->uExperience >= v66 ) 11693 if ( (signed __int64)v0->uExperience >= v66 )
11694 { 11694 {
11695 if ( pParty->uNumGold >= i ) 11695 if ( pParty->uNumGold >= i )
11696 { 11696 {
11697 Party::TakeGold(i); 11697 Party::TakeGold(i);
11698 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); 11698 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
11699 ++v0->uLevel; 11699 ++v0->uLevel;
11700 v0->uSkillPoints += v0->uLevel / 10 + 5; 11700 v0->uSkillPoints += v0->uLevel / 10 + 5;
11701 v0->sHealth = v0->GetMaxHealth(); 11701 v0->sHealth = v0->GetMaxHealth();
11702 v0->sMana = v0->GetMaxMana(); 11702 v0->sMana = v0->GetMaxMana();
11703 v37 = 0; 11703 v37 = 0;
11712 v39 = &dword_F8B144 + uActiveCharacter; 11712 v39 = &dword_F8B144 + uActiveCharacter;
11713 ++*v39; 11713 ++*v39;
11714 if ( *v39 > v37 ) 11714 if ( *v39 > v37 )
11715 { 11715 {
11716 v40 = sub_494820(pParty->uCurrentHour); 11716 v40 = sub_494820(pParty->uCurrentHour);
11717 v41 = ptr_507BC0->ptr_1C; 11717 v41 = window_SpeakInHouse->ptr_1C;
11718 v42 = 60 * (v40 + 4) - pParty->uCurrentMinute; 11718 v42 = 60 * (v40 + 4) - pParty->uCurrentMinute;
11719 if ( v41 == (void *)94 || v41 == (void *)95 ) 11719 if ( v41 == (void *)94 || v41 == (void *)95 )
11720 v42 += 720; 11720 v42 += 720;
11721 RestAndHeal((signed int)(v42 + 10080)); 11721 RestAndHeal((signed int)(v42 + 10080));
11722 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) 11722 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
11729 goto LABEL_56; 11729 goto LABEL_56;
11730 } 11730 }
11731 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold" 11731 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
11732 v63 = 4; 11732 v63 = 4;
11733 LABEL_55: 11733 LABEL_55:
11734 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v63); 11734 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v63);
11735 LABEL_56: 11735 LABEL_56:
11736 result = pMessageQueue_50CBD0->uNumMessages; 11736 result = pMessageQueue_50CBD0->uNumMessages;
11737 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 11737 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
11738 { 11738 {
11739 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 11739 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
11988 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14 11988 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14
11989 int v122; // [sp+F4h] [bp-4h]@23 11989 int v122; // [sp+F4h] [bp-4h]@23
11990 11990
11991 v0 = pPlayers[uActiveCharacter]; 11991 v0 = pPlayers[uActiveCharacter];
11992 _this = pPlayers[uActiveCharacter]; 11992 _this = pPlayers[uActiveCharacter];
11993 memcpy(&v112, ptr_507BC0, sizeof(v112)); 11993 memcpy(&v112, window_SpeakInHouse, sizeof(v112));
11994 v112.uFrameX = 483; 11994 v112.uFrameX = 483;
11995 v112.uFrameWidth = 148; 11995 v112.uFrameWidth = 148;
11996 v112.uFrameZ = 334; 11996 v112.uFrameZ = 334;
11997 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 11997 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
11998 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 11998 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
12058 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 12058 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
12059 if ( result ) 12059 if ( result )
12060 { 12060 {
12061 v31 = pDialogueWindow; 12061 v31 = pDialogueWindow;
12062 v3 = 0; 12062 v3 = 0;
12063 v32 = ptr_507BC0->ptr_1C; 12063 v32 = window_SpeakInHouse->ptr_1C;
12064 v118 = 0; 12064 v118 = 0;
12065 //v33 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v32] * 500.0); 12065 //v33 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v32] * 500.0);
12066 v33 = (signed __int64)(p2DEvents[(signed int)v32 - 1].flt_24 * 500.0); 12066 v33 = (signed __int64)(p2DEvents[(signed int)v32 - 1].flt_24 * 500.0);
12067 v119 = (const char **)(v33 * (100 - _this->GetMerchant()) / 100); 12067 v119 = (const char **)(v33 * (100 - _this->GetMerchant()) / 100);
12068 if ( (signed int)v119 < v33 / 3 ) 12068 if ( (signed int)v119 < v33 / 3 )
12169 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) 12169 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
12170 || (result *= 9, !(_this->field_1F5[4 * result + 15] & 2)) ) 12170 || (result *= 9, !(_this->field_1F5[4 * result + 15] & 2)) )
12171 return result; 12171 return result;
12172 v96 = 0; 12172 v96 = 0;
12173 v94 = 5; 12173 v94 = 5;
12174 v93 = ptr_507BC0->ptr_1C; 12174 v93 = window_SpeakInHouse->ptr_1C;
12175 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5]; 12175 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5];
12176 v28 = (int)ptr_507BC0->ptr_1C; 12176 v28 = (int)window_SpeakInHouse->ptr_1C;
12177 uPlayerID = uActiveCharacter - 1; 12177 uPlayerID = uActiveCharacter - 1;
12178 v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5); 12178 v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5);
12179 v9 = uPlayerID; 12179 v9 = uPlayerID;
12180 v10 = (char *)pMerchantsRepairPhrases[v29]; 12180 v10 = (char *)pMerchantsRepairPhrases[v29];
12181 goto LABEL_35; 12181 goto LABEL_35;
12263 v96 = 0; 12263 v96 = 0;
12264 v94 = 4; 12264 v94 = 4;
12265 v4 = (char *)&_this->pInventoryItems[result-1]; 12265 v4 = (char *)&_this->pInventoryItems[result-1];
12266 if ( v4[20] & 1 ) 12266 if ( v4[20] & 1 )
12267 { 12267 {
12268 v5 = BuilDialogueString("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)ptr_507BC0->ptr_1C, 4, 0); 12268 v5 = BuilDialogueString("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)window_SpeakInHouse->ptr_1C, 4, 0);
12269 v97 = 3; 12269 v97 = 3;
12270 v95 = v5; 12270 v95 = v5;
12271 v92 = white; 12271 v92 = white;
12272 v6 = (212 - pFontArrus->CalcTextHeight(v5, &v112, 0, 0)) / 2 + 101; 12272 v6 = (212 - pFontArrus->CalcTextHeight(v5, &v112, 0, 0)) / 2 + 101;
12273 return (int)v112.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97); 12273 return (int)v112.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97);
12274 } 12274 }
12275 v93 = ptr_507BC0->ptr_1C; 12275 v93 = window_SpeakInHouse->ptr_1C;
12276 v90 = (ItemGen *)v4; 12276 v90 = (ItemGen *)v4;
12277 v7 = (int)ptr_507BC0->ptr_1C; 12277 v7 = (int)window_SpeakInHouse->ptr_1C;
12278 uPlayerID = uActiveCharacter - 1; 12278 uPlayerID = uActiveCharacter - 1;
12279 v8 = ((Player *)_this)->_490EEE((ItemGen *)v4, 3, v7, 4); 12279 v8 = ((Player *)_this)->_490EEE((ItemGen *)v4, 3, v7, 4);
12280 v9 = uPlayerID; 12280 v9 = uPlayerID;
12281 v10 = (char *)pMerchantsIdentifyPhrases[v8]; 12281 v10 = (char *)pMerchantsIdentifyPhrases[v8];
12282 goto LABEL_35; 12282 goto LABEL_35;
12299 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462) 12299 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462)
12300 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) 12300 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) )
12301 return result; 12301 return result;
12302 v96 = 0; 12302 v96 = 0;
12303 v94 = 3; 12303 v94 = 3;
12304 v93 = ptr_507BC0->ptr_1C; 12304 v93 = window_SpeakInHouse->ptr_1C;
12305 v90 = (ItemGen *)&_this->pInventoryItems[result-1]; 12305 v90 = (ItemGen *)&_this->pInventoryItems[result-1];
12306 v12 = (int)ptr_507BC0->ptr_1C; 12306 v12 = (int)window_SpeakInHouse->ptr_1C;
12307 uPlayerID = uActiveCharacter - 1; 12307 uPlayerID = uActiveCharacter - 1;
12308 v13 = _this->_490EEE(v90, 3, v12, 3); 12308 v13 = _this->_490EEE(v90, 3, v12, 3);
12309 v9 = uPlayerID; 12309 v9 = uPlayerID;
12310 v10 = (char *)pMerchantsSellPhrases[v13]; 12310 v10 = (char *)pMerchantsSellPhrases[v13];
12311 LABEL_35: 12311 LABEL_35:
12327 v122 = 0; 12327 v122 = 0;
12328 if ( dword_F8B19C == 2 ) 12328 if ( dword_F8B19C == 2 )
12329 { 12329 {
12330 do 12330 do
12331 { 12331 {
12332 if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) 12332 if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
12333 { 12333 {
12334 v50 = dword_F8B168[v49]; 12334 v50 = dword_F8B168[v49];
12335 v51 = 152 - v50->uTextureHeight; 12335 v51 = 152 - v50->uTextureHeight;
12336 if ( (signed int)v51 < 1 ) 12336 if ( (signed int)v51 < 1 )
12337 v51 = 0; 12337 v51 = 0;
12359 } 12359 }
12360 while ( v49 < 6 ); 12360 while ( v49 < 6 );
12361 v122 = 0; 12361 v122 = 0;
12362 do 12362 do
12363 { 12363 {
12364 if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 54] ) 12364 if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
12365 { 12365 {
12366 v54 = dword_F8B168[v122 + 6]; 12366 v54 = dword_F8B168[v122 + 6];
12367 v55 = 306 - v54->uTextureHeight; 12367 v55 = 306 - v54->uTextureHeight;
12368 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40; 12368 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40;
12369 if ( v122 ) 12369 if ( v122 )
12389 } 12389 }
12390 else 12390 else
12391 { 12391 {
12392 do 12392 do
12393 { 12393 {
12394 if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) 12394 if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
12395 { 12395 {
12396 v58 = dword_F8B168[v49]; 12396 v58 = dword_F8B168[v49];
12397 v59 = 152 - v58->uTextureHeight; 12397 v59 = 152 - v58->uTextureHeight;
12398 if ( (signed int)v59 < 1 ) 12398 if ( (signed int)v59 < 1 )
12399 v59 = 0; 12399 v59 = 0;
12421 } 12421 }
12422 while ( v49 < 6 ); 12422 while ( v49 < 6 );
12423 v122 = 0; 12423 v122 = 0;
12424 do 12424 do
12425 { 12425 {
12426 if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 778] ) 12426 if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] )
12427 { 12427 {
12428 v62 = dword_F8B168[v122 + 6]; 12428 v62 = dword_F8B168[v122 + 6];
12429 v63 = 306 - v62->uTextureHeight; 12429 v63 = 306 - v62->uTextureHeight;
12430 if ( (signed int)v63 < 1 ) 12430 if ( (signed int)v63 < 1 )
12431 v63 = 0; 12431 v63 = 0;
12458 v117 = 0; 12458 v117 = 0;
12459 if ( dword_F8B19C == 2 ) 12459 if ( dword_F8B19C == 2 )
12460 { 12460 {
12461 do 12461 do
12462 { 12462 {
12463 if ( pParty->field_777C[9 * (v66 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) 12463 if ( pParty->field_777C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
12464 ++v117; 12464 ++v117;
12465 ++v66; 12465 ++v66;
12466 } 12466 }
12467 while ( v66 < 12 ); 12467 while ( v66 < 12 );
12468 } 12468 }
12469 else 12469 else
12470 { 12470 {
12471 do 12471 do
12472 { 12472 {
12473 if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) 12473 if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
12474 ++v117; 12474 ++v117;
12475 ++v66; 12475 ++v66;
12476 } 12476 }
12477 while ( v66 < 12 ); 12477 while ( v66 < 12 );
12478 } 12478 }
12491 } 12491 }
12492 sub_4B46A5(v69, 0); 12492 sub_4B46A5(v69, 0);
12493 if ( !v117 ) 12493 if ( !v117 )
12494 return (int)v112._4B1854( 12494 return (int)v112._4B1854(
12495 __PAIR__( 12495 __PAIR__(
12496 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1], 12496 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1],
12497 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C]) 12497 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C])
12498 - pParty->uTimePlayed); 12498 - pParty->uTimePlayed);
12499 v70 = pMouse->GetCursorPos(&v102); 12499 v70 = pMouse->GetCursorPos(&v102);
12500 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y]; 12500 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
12501 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) 12501 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
12502 { 12502 {
12503 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; 12503 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
12504 v117 = v71; 12504 v117 = v71;
12505 v72 = (int)ptr_507BC0->ptr_1C; 12505 v72 = (int)window_SpeakInHouse->ptr_1C;
12506 v73 = 9 * (v71 + 12 * v72); 12506 v73 = 9 * (v71 + 12 * v72);
12507 v74 = (ItemGen *)&pParty->field_777C[v73]; 12507 v74 = (ItemGen *)&pParty->field_777C[v73];
12508 if ( dword_F8B19C != 2 ) 12508 if ( dword_F8B19C != 2 )
12509 v74 = (ItemGen *)&pParty->field_C59C[v73 + 724]; 12509 v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
12510 if ( v67 && Str ) 12510 if ( v67 && Str )
12511 { 12511 {
12512 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" 12512 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
12513 v96 = 0; 12513 v96 = 0;
12514 v94 = 2; 12514 v94 = 2;
12515 v93 = ptr_507BC0->ptr_1C; 12515 v93 = window_SpeakInHouse->ptr_1C;
12516 v90 = v74; 12516 v90 = v74;
12517 v9 = uActiveCharacter - 1; 12517 v9 = uActiveCharacter - 1;
12518 } 12518 }
12519 else 12519 else
12520 { 12520 {
12521 v96 = 0; 12521 v96 = 0;
12522 v94 = 2; 12522 v94 = 2;
12523 v93 = ptr_507BC0->ptr_1C; 12523 v93 = window_SpeakInHouse->ptr_1C;
12524 v90 = v74; 12524 v90 = v74;
12525 uPlayerID = uActiveCharacter - 1; 12525 uPlayerID = uActiveCharacter - 1;
12526 v75 = _this->_490EEE(v74, 3, v72, 2); 12526 v75 = _this->_490EEE(v74, 3, v72, 2);
12527 v9 = uPlayerID; 12527 v9 = uPlayerID;
12528 v10 = (char *)pMerchantsBuyPhrases[v75]; 12528 v10 = (char *)pMerchantsBuyPhrases[v75];
12925 char *Str; // [sp+2DCh] [bp-10h]@35 12925 char *Str; // [sp+2DCh] [bp-10h]@35
12926 int v61; // [sp+2E0h] [bp-Ch]@35 12926 int v61; // [sp+2E0h] [bp-Ch]@35
12927 unsigned int v62; // [sp+2E4h] [bp-8h]@13 12927 unsigned int v62; // [sp+2E4h] [bp-8h]@13
12928 int v63; // [sp+2E8h] [bp-4h]@1 12928 int v63; // [sp+2E8h] [bp-4h]@1
12929 12929
12930 v0 = ptr_507BC0; 12930 v0 = window_SpeakInHouse;
12931 memcpy(&v52, ptr_507BC0, sizeof(v52)); 12931 memcpy(&v52, window_SpeakInHouse, sizeof(v52));
12932 v58 = pPlayers[uActiveCharacter]; 12932 v58 = pPlayers[uActiveCharacter];
12933 v1 = v58; 12933 v1 = v58;
12934 v52.uFrameX = 483; 12934 v52.uFrameX = 483;
12935 v53 = 148; 12935 v53 = 148;
12936 v54 = 334; 12936 v54 = 334;
12962 else 12962 else
12963 { 12963 {
12964 if ( pParty->uNumGold < v63 ) 12964 if ( pParty->uNumGold < v63 )
12965 { 12965 {
12966 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); 12966 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
12967 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); 12967 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
12968 } 12968 }
12969 else 12969 else
12970 { 12970 {
12971 Party::TakeGold(v63); 12971 Party::TakeGold(v63);
12972 *(short *)v3 = 1; 12972 *(short *)v3 = 1;
12989 v6 = 0; 12989 v6 = 0;
12990 v62 = 0; 12990 v62 = 0;
12991 v63 = 32; 12991 v63 = 32;
12992 do 12992 do
12993 { 12993 {
12994 if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)ptr_507BC0->ptr_1C)) ) 12994 if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) )
12995 { 12995 {
12996 pRenderer->DrawTextureTransparent(v63, 0x5Au, dword_F8B168[v6]); 12996 pRenderer->DrawTextureTransparent(v63, 0x5Au, dword_F8B168[v6]);
12997 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), dword_F8B168[v6], v6 + 1); 12997 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), dword_F8B168[v6], v6 + 1);
12998 v1 = v58; 12998 v1 = v58;
12999 } 12999 }
13005 v62 = 1680; 13005 v62 = 1680;
13006 v7 = 6; 13006 v7 = 6;
13007 v63 = 32; 13007 v63 = 32;
13008 do 13008 do
13009 { 13009 {
13010 if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)ptr_507BC0->ptr_1C)) ) 13010 if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) )
13011 { 13011 {
13012 pRenderer->DrawTextureTransparent(v63, 0xFAu, dword_F8B168[v7]); 13012 pRenderer->DrawTextureTransparent(v63, 0xFAu, dword_F8B168[v7]);
13013 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), dword_F8B168[v7], v7 + 1); 13013 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), dword_F8B168[v7], v7 + 1);
13014 v1 = v58; 13014 v1 = v58;
13015 } 13015 }
13021 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 13021 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
13022 if ( result ) 13022 if ( result )
13023 { 13023 {
13024 v8 = 0; 13024 v8 = 0;
13025 v9 = 12; 13025 v9 = 12;
13026 v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)ptr_507BC0->ptr_1C); 13026 v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)window_SpeakInHouse->ptr_1C);
13027 do 13027 do
13028 { 13028 {
13029 if ( *(int *)v10 ) 13029 if ( *(int *)v10 )
13030 ++v8; 13030 ++v8;
13031 v10 += 36; 13031 v10 += 36;
13038 v11 = pGlobalTXT_LocalizationStrings[196]; 13038 v11 = pGlobalTXT_LocalizationStrings[196];
13039 sub_4B46A5(v11, 0); 13039 sub_4B46A5(v11, 0);
13040 if ( !v8 ) 13040 if ( !v8 )
13041 return (int)v52._4B1854( 13041 return (int)v52._4B1854(
13042 __PAIR__( 13042 __PAIR__(
13043 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)ptr_507BC0->ptr_1C + 44472], 13043 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472],
13044 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)ptr_507BC0->ptr_1C + 44468]) 13044 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468])
13045 - pParty->uTimePlayed); 13045 - pParty->uTimePlayed);
13046 v12 = pMouse->GetCursorPos(&v51); 13046 v12 = pMouse->GetCursorPos(&v51);
13047 result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y]; 13047 result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y];
13048 v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF; 13048 v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF;
13049 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) 13049 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
13050 { 13050 {
13051 v14 = ptr_507BC0->ptr_1C; 13051 v14 = window_SpeakInHouse->ptr_1C;
13052 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14)); 13052 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
13053 v16 = (int)ptr_507BC0->ptr_1C; 13053 v16 = (int)window_SpeakInHouse->ptr_1C;
13054 uPlayerID = uActiveCharacter - 1; 13054 uPlayerID = uActiveCharacter - 1;
13055 v17 = v1->_490EEE( 13055 v17 = v1->_490EEE(
13056 (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, 13056 (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14,
13057 3, 13057 3,
13058 v16, 13058 v16,
13071 } 13071 }
13072 return result; 13072 return result;
13073 } 13073 }
13074 if ( !(unsigned __int16)_449B57_test_bit( 13074 if ( !(unsigned __int16)_449B57_test_bit(
13075 (unsigned __int8 *)v1->field_152, 13075 (unsigned __int8 *)v1->field_152,
13076 word_4F0704[2 * (unsigned int)ptr_507BC0->ptr_1C]) ) 13076 word_4F0704[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
13077 { 13077 {
13078 v36 = pNPCTopics[121].pText; 13078 v36 = pNPCTopics[121].pText;
13079 v37 = v57; 13079 v37 = v57;
13080 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &v52, 0, 0); 13080 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &v52, 0, 0);
13081 v52.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, v37, v36, 3u); 13081 v52.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, v37, v36, 3u);
13275 unsigned __int8 v63; // [sp+1B7h] [bp-Dh]@64 13275 unsigned __int8 v63; // [sp+1B7h] [bp-Dh]@64
13276 int v64; // [sp+1B8h] [bp-Ch]@6 13276 int v64; // [sp+1B8h] [bp-Ch]@6
13277 unsigned int v65; // [sp+1BCh] [bp-8h]@6 13277 unsigned int v65; // [sp+1BCh] [bp-8h]@6
13278 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6 13278 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
13279 13279
13280 v0 = ptr_507BC0; 13280 v0 = window_SpeakInHouse;
13281 memcpy(&v57, ptr_507BC0, sizeof(v57)); 13281 memcpy(&v57, window_SpeakInHouse, sizeof(v57));
13282 v57.uFrameX = 483; 13282 v57.uFrameX = 483;
13283 v57.uFrameWidth = 148; 13283 v57.uFrameWidth = 148;
13284 v57.uFrameZ = 334; 13284 v57.uFrameZ = 334;
13285 HIDWORD(v58) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 13285 HIDWORD(v58) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
13286 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 13286 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
13300 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 13300 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
13301 if ( result ) 13301 if ( result )
13302 { 13302 {
13303 v4 = pDialogueWindow; 13303 v4 = pDialogueWindow;
13304 v61 = pDialogueWindow; 13304 v61 = pDialogueWindow;
13305 v5 = ptr_507BC0->ptr_1C; 13305 v5 = window_SpeakInHouse->ptr_1C;
13306 v66 = 0; 13306 v66 = 0;
13307 //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0); 13307 //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0);
13308 v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0); 13308 v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0);
13309 v6 = v1->GetMerchant(); 13309 v6 = v1->GetMerchant();
13310 v64 = (signed int)(v65 * (100 - v6)) / 100; 13310 v64 = (signed int)(v65 * (100 - v6)) / 100;
13393 } 13393 }
13394 } 13394 }
13395 return result; 13395 return result;
13396 } 13396 }
13397 //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; 13397 //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
13398 v24 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier; 13398 v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier;
13399 v25 = 0; 13399 v25 = 0;
13400 if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 ) 13400 if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 )
13401 { 13401 {
13402 Party::TakeGold((signed __int64)v24); 13402 Party::TakeGold((signed __int64)v24);
13403 v26 = &pOutdoor->ddm; 13403 v26 = &pOutdoor->ddm;
13467 v25 = 0; 13467 v25 = 0;
13468 if ( pParty->uNumGold < v2 ) 13468 if ( pParty->uNumGold < v2 )
13469 { 13469 {
13470 LABEL_55: 13470 LABEL_55:
13471 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); 13471 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
13472 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); 13472 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
13473 goto LABEL_46; 13473 goto LABEL_46;
13474 } 13474 }
13475 Party::TakeGold(v2); 13475 Party::TakeGold(v2);
13476 v35 = LODWORD(v1->pConditions[17]); 13476 v35 = LODWORD(v1->pConditions[17]);
13477 v59 = v1->pConditions[14]; 13477 v59 = v1->pConditions[14];
13479 v60 = v1->pConditions[16]; 13479 v60 = v1->pConditions[16];
13480 v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]); 13480 v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]);
13481 memset(v1, 0, 0xA0u); 13481 memset(v1, 0, 0xA0u);
13482 v1->sHealth = v1->GetMaxHealth(); 13482 v1->sHealth = v1->GetMaxHealth();
13483 v1->sMana = v1->GetMaxMana(); 13483 v1->sMana = v1->GetMaxMana();
13484 v36 = (signed int)ptr_507BC0->ptr_1C; 13484 v36 = (signed int)window_SpeakInHouse->ptr_1C;
13485 if ( v36 != 78 && (v36 <= 80 || v36 > 82) ) 13485 if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
13486 { 13486 {
13487 if ( (unsigned int)v61 | v35 ) 13487 if ( (unsigned int)v61 | v35 )
13488 { 13488 {
13489 v37 = LOBYTE(v1->field_1928); 13489 v37 = LOBYTE(v1->field_1928);
13613 int v9; // eax@5 13613 int v9; // eax@5
13614 int v10; // eax@10 13614 int v10; // eax@10
13615 void *result; // eax@15 13615 void *result; // eax@15
13616 signed int v12; // [sp-4h] [bp-18h]@7 13616 signed int v12; // [sp-4h] [bp-18h]@7
13617 13617
13618 v0 = ptr_507BC0; 13618 v0 = window_SpeakInHouse;
13619 v1 = 0; 13619 v1 = 0;
13620 v2 = (int)&ptr_507BC0->ptr_1C; 13620 v2 = (int)&window_SpeakInHouse->ptr_1C;
13621 v3 = (signed int)ptr_507BC0->ptr_1C; 13621 v3 = (signed int)window_SpeakInHouse->ptr_1C;
13622 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] ) 13622 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] )
13623 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType] ) 13623 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
13624 { 13624 {
13625 while ( v3 > 14 ) 13625 while ( v3 > 14 )
13626 { 13626 {
13627 if ( v3 <= 28 ) 13627 if ( v3 <= 28 )
13628 { 13628 {
13648 v12 = 44; 13648 v12 = 44;
13649 LABEL_12: 13649 LABEL_12:
13650 v6 = v12; 13650 v6 = v12;
13651 LABEL_13: 13651 LABEL_13:
13652 pItemsTable->GenerateItem(v5, v6, (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]); 13652 pItemsTable->GenerateItem(v5, v6, (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]);
13653 v0 = ptr_507BC0; 13653 v0 = window_SpeakInHouse;
13654 v2 = (int)&ptr_507BC0->ptr_1C; 13654 v2 = (int)&window_SpeakInHouse->ptr_1C;
13655 pParty->field_C59C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 729] = 1; 13655 pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1;
13656 goto LABEL_14; 13656 goto LABEL_14;
13657 } 13657 }
13658 auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]; 13658 auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724];
13659 _a->Reset(); 13659 _a->Reset();
13660 v2 = (int)&v0->ptr_1C; 13660 v2 = (int)&v0->ptr_1C;
13661 v10 = rand(); 13661 v10 = rand();
13662 v0 = ptr_507BC0; 13662 v0 = window_SpeakInHouse;
13663 pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740; 13663 pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740;
13664 } 13664 }
13665 LABEL_14: 13665 LABEL_14:
13666 v3 = *(int *)v2; 13666 v3 = *(int *)v2;
13667 ++v1; 13667 ++v1;
13720 int v32; // [sp+6Ch] [bp-10h]@1 13720 int v32; // [sp+6Ch] [bp-10h]@1
13721 int v33; // [sp+70h] [bp-Ch]@17 13721 int v33; // [sp+70h] [bp-Ch]@17
13722 int v34; // [sp+74h] [bp-8h]@17 13722 int v34; // [sp+74h] [bp-8h]@17
13723 int v35; // [sp+78h] [bp-4h]@17 13723 int v35; // [sp+78h] [bp-4h]@17
13724 13724
13725 v0 = ptr_507BC0; 13725 v0 = window_SpeakInHouse;
13726 memcpy(&v28, ptr_507BC0, sizeof(v28)); 13726 memcpy(&v28, window_SpeakInHouse, sizeof(v28));
13727 v1 = pPlayers[uActiveCharacter]; 13727 v1 = pPlayers[uActiveCharacter];
13728 v28.uFrameX = 483; 13728 v28.uFrameX = 483;
13729 v28.uFrameWidth = 148; 13729 v28.uFrameWidth = 148;
13730 v28.uFrameZ = 334; 13730 v28.uFrameZ = 334;
13731 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 13731 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
13772 { 13772 {
13773 Party::TakeGold(v4); 13773 Party::TakeGold(v4);
13774 *(short *)v6 = 1; 13774 *(short *)v6 = 1;
13775 v27 = 2; 13775 v27 = 2;
13776 } 13776 }
13777 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v27); 13777 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v27);
13778 } 13778 }
13779 } 13779 }
13780 else 13780 else
13781 { 13781 {
13782 v5 = 0; 13782 v5 = 0;
13792 } 13792 }
13793 return result; 13793 return result;
13794 } 13794 }
13795 if ( !(unsigned __int16)_449B57_test_bit( 13795 if ( !(unsigned __int16)_449B57_test_bit(
13796 (unsigned __int8 *)v1->field_152, 13796 (unsigned __int8 *)v1->field_152,
13797 word_4F0754[2 * (unsigned int)ptr_507BC0->ptr_1C]) ) 13797 word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
13798 { 13798 {
13799 v24 = pNPCTopics[171].pText; 13799 v24 = pNPCTopics[171].pText;
13800 v25 = v31; 13800 v25 = v31;
13801 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0); 13801 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0);
13802 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u); 13802 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u);
13963 int v63; // [sp+280h] [bp-10h]@14 13963 int v63; // [sp+280h] [bp-10h]@14
13964 char *a1; // [sp+284h] [bp-Ch]@37 13964 char *a1; // [sp+284h] [bp-Ch]@37
13965 unsigned int s1; // [sp+288h] [bp-8h]@1 13965 unsigned int s1; // [sp+288h] [bp-8h]@1
13966 int v66; // [sp+28Ch] [bp-4h]@48 13966 int v66; // [sp+28Ch] [bp-4h]@48
13967 13967
13968 v0 = ptr_507BC0; 13968 v0 = window_SpeakInHouse;
13969 memcpy(&v53, ptr_507BC0, sizeof(v53)); 13969 memcpy(&v53, window_SpeakInHouse, sizeof(v53));
13970 v2 = 255; 13970 v2 = 255;
13971 v61 = pPlayers[uActiveCharacter]; 13971 v61 = pPlayers[uActiveCharacter];
13972 v1 = v61; 13972 v1 = v61;
13973 v53.uFrameX = 483; 13973 v53.uFrameX = 483;
13974 v53.uFrameWidth = 148; 13974 v53.uFrameWidth = 148;
14007 s1 = 2; 14007 s1 = 2;
14008 a1 = &v48; 14008 a1 = &v48;
14009 while ( 1 ) 14009 while ( 1 )
14010 { 14010 {
14011 v47[1] = (const char *)v60; 14011 v47[1] = (const char *)v60;
14012 v22 = ptr_507BC0->ptr_1C; 14012 v22 = window_SpeakInHouse->ptr_1C;
14013 v23 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62); 14013 v23 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62);
14014 v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62); 14014 v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62);
14015 v24 = v16->GetControl(v60); 14015 v24 = v16->GetControl(v60);
14016 if ( v23 != v58 14016 if ( v23 != v58
14017 && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = (unsigned __int8)*(&byte_4F09B1[32 * (int)v23] 14017 && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = (unsigned __int8)*(&byte_4F09B1[32 * (int)v23]
14025 if ( pDialogueWindow->pCurrentPosActiveItem != s1 ) 14025 if ( pDialogueWindow->pCurrentPosActiveItem != s1 )
14026 v27 = *(const char **)v57; 14026 v27 = *(const char **)v57;
14027 v47[1] = v27; 14027 v47[1] = v27;
14028 sprintf(a1, format_4E2DC8, v27); 14028 sprintf(a1, format_4E2DC8, v27);
14029 v66 = (unsigned __int8)byte_4F09B8[v26 * 4]; 14029 v66 = (unsigned __int8)byte_4F09B8[v26 * 4];
14030 if ( (signed int)ptr_507BC0->ptr_1C >= 63 ) 14030 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
14031 { 14031 {
14032 if ( CheckHiredNPCSpeciality(8u) ) 14032 if ( CheckHiredNPCSpeciality(8u) )
14033 v66 -= 2; 14033 v66 -= 2;
14034 if ( CheckHiredNPCSpeciality(9u) ) 14034 if ( CheckHiredNPCSpeciality(9u) )
14035 v66 -= 3; 14035 v66 -= 3;
14128 if ( dword_F8B19C > 104 && dword_F8B19C <= 108 ) 14128 if ( dword_F8B19C > 104 && dword_F8B19C <= 108 )
14129 { 14129 {
14130 if ( pParty->uNumGold < s1 ) 14130 if ( pParty->uNumGold < s1 )
14131 { 14131 {
14132 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); 14132 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
14133 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 3); 14133 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3);
14134 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 14134 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
14135 return; 14135 return;
14136 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 14136 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
14137 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; 14137 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
14138 goto LABEL_33; 14138 goto LABEL_33;
14139 } 14139 }
14140 Party::TakeGold(s1); 14140 Party::TakeGold(s1);
14141 v47[1] = (const char *)7; 14141 v47[1] = (const char *)7;
14142 v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + dword_F8B19C)]; 14142 v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + dword_F8B19C)];
14143 if ( v5[pParty->uDaysPlayed % 7 + 1] ) 14143 if ( v5[pParty->uDaysPlayed % 7 + 1] )
14144 { 14144 {
14145 if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename) ) 14145 if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename) )
14146 { 14146 {
14147 SaveGame(1, 0); 14147 SaveGame(1, 0);
14171 pParty->vPosition.y = v7; 14171 pParty->vPosition.y = v7;
14172 pParty->vPosition.z = *((int *)v5 + 5); 14172 pParty->vPosition.z = *((int *)v5 + 5);
14173 pParty->uFallStartY = pParty->vPosition.z; 14173 pParty->uFallStartY = pParty->vPosition.z;
14174 pParty->sRotationY = *((int *)v5 + 6); 14174 pParty->sRotationY = *((int *)v5 + 6);
14175 } 14175 }
14176 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); 14176 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
14177 v12 = (unsigned __int8)v5[8]; 14177 v12 = (unsigned __int8)v5[8];
14178 if ( (signed int)ptr_507BC0->ptr_1C >= 63 ) 14178 if ( (signed int)window_SpeakInHouse->ptr_1C >= 63 )
14179 { 14179 {
14180 v63 = SPEECH_72; 14180 v63 = SPEECH_72;
14181 v13 = 2500; 14181 v13 = 2500;
14182 if ( CheckHiredNPCSpeciality(8u) ) 14182 if ( CheckHiredNPCSpeciality(8u) )
14183 v12 -= 2; 14183 v12 -= 2;
15080 || (signed __int64)__PAIR__(v11, pParty->field_3C._shop_ban_times[2 * v25]) <= (signed __int64)pParty->uTimePlayed ) 15080 || (signed __int64)__PAIR__(v11, pParty->field_3C._shop_ban_times[2 * v25]) <= (signed __int64)pParty->uTimePlayed )
15081 { 15081 {
15082 pParty->field_3C._shop_ban_times[2 * v25] = 0; 15082 pParty->field_3C._shop_ban_times[2 * v25] = 0;
15083 pParty->field_3C._shop_ban_times[2 * v10 + 1] = 0; 15083 pParty->field_3C._shop_ban_times[2 * v10 + 1] = 0;
15084 LABEL_21: 15084 LABEL_21:
15085 if ( !dword_597F18 ) 15085 if ( !start_event_seq_number )
15086 pAudioPlayer->StopChannels(-1, -1); 15086 pAudioPlayer->StopChannels(-1, -1);
15087 //uCurrentHouse_Animation = p2DEvents_minus1___02[v2]; 15087 //uCurrentHouse_Animation = p2DEvents_minus1___02[v2];
15088 uCurrentHouse_Animation = p2DEvents[v2 / sizeof(_2devent) - 1].uAnimationID; 15088 uCurrentHouse_Animation = p2DEvents[v2 / sizeof(_2devent) - 1].uAnimationID;
15089 dword_F8B198 = LOBYTE(pAnimatedRooms[uCurrentHouse_Animation].field_C); 15089 dword_F8B198 = LOBYTE(pAnimatedRooms[uCurrentHouse_Animation].field_C);
15090 if ( dword_F8B198 == 20 && pParty->uFine ) 15090 if ( dword_F8B198 == 20 && pParty->uFine )