comparison mm7_4.cpp @ 458:c0ab5f64b37b

Слияние
author Ritor1
date Sun, 24 Feb 2013 20:42:44 +0600
parents e5cf03a3d98e 4946b3ed74be
children a7869569e912
comparison
equal deleted inserted replaced
457:e5cf03a3d98e 458:c0ab5f64b37b
4913 memset(pTmpBuf2, 0, sizeof(pTmpBuf2)); 4913 memset(pTmpBuf2, 0, sizeof(pTmpBuf2));
4914 4914
4915 NPCData *npc = nullptr; 4915 NPCData *npc = nullptr;
4916 if ( dword_5C35D4 ) 4916 if ( dword_5C35D4 )
4917 { 4917 {
4918 __debugbreak(); // fix 4918 __debugbreak(); // fix
4919 npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; 4919 npc = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
4920 } 4920 }
4921 else 4921 else
4922 npc = GetNPCData(uDialogue_SpeakingActorNPC_ID); 4922 npc = GetNPCData(uDialogue_SpeakingActorNPC_ID);
4923 //v65 = v9; 4923 //v65 = v9;
4924 //v10 = 0; 4924 //v10 = 0;
9110 if ( !v5 ) 9110 if ( !v5 )
9111 return; 9111 return;
9112 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C); 9112 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C);
9113 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4); 9113 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
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->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v5];
9116 goto LABEL_15; 9117 goto LABEL_15;
9117 } 9118 }
9118 if ( dword_F8B198 <= 16 && dword_F8B19C == 18 ) 9119 if ( dword_F8B198 <= 16 && dword_F8B19C == 18 )
9119 { 9120 {
9120 v1 = pMouse->GetCursorPos(&a2); 9121 v1 = pMouse->GetCursorPos(&a2);
9373 // 722B3C: using guessed type int dword_722B3C; 9374 // 722B3C: using guessed type int dword_722B3C;
9374 // 722B44: using guessed type int dword_722B44; 9375 // 722B44: using guessed type int dword_722B44;
9375 // F8B1A8: using guessed type int dword_F8B1A8; 9376 // F8B1A8: using guessed type int dword_F8B1A8;
9376 9377
9377 //----- (004B2001) -------------------------------------------------------- 9378 //----- (004B2001) --------------------------------------------------------
9378 void __fastcall ClickNPCTopic(signed int uMessageParam) 9379 void __fastcall sub_4B2001(signed int a1)
9379 { 9380 {
9380 //signed int v1; // eax@1 9381 signed int v1; // eax@1
9381 NPCData *pCurrentNPCInfo; // ebp@1 9382 NPCData *v2; // ebp@1
9382 int pEventNumber; // ecx@8 9383 int v3; // ecx@8
9383 Player *v4; // esi@20 9384 Player *v4; // esi@20
9384 int v5; // eax@28 9385 int v5; // eax@28
9385 int v6; // eax@31 9386 int v6; // eax@31
9386 int v7; // eax@34 9387 int v7; // eax@34
9387 int v8; // eax@37 9388 int v8; // eax@37
9401 char *v22; // [sp-Ch] [bp-18h]@73 9402 char *v22; // [sp-Ch] [bp-18h]@73
9402 int v23; // [sp-8h] [bp-14h]@49 9403 int v23; // [sp-8h] [bp-14h]@49
9403 char *v24; // [sp-8h] [bp-14h]@73 9404 char *v24; // [sp-8h] [bp-14h]@73
9404 int v25; // [sp-4h] [bp-10h]@49 9405 int v25; // [sp-4h] [bp-10h]@49
9405 9406
9406 //v1 = a1; 9407 v1 = a1;
9407 uDialogueType = uMessageParam + 1; 9408 uDialogueType = a1 + 1;
9408 pCurrentNPCInfo = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; 9409 v2 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
9409 switch ( uMessageParam ) 9410 if ( a1 <= 23 )
9410 { 9411 {
9411 case 13: 9412 if ( a1 == 23 )
9412 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); 9413 {
9413 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); 9414 v3 = v2->evt_E;
9414 sub_4B40E6(); 9415 }
9415 dialogue_show_profession_details = false; 9416 else
9416 goto _return; 9417 {
9417 case 19: 9418 if ( a1 == 13 )
9418 pEventNumber = pCurrentNPCInfo->evt_A; 9419 {
9419 break; 9420 ptr_F8B1E8 = pNPCStats->pProfessions[v2->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession);
9420 case 20: 9421 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0);
9421 pEventNumber = pCurrentNPCInfo->evt_B; 9422 sub_4B40E6();
9422 break; 9423 dialogue_show_profession_details = false;
9423 case 21:
9424 pEventNumber = pCurrentNPCInfo->evt_C;
9425 break;
9426 case 22:
9427 pEventNumber = pCurrentNPCInfo->evt_D;
9428 break;
9429 case 23:
9430 pEventNumber = pCurrentNPCInfo->evt_E;
9431 break;
9432 case 24:
9433 pEventNumber = pCurrentNPCInfo->evt_F;
9434 break;
9435 default:
9436 goto _return; 9424 goto _return;
9437 } 9425 }
9438 if ( pEventNumber < 200 || pEventNumber > 310 ) 9426 switch ( a1 )
9439 { 9427 {
9440 if ( pEventNumber < 400 || pEventNumber > 410 ) 9428 case 19:
9441 { 9429 v3 = v2->evt_A;
9442 if ( pEventNumber == 139 ) 9430 break;
9431 case 20:
9432 v3 = v2->evt_B;
9433 break;
9434 case 21:
9435 v3 = v2->evt_C;
9436 break;
9437 default:
9438 if ( a1 != 22 )
9439 goto _return;
9440 v3 = v2->evt_D;
9441 break;
9442 }
9443 }
9444 goto LABEL_84;
9445 }
9446 if ( a1 == 24 )
9447 {
9448 v3 = v2->evt_F;
9449 LABEL_84:
9450 if ( v3 < 200 || v3 > 310 )
9451 {
9452 if ( v3 < 400 || v3 > 410 )
9453 {
9454 if ( v3 == 139 )
9443 { 9455 {
9444 sub_4B1ECE(); 9456 sub_4B1ECE();
9445 } 9457 }
9446 else 9458 else
9447 { 9459 {
9448 if ( pEventNumber == 311 ) 9460 if ( v3 == 311 )
9449 { 9461 {
9450 sub_4BBA85_bounties(); 9462 sub_4BBA85_bounties();
9451 } 9463 }
9452 else 9464 else
9453 { 9465 {
9454 ptr_F8B1E8 = 0; 9466 ptr_F8B1E8 = 0;
9455 _5C3420_pDecoration = (LevelDecoration *)1; 9467 _5C3420_pDecoration = (LevelDecoration *)1;
9456 EventProcessor(pEventNumber, 0, 1); 9468 EventProcessor(v3, 0, 1);
9457 _5C3420_pDecoration = 0; 9469 _5C3420_pDecoration = 0;
9458 } 9470 }
9459 } 9471 }
9460 } 9472 }
9461 else 9473 else
9462 { 9474 {
9463 dword_F8B1D8 = uMessageParam; 9475 dword_F8B1D8 = v1;
9464 DrawJoinGuildWindow(pEventNumber - 400); 9476 sub_4B3EF0(v3 - 400);
9465 } 9477 }
9466 } 9478 }
9467 else 9479 else
9468 { 9480 {
9469 sub_4B3FE5(pEventNumber); 9481 sub_4B3FE5(v3);
9470 } 9482 }
9471 goto _return; 9483 goto _return;
9472 9484 }
9473 if ( uMessageParam != 76 ) 9485 if ( a1 != 76 )
9474 { 9486 {
9475 if ( uMessageParam == 77 ) 9487 if ( a1 == 77 )
9476 { 9488 {
9477 v16 = pCurrentNPCInfo->uProfession; 9489 v16 = v2->uProfession;
9478 if (dialogue_show_profession_details) 9490 if (dialogue_show_profession_details)
9479 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; 9491 v17 = pNPCStats->pProfessions[v2->uProfession - 1].pJoinText;
9480 else 9492 else
9481 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pBenefits; 9493 v17 = pNPCStats->pProfessions[v2->uProfession - 1].pBenefits;
9482 ptr_F8B1E8 = v17; 9494 ptr_F8B1E8 = v17;
9483 v18 = BuilDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0); 9495 v18 = BuilDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0);
9484 dialogue_show_profession_details = ~dialogue_show_profession_details; 9496 dialogue_show_profession_details = ~dialogue_show_profession_details;
9485 ptr_F8B1E8 = v18; 9497 ptr_F8B1E8 = v18;
9486 } 9498 }
9487 else 9499 else
9488 { 9500 {
9489 if ( uMessageParam == 79 ) 9501 if ( a1 == 79 )
9490 { 9502 {
9491 if ( dword_F8B1A8 ) 9503 if ( dword_F8B1A8 )
9492 { 9504 {
9493 Party::TakeGold(gold_transaction_amount); 9505 Party::TakeGold(gold_transaction_amount);
9494 if ( uActiveCharacter ) 9506 if ( uActiveCharacter )
9522 }*/ 9534 }*/
9523 } 9535 }
9524 } 9536 }
9525 else 9537 else
9526 { 9538 {
9527 if ( uMessageParam == 82 && dword_F8B1A8 ) 9539 if ( a1 == 82 && dword_F8B1A8 )
9528 { 9540 {
9529 Party::TakeGold(gold_transaction_amount); 9541 Party::TakeGold(gold_transaction_amount);
9530 v4 = pParty->pPlayers; 9542 v4 = pParty->pPlayers;
9531 do 9543 do
9532 { 9544 {
9535 } 9547 }
9536 while ( (signed int)v4 < (signed int)pParty->pHirelings ); 9548 while ( (signed int)v4 < (signed int)pParty->pHirelings );
9537 switch ( dword_F8B1D8 ) 9549 switch ( dword_F8B1D8 )
9538 { 9550 {
9539 case 19: 9551 case 19:
9540 v10 = pCurrentNPCInfo->evt_A; 9552 v10 = v2->evt_A;
9541 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 ) 9553 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 )
9542 pCurrentNPCInfo->evt_A = 0; 9554 v2->evt_A = 0;
9543 break; 9555 break;
9544 case 20: 9556 case 20:
9545 v9 = pCurrentNPCInfo->evt_B; 9557 v9 = v2->evt_B;
9546 if ( v9 >= 400 && v9 <= 416 ) 9558 if ( v9 >= 400 && v9 <= 416 )
9547 pCurrentNPCInfo->evt_B = 0; 9559 v2->evt_B = 0;
9548 break; 9560 break;
9549 case 21: 9561 case 21:
9550 v8 = pCurrentNPCInfo->evt_C; 9562 v8 = v2->evt_C;
9551 if ( v8 >= 400 && v8 <= 416 ) 9563 if ( v8 >= 400 && v8 <= 416 )
9552 pCurrentNPCInfo->evt_C = 0; 9564 v2->evt_C = 0;
9553 break; 9565 break;
9554 case 22: 9566 case 22:
9555 v7 = pCurrentNPCInfo->evt_D; 9567 v7 = v2->evt_D;
9556 if ( v7 >= 400 && v7 <= 416 ) 9568 if ( v7 >= 400 && v7 <= 416 )
9557 pCurrentNPCInfo->evt_D = 0; 9569 v2->evt_D = 0;
9558 break; 9570 break;
9559 case 23: 9571 case 23:
9560 v6 = pCurrentNPCInfo->evt_E; 9572 v6 = v2->evt_E;
9561 if ( v6 >= 400 && v6 <= 416 ) 9573 if ( v6 >= 400 && v6 <= 416 )
9562 pCurrentNPCInfo->evt_E = 0; 9574 v2->evt_E = 0;
9563 break; 9575 break;
9564 case 24: 9576 case 24:
9565 v5 = pCurrentNPCInfo->evt_F; 9577 v5 = v2->evt_F;
9566 if ( v5 >= 400 ) 9578 if ( v5 >= 400 )
9567 { 9579 {
9568 if ( v5 <= 416 ) 9580 if ( v5 <= 416 )
9569 pCurrentNPCInfo->evt_F = 0; 9581 v2->evt_F = 0;
9570 } 9582 }
9571 break; 9583 break;
9572 } 9584 }
9573 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); 9585 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
9574 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 9586 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
9598 LABEL_77: 9610 LABEL_77:
9599 ShowStatusBarString(v19, 2u); 9611 ShowStatusBarString(v19, 2u);
9600 goto _return; 9612 goto _return;
9601 } 9613 }
9602 //v20 = v2->uProfession; 9614 //v20 = v2->uProfession;
9603 if ( pCurrentNPCInfo->uProfession != 51 ) 9615 if ( v2->uProfession != 51 )
9604 { 9616 {
9605 v21 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].uHirePrice; 9617 v21 = pNPCStats->pProfessions[v2->uProfession - 1].uHirePrice;
9606 if ( pParty->uNumGold < v21 ) 9618 if ( pParty->uNumGold < v21 )
9607 { 9619 {
9608 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); 9620 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
9609 dialogue_show_profession_details = false; 9621 dialogue_show_profession_details = false;
9610 uDialogueType = 13; 9622 uDialogueType = 13;
9611 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; 9623 ptr_F8B1E8 = pNPCStats->pProfessions[v2->uProfession - 1].pJoinText;
9612 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); 9624 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0);
9613 if ( uActiveCharacter ) 9625 if ( uActiveCharacter )
9614 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); 9626 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0);
9615 v19 = pGlobalTXT_LocalizationStrings[155]; 9627 v19 = pGlobalTXT_LocalizationStrings[155];
9616 goto LABEL_77; 9628 goto LABEL_77;
9617 } 9629 }
9618 Party::TakeGold(v21); 9630 Party::TakeGold(v21);
9619 } 9631 }
9620 //LOBYTE(v2->uFlags) |= 0x80u; 9632 //LOBYTE(v2->uFlags) |= 0x80u;
9621 pCurrentNPCInfo->uFlags = 128; 9633 v2->uFlags = 128;
9622 pParty->field_709 = 0; 9634 pParty->field_709 = 0;
9623 sub_44A56A(); 9635 sub_44A56A();
9624 if ( pParty->pHirelings[0].pName ) 9636 if ( pParty->pHirelings[0].pName )
9625 { 9637 {
9626 memcpy(&pParty->pHirelings[1], pCurrentNPCInfo, sizeof(pParty->pHirelings[1])); 9638 memcpy(&pParty->pHirelings[1], v2, sizeof(pParty->pHirelings[1]));
9627 v24 = pCurrentNPCInfo->pName; 9639 v24 = v2->pName;
9628 v22 = pParty->pHireling2Name; 9640 v22 = pParty->pHireling2Name;
9629 } 9641 }
9630 else 9642 else
9631 { 9643 {
9632 memcpy(pParty->pHirelings, pCurrentNPCInfo, 0x4Cu); 9644 memcpy(pParty->pHirelings, v2, 0x4Cu);
9633 v24 = pCurrentNPCInfo->pName; 9645 v24 = v2->pName;
9634 v22 = pParty->pHireling1Name; 9646 v22 = pParty->pHireling1Name;
9635 } 9647 }
9636 strcpy(v22, v24); 9648 strcpy(v22, v24);
9637 pParty->field_709 = 0; 9649 pParty->field_709 = 0;
9638 sub_44A56A(); 9650 sub_44A56A();
9988 } 10000 }
9989 10001
9990 10002
9991 10003
9992 //----- (004B29F2) -------------------------------------------------------- 10004 //----- (004B29F2) --------------------------------------------------------
9993 const char *__fastcall ContractSelectText(int pEventNumber) 10005 const char *__fastcall sub_4B29F2(int a1)
9994 { 10006 {
10007 int v1; // esi@1
10008 Player *v2; // edi@1
10009 int v3; // eax@1
10010 Player *v4; // ecx@1
10011
10012 v1 = a1;
9995 dword_F8B1A8 = 0; 10013 dword_F8B1A8 = 0;
9996 dword_F8B1AC_something_todo_with_awards = pEventNumber + 50; 10014 v2 = pPlayers[uActiveCharacter];
9997 gold_transaction_amount = dword_4F08EC[pEventNumber]; 10015 v3 = a1 + 50;
9998 if ( pPlayers[uActiveCharacter]->CanAct() ) 10016 v4 = pPlayers[uActiveCharacter];
9999 { 10017 dword_F8B1AC_something_todo_with_awards = v3;
10000 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->field_152, dword_F8B1AC_something_todo_with_awards) ) 10018 gold_transaction_amount = dword_4F08EC[v1];
10019 if ( v4->CanAct() )
10020 {
10021 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)v2->field_152, dword_F8B1AC_something_todo_with_awards) )
10001 { 10022 {
10002 return pNPCTopics[123].pText; 10023 return pNPCTopics[123].pText;
10003 } 10024 }
10004 else 10025 else
10005 { 10026 {
10006 if ( gold_transaction_amount <= pParty->uNumGold ) 10027 if ( gold_transaction_amount <= pParty->uNumGold )
10007 { 10028 {
10008 dword_F8B1A8 = 1; 10029 dword_F8B1A8 = 1;
10009 return pNPCTopics[pEventNumber + 110].pText; 10030 return pNPCTopics[v1 + 110].pText;
10010 } 10031 }
10011 else 10032 else
10012 { 10033 {
10013 return pNPCTopics[124].pText; 10034 return pNPCTopics[124].pText;
10014 } 10035 }
10020 } 10041 }
10021 } 10042 }
10022 10043
10023 10044
10024 //----- (004B2A74) -------------------------------------------------------- 10045 //----- (004B2A74) --------------------------------------------------------
10025 char __cdecl SimpleHouseAndBoatsDialog() 10046 char __cdecl SimpleHouseDialog()
10026 { 10047 {
10027 char *v0; // esi@3 10048 char *v0; // esi@3
10028 char *v1; // ST1C_4@3 10049 char *v1; // ST1C_4@3
10029 char *v2; // eax@3 10050 char *v2; // eax@3
10030 const char *v3; // ST1C_4@5 10051 const char *v3; // ST1C_4@5
10082 int v56; // [sp+110h] [bp-Ch]@13 10103 int v56; // [sp+110h] [bp-Ch]@13
10083 char *pInString; // [sp+114h] [bp-8h]@12 10104 char *pInString; // [sp+114h] [bp-8h]@12
10084 NPCData *v58; // [sp+118h] [bp-4h]@6 10105 NPCData *v58; // [sp+118h] [bp-4h]@6
10085 10106
10086 memcpy(&a1, pDialogueWindow, sizeof(a1)); 10107 memcpy(&a1, pDialogueWindow, sizeof(a1));
10087 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) 10108 if ( array_5913D8[6] == (NPCData *)uNumDialogueNPCPortraits && uHouse_ExitPic )
10088 { 10109 {
10089 v0 = pMapStats->pInfos[uHouse_ExitPic].pName; 10110 v0 = pMapStats->pInfos[uHouse_ExitPic].pName;
10090 v1 = pMapStats->pInfos[uHouse_ExitPic].pName; 10111 v1 = pMapStats->pInfos[uHouse_ExitPic].pName;
10091 a1.uFrameX = 493; 10112 a1.uFrameX = 493;
10092 a1.uFrameWidth = 126; 10113 a1.uFrameWidth = 126;
10106 LOBYTE(i) = (unsigned int)a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u); 10127 LOBYTE(i) = (unsigned int)a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u);
10107 return i; 10128 return i;
10108 } 10129 }
10109 a1.uFrameWidth -= 10; 10130 a1.uFrameWidth -= 10;
10110 a1.uFrameZ -= 10; 10131 a1.uFrameZ -= 10;
10111 v58 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; 10132 v58 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
10112 v6 = v58; 10133 v6 = v58;
10113 v55 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 10134 v55 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
10114 v7 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); 10135 v7 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
10115 v8 = v6->uProfession; 10136 v8 = v6->uProfession;
10116 if ( v8 ) 10137 if ( v8 )
10181 goto LABEL_49; 10202 goto LABEL_49;
10182 } 10203 }
10183 v27 = v26 - 3; 10204 v27 = v26 - 3;
10184 if ( !v27 ) 10205 if ( !v27 )
10185 { 10206 {
10186 v33 = (char *)ContractSelectText((int)v52.ptr_1C); 10207 v33 = (char *)sub_4B29F2((int)v52.ptr_1C);
10187 goto LABEL_44; 10208 goto LABEL_44;
10188 } 10209 }
10189 v28 = v27 - 1; 10210 v28 = v27 - 1;
10190 if ( !v28 ) 10211 if ( !v28 )
10191 { 10212 {
11038 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);// 11059 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//
11039 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1); 11060 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1);
11040 } 11061 }
11041 11062
11042 //----- (004B3EF0) -------------------------------------------------------- 11063 //----- (004B3EF0) --------------------------------------------------------
11043 void __fastcall DrawJoinGuildWindow(int pEventNumber) 11064 void __fastcall sub_4B3EF0(int a4)
11044 { 11065 {
11045 //int v1; // edi@1 11066 int v1; // edi@1
11046 11067
11047 //v1 = a4; 11068 v1 = a4;
11048 uDialogueType = 81; 11069 uDialogueType = 81;
11049 ptr_F8B1E8 = (char *)pNPCTopics[pEventNumber + 99].pText; 11070 ptr_F8B1E8 = (char *)pNPCTopics[a4 + 99].pText;
11050 ContractSelectText(pEventNumber); 11071 sub_4B29F2(a4);
11051 pDialogueWindow->Release(); 11072 pDialogueWindow->Release();
11052 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventNumber, 0); 11073 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, v1, 0);
11053 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], 11074 pBtn_ExitCancel = pDialogueWindow->CreateButton(
11054 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); 11075 0x1D7,
11076 0x1BD,
11077 0xA9,
11078 0x23,
11079 1,
11080 0,
11081 0x71,
11082 0,
11083 0,
11084 pGlobalTXT_LocalizationStrings[34],
11085 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0),
11086 0);
11055 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); 11087 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0);
11056 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); 11088 pDialogueWindow->CreateButton(
11089 0x1E0u,
11090 0xA0u,
11091 0x8Cu,
11092 0x1Eu,
11093 1,
11094 0,
11095 0xAFu,
11096 0x52u,
11097 0,
11098 pGlobalTXT_LocalizationStrings[122],
11099 0);
11057 pDialogueWindow->_41D08F(1, 1, 0, 2); 11100 pDialogueWindow->_41D08F(1, 1, 0, 2);
11058 dword_F8B19C = -1; 11101 dword_F8B19C = -1;
11059 } 11102 }
11060 // F8B19C: using guessed type int dword_F8B19C; 11103 // F8B19C: using guessed type int dword_F8B19C;
11061 11104
11100 { 11143 {
11101 signed int v0; // ebx@1 11144 signed int v0; // ebx@1
11102 NPCData *v1; // edi@1 11145 NPCData *v1; // edi@1
11103 11146
11104 v0 = 0; 11147 v0 = 0;
11105 v1 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; 11148 v1 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
11106 pDialogueWindow->Release(); 11149 pDialogueWindow->Release();
11107 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); 11150 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0);
11108 pBtn_ExitCancel = pDialogueWindow->CreateButton( 11151 pBtn_ExitCancel = pDialogueWindow->CreateButton(
11109 0x1D7u, 11152 0x1D7u,
11110 0x1BDu, 11153 0x1BDu,
11165 int v14; // eax@36 11208 int v14; // eax@36
11166 int v16; // eax@41 11209 int v16; // eax@41
11167 NPCData *v17; // [sp+10h] [bp-4h]@4 11210 NPCData *v17; // [sp+10h] [bp-4h]@4
11168 11211
11169 num_menu_buttons = 0; 11212 num_menu_buttons = 0;
11170 pDialogueNPCCount = (_this + 1); 11213 array_5913D8[6] = (NPCData *)(_this + 1);
11171 if ( _this + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) 11214 if ( _this + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic )
11172 { 11215 {
11173 pDialogueWindow->Release(); 11216 pDialogueWindow->Release();
11174 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); 11217 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
11175 sprintf(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName); 11218 sprintf(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName);
11182 pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0, 0xBFu, 1u, 0x20u, sHouseName, 0); 11225 pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0, 0xBFu, 1u, 0x20u, sHouseName, 0);
11183 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); 11226 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0);
11184 } 11227 }
11185 else 11228 else
11186 { 11229 {
11187 v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) + 1)]; 11230 v17 = array_5913D8[_this + 1 - ((dword_591080 != 0) + 1)];
11188 if ( dword_F8B19C == -1 ) 11231 if ( dword_F8B19C == -1 )
11189 { 11232 {
11190 pDialogueWindow->Release(); 11233 pDialogueWindow->Release();
11191 } 11234 }
11192 else 11235 else
11193 { 11236 {
11194 for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) 11237 for ( i = 0; i < uNumDialogueNPCPortraits; ++i )
11195 GUIButton::_41D0D8((GUIButton *)HouseNPCData[i + 7]); 11238 GUIButton::_41D0D8((GUIButton *)array_5913D8[i + 7]);
11196 } 11239 }
11197 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); 11240 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
11198 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, 0x71u, 0, 0, 11241 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, 0x71u, 0, 0,
11199 pGlobalTXT_LocalizationStrings[74],// "End Conversation" 11242 pGlobalTXT_LocalizationStrings[74],// "End Conversation"
11200 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); 11243 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0);
11201 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0); 11244 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0);
11202 if ( pDialogueNPCCount == 1 && dword_591080 ) 11245 if ( array_5913D8[6] == (NPCData *)1 && dword_591080 )
11203 { 11246 {
11204 sub_4B3B42(dword_F8B198); 11247 sub_4B3B42(dword_F8B198);
11205 } 11248 }
11206 else 11249 else
11207 { 11250 {
12165 v122 = 0; 12208 v122 = 0;
12166 if ( dword_F8B19C == 2 ) 12209 if ( dword_F8B19C == 2 )
12167 { 12210 {
12168 do 12211 do
12169 { 12212 {
12170 if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) 12213 // if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
12214 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID);
12171 { 12215 {
12172 v50 = dword_F8B168[v49]; 12216 v50 = dword_F8B168[v49];
12173 v51 = 152 - v50->uTextureHeight; 12217 v51 = 152 - v50->uTextureHeight;
12174 if ( (signed int)v51 < 1 ) 12218 if ( (signed int)v51 < 1 )
12175 v51 = 0; 12219 v51 = 0;
12197 } 12241 }
12198 while ( v49 < 6 ); 12242 while ( v49 < 6 );
12199 v122 = 0; 12243 v122 = 0;
12200 do 12244 do
12201 { 12245 {
12202 if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] ) 12246 //if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] )
12247 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v122+1].uItemID);
12203 { 12248 {
12204 v54 = dword_F8B168[v122 + 6]; 12249 v54 = dword_F8B168[v122 + 6];
12205 v55 = 306 - v54->uTextureHeight; 12250 v55 = 306 - v54->uTextureHeight;
12206 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40; 12251 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40;
12207 if ( v122 ) 12252 if ( v122 )
12227 } 12272 }
12228 else 12273 else
12229 { 12274 {
12230 do 12275 do
12231 { 12276 {
12232 if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 12277 // if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
12278 if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
12233 { 12279 {
12234 v58 = dword_F8B168[v49]; 12280 v58 = dword_F8B168[v49];
12235 v59 = 152 - v58->uTextureHeight; 12281 v59 = 152 - v58->uTextureHeight;
12236 if ( (signed int)v59 < 1 ) 12282 if ( (signed int)v59 < 1 )
12237 v59 = 0; 12283 v59 = 0;
12259 } 12305 }
12260 while ( v49 < 6 ); 12306 while ( v49 < 6 );
12261 v122 = 0; 12307 v122 = 0;
12262 do 12308 do
12263 { 12309 {
12264 if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) 12310 //if ( pParty->Spell_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49] + 778] ) //weak
12311 if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uAttributes)
12265 { 12312 {
12266 v62 = dword_F8B168[v122 + 6]; 12313 v62 = dword_F8B168[v122 + 6];
12267 v63 = 306 - v62->uTextureHeight; 12314 v63 = 306 - v62->uTextureHeight;
12268 if ( (signed int)v63 < 1 ) 12315 if ( (signed int)v63 < 1 )
12269 v63 = 0; 12316 v63 = 0;
12296 v117 = 0; 12343 v117 = 0;
12297 if ( dword_F8B19C == 2 ) 12344 if ( dword_F8B19C == 2 )
12298 { 12345 {
12299 do 12346 do
12300 { 12347 {
12301 if ( pParty->field_777C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) 12348 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID); //9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] )
12302 ++v117; 12349 ++v117;
12303 ++v66; 12350 ++v66;
12304 } 12351 }
12305 while ( v66 < 12 ); 12352 while ( v66 < 12 );
12306 } 12353 }
12307 else 12354 else
12308 { 12355 {
12309 do 12356 do
12310 { 12357 {
12311 if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 12358 //if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
12359 if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
12312 ++v117; 12360 ++v117;
12313 ++v66; 12361 ++v66;
12314 } 12362 }
12315 while ( v66 < 12 ); 12363 while ( v66 < 12 );
12316 } 12364 }
12339 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF ) 12387 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
12340 { 12388 {
12341 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1; 12389 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
12342 v117 = v71; 12390 v117 = v71;
12343 v72 = (int)window_SpeakInHouse->ptr_1C; 12391 v72 = (int)window_SpeakInHouse->ptr_1C;
12344 v73 = 9 * (v71 + 12 * v72); 12392 // v73 = 9 * (v71 + 12 * v72);
12345 v74 = (ItemGen *)&pParty->field_777C[v73]; 12393 v74 = (ItemGen *)&pParty->field_777C[v72][v71];
12346 if ( dword_F8B19C != 2 ) 12394 if ( dword_F8B19C != 2 )
12347 v74 = (ItemGen *)&pParty->field_C59C[v73 + 724]; 12395 // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
12396 v74 =&pParty->Recipes_Item[v72][v71];
12348 if ( v67 && Str ) 12397 if ( v67 && Str )
12349 { 12398 {
12350 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" 12399 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
12351 v96 = 0; 12400 v96 = 0;
12352 v94 = 2; 12401 v94 = 2;
12375 void OnSelectDialogueOption(DIALOGUE_TYPE newDialogueType) 12424 void OnSelectDialogueOption(DIALOGUE_TYPE newDialogueType)
12376 { 12425 {
12377 //unsigned int v1; // esi@1 12426 //unsigned int v1; // esi@1
12378 NPCData *v2; // ebp@1 12427 NPCData *v2; // ebp@1
12379 //unsigned int v3; // eax@1 12428 //unsigned int v3; // eax@1
12380 int pEventNumber; // ecx@10 12429 int v4; // ecx@10
12381 signed int v5; // edi@14 12430 signed int v5; // edi@14
12382 char *v6; // esi@15 12431 char *v6; // esi@15
12383 const char *v7; // ecx@22 12432 const char *v7; // ecx@22
12384 signed int v8; // edi@37 12433 signed int v8; // edi@37
12385 //unsigned int v9; // eax@56 12434 //unsigned int v9; // eax@56
12401 } 12450 }
12402 if ( (signed int)newDialogueType > 22 ) 12451 if ( (signed int)newDialogueType > 22 )
12403 { 12452 {
12404 if ( newDialogueType == DIALOGUE_23 ) 12453 if ( newDialogueType == DIALOGUE_23 )
12405 { 12454 {
12406 pEventNumber = v2->evt_E; 12455 v4 = v2->evt_E;
12407 goto LABEL_74; 12456 goto LABEL_74;
12408 } 12457 }
12409 if (newDialogueType == DIALOGUE_24) 12458 if (newDialogueType == DIALOGUE_24)
12410 { 12459 {
12411 pEventNumber = v2->evt_F; 12460 v4 = v2->evt_F;
12412 goto LABEL_74; 12461 goto LABEL_74;
12413 } 12462 }
12414 if (newDialogueType != DIALOGUE_76) 12463 if (newDialogueType != DIALOGUE_76)
12415 { 12464 {
12416 if (newDialogueType == DIALOGUE_PROFESSION_DETAILS) 12465 if (newDialogueType == DIALOGUE_PROFESSION_DETAILS)
12528 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0); 12577 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0);
12529 goto LABEL_87; 12578 goto LABEL_87;
12530 } 12579 }
12531 if (newDialogueType == DIALOGUE_22) 12580 if (newDialogueType == DIALOGUE_22)
12532 { 12581 {
12533 pEventNumber = v2->evt_D; 12582 v4 = v2->evt_D;
12534 goto LABEL_74; 12583 goto LABEL_74;
12535 } 12584 }
12536 if (newDialogueType == DIALOGUE_9) 12585 if (newDialogueType == DIALOGUE_9)
12537 { 12586 {
12538 if ( !sub_4BB756(v2->uProfession) ) 12587 if ( !sub_4BB756(v2->uProfession) )
12577 } 12626 }
12578 goto LABEL_44; 12627 goto LABEL_44;
12579 } 12628 }
12580 if (newDialogueType == DIALOGUE_19) 12629 if (newDialogueType == DIALOGUE_19)
12581 { 12630 {
12582 pEventNumber = v2->evt_A; 12631 v4 = v2->evt_A;
12583 goto LABEL_74; 12632 goto LABEL_74;
12584 } 12633 }
12585 if (newDialogueType == DIALOGUE_20) 12634 if (newDialogueType == DIALOGUE_20)
12586 { 12635 {
12587 pEventNumber = v2->evt_B; 12636 v4 = v2->evt_B;
12588 goto LABEL_74; 12637 goto LABEL_74;
12589 } 12638 }
12590 if (newDialogueType == DIALOGUE_21) 12639 if (newDialogueType == DIALOGUE_21)
12591 { 12640 {
12592 pEventNumber = v2->evt_C; 12641 v4 = v2->evt_C;
12593 LABEL_74: 12642 LABEL_74:
12594 if ( pEventNumber < 200 || pEventNumber > 310 ) 12643 if ( v4 < 200 || v4 > 310 )
12595 { 12644 {
12596 if ( pEventNumber < 400 || pEventNumber > 410 ) 12645 if ( v4 < 400 || v4 > 410 )
12597 { 12646 {
12598 switch ( pEventNumber ) 12647 switch ( v4 )
12599 { 12648 {
12600 case 139: 12649 case 139:
12601 sub_4B1ECE(); 12650 sub_4B1ECE();
12602 break; 12651 break;
12603 case 311: 12652 case 311:
12607 sub_4BBCDD(); 12656 sub_4BBCDD();
12608 break; 12657 break;
12609 default: 12658 default:
12610 _5C3420_pDecoration = (LevelDecoration *)1; 12659 _5C3420_pDecoration = (LevelDecoration *)1;
12611 ptr_F8B1E8 = 0; 12660 ptr_F8B1E8 = 0;
12612 EventProcessor(pEventNumber, 0, 1); 12661 EventProcessor(v4, 0, 1);
12613 _5C3420_pDecoration = 0; 12662 _5C3420_pDecoration = 0;
12614 break; 12663 break;
12615 } 12664 }
12616 } 12665 }
12617 else 12666 else
12618 { 12667 {
12619 dword_F8B1D8 = newDialogueType; 12668 dword_F8B1D8 = newDialogueType;
12620 DrawJoinGuildWindow(pEventNumber - 400); 12669 sub_4B3EF0(v4 - 400);
12621 } 12670 }
12622 } 12671 }
12623 else 12672 else
12624 { 12673 {
12625 sub_4B3FE5(pEventNumber); 12674 sub_4B3FE5(v4);
12626 } 12675 }
12627 } 12676 }
12628 LABEL_87: 12677 LABEL_87:
12629 if ( !dword_7241C8 ) 12678 if ( !dword_7241C8 )
12630 pGame->Draw(); 12679 pGame->Draw();
13439 } 13488 }
13440 13489
13441 13490
13442 13491
13443 //----- (004B8F94) -------------------------------------------------------- 13492 //----- (004B8F94) --------------------------------------------------------
13444 void *__cdecl sub_4B8F94() 13493 void sub_4B8F94()
13445 { 13494 {
13446 GUIWindow *v0; // edi@1 13495 GUIWindow *v0; // edi@1
13447 signed int v1; // ebp@1 13496 signed int v1; // ebp@1
13448 int v2; // ebx@1 13497 int v2; // ebx@1
13449 signed int v3; // esi@1 13498 signed int v3; // esi@1
13489 v5 = word_4F07B6[v3 + 1]; 13538 v5 = word_4F07B6[v3 + 1];
13490 v12 = 44; 13539 v12 = 44;
13491 LABEL_12: 13540 LABEL_12:
13492 v6 = v12; 13541 v6 = v12;
13493 LABEL_13: 13542 LABEL_13:
13494 pItemsTable->GenerateItem(v5, v6, (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]); 13543 pItemsTable->GenerateItem(v5, v6,&pParty->Recipes_Item[v3][v1]);//(ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]);
13495 v0 = window_SpeakInHouse; 13544 v0 = window_SpeakInHouse;
13496 v2 = (int)&window_SpeakInHouse->ptr_1C; 13545 v2 = (int)&window_SpeakInHouse->ptr_1C;
13497 pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1; 13546 // pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1;
13547 pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v1].uAttributes= 1;
13498 goto LABEL_14; 13548 goto LABEL_14;
13499 } 13549 }
13500 auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]; 13550 // auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724];
13551 auto _a =&pParty->Recipes_Item[v3][v1];
13501 _a->Reset(); 13552 _a->Reset();
13502 v2 = (int)&v0->ptr_1C; 13553 // v2 = (int)&v0->ptr_1C;
13503 v10 = rand(); 13554 //v10 = rand();
13504 v0 = window_SpeakInHouse; 13555 // v0 = window_SpeakInHouse;
13505 pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740; 13556 // pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740;
13557 pParty->Recipes_Item[(int)v0->ptr_1C][v1].uItemID= rand() % 32 + 740;
13506 } 13558 }
13507 LABEL_14: 13559 LABEL_14:
13508 v3 = *(int *)v2; 13560 v3 = *(int *)v2;
13509 ++v1; 13561 ++v1;
13510 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * *(int *)v2]] ) 13562 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * *(int *)v2]] )
13517 v6 = word_4F063E[5 * v3 + rand() % 4 + 1]; 13569 v6 = word_4F063E[5 * v3 + rand() % 4 + 1];
13518 goto LABEL_13; 13570 goto LABEL_13;
13519 } 13571 }
13520 LABEL_15: 13572 LABEL_15:
13521 result = v0->ptr_1C; 13573 result = v0->ptr_1C;
13522 *(int *)&pParty->field_16154[4 * (int)result] = 0; 13574 pParty->field_16154[(int)v0->ptr_1C] = 0;
13523 return result;
13524 } 13575 }
13525 13576
13526 13577
13527 //----- (004B6478) -------------------------------------------------------- 13578 //----- (004B6478) --------------------------------------------------------
13528 int __cdecl sub_4B6478() 13579 int __cdecl sub_4B6478()
14783 { 14834 {
14784 if (~npc->uFlags & 0x80) 14835 if (~npc->uFlags & 0x80)
14785 //if ( !(*(char *)v6 & 0x80) ) 14836 //if ( !(*(char *)v6 & 0x80) )
14786 { 14837 {
14787 v7 = uNumDialogueNPCPortraits++ - dword_591080 ? 1 : 0; 14838 v7 = uNumDialogueNPCPortraits++ - dword_591080 ? 1 : 0;
14788 HouseNPCData[v7] = npc; 14839 array_5913D8[v7] = npc;
14789 //v6 = v17; 14840 //v6 = v17;
14790 //*(&v13 + v2) = *(v17 - 1); 14841 //*(&v13 + v2) = *(v17 - 1);
14791 Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID; 14842 Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID;
14792 //v1 = v18; 14843 //v1 = v18;
14793 if ((npc->uFlags & 3) != 2) 14844 if ((npc->uFlags & 3) != 2)
14997 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break; 15048 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break;
14998 default: assert(false); 15049 default: assert(false);
14999 } 15050 }
15000 15051
15001 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 15052 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
15002 pDialogueNPCCount = 0; 15053 array_5913D8[6] = 0;
15003 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17]; 15054 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
15004 uTextureID_507B04 = uTextureID_right_panel; 15055 uTextureID_507B04 = uTextureID_right_panel;
15005 PrepareHouse(uHouseID); 15056 PrepareHouse(uHouseID);
15006 v18 = 1; 15057 v18 = 1;
15007 uTextureID_507B04 = uTextureID_right_panel; 15058 uTextureID_507B04 = uTextureID_right_panel;
15008 if ( uNumDialogueNPCPortraits == 1 ) 15059 if ( uNumDialogueNPCPortraits == 1 )
15009 pDialogueNPCCount = 1; 15060 array_5913D8[6] = (NPCData *)1;
15010 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); 15061 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
15011 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 ) 15062 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 )
15012 { 15063 {
15013 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) ) 15064 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) )
15014 goto LABEL_49; 15065 goto LABEL_49;