Mercurial > mm7
comparison mm7_4.cpp @ 459:a7869569e912
HouseNPCData
author | Ritor1 |
---|---|
date | Sun, 24 Feb 2013 21:23:26 +0600 |
parents | c0ab5f64b37b |
children | 62ca9e2e1432 37090bd974f9 |
comparison
equal
deleted
inserted
replaced
458:c0ab5f64b37b | 459:a7869569e912 |
---|---|
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 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)]; | 4919 npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(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; |
9374 // 722B3C: using guessed type int dword_722B3C; | 9374 // 722B3C: using guessed type int dword_722B3C; |
9375 // 722B44: using guessed type int dword_722B44; | 9375 // 722B44: using guessed type int dword_722B44; |
9376 // F8B1A8: using guessed type int dword_F8B1A8; | 9376 // F8B1A8: using guessed type int dword_F8B1A8; |
9377 | 9377 |
9378 //----- (004B2001) -------------------------------------------------------- | 9378 //----- (004B2001) -------------------------------------------------------- |
9379 void __fastcall sub_4B2001(signed int a1) | 9379 void __fastcall ClickNPCTopic(signed int uMessageParam) |
9380 { | 9380 { |
9381 signed int v1; // eax@1 | 9381 //signed int v1; // eax@1 |
9382 NPCData *v2; // ebp@1 | 9382 NPCData *pCurrentNPCInfo; // ebp@1 |
9383 int v3; // ecx@8 | 9383 int pEventNumber; // ecx@8 |
9384 Player *v4; // esi@20 | 9384 Player *v4; // esi@20 |
9385 int v5; // eax@28 | 9385 int v5; // eax@28 |
9386 int v6; // eax@31 | 9386 int v6; // eax@31 |
9387 int v7; // eax@34 | 9387 int v7; // eax@34 |
9388 int v8; // eax@37 | 9388 int v8; // eax@37 |
9402 char *v22; // [sp-Ch] [bp-18h]@73 | 9402 char *v22; // [sp-Ch] [bp-18h]@73 |
9403 int v23; // [sp-8h] [bp-14h]@49 | 9403 int v23; // [sp-8h] [bp-14h]@49 |
9404 char *v24; // [sp-8h] [bp-14h]@73 | 9404 char *v24; // [sp-8h] [bp-14h]@73 |
9405 int v25; // [sp-4h] [bp-10h]@49 | 9405 int v25; // [sp-4h] [bp-10h]@49 |
9406 | 9406 |
9407 v1 = a1; | 9407 //v1 = a1; |
9408 uDialogueType = a1 + 1; | 9408 uDialogueType = uMessageParam + 1; |
9409 v2 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)]; | 9409 pCurrentNPCInfo = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; |
9410 if ( a1 <= 23 ) | 9410 switch ( uMessageParam ) |
9411 { | 9411 { |
9412 if ( a1 == 23 ) | 9412 case 13: |
9413 { | 9413 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); |
9414 v3 = v2->evt_E; | 9414 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); |
9415 } | 9415 sub_4B40E6(); |
9416 else | 9416 dialogue_show_profession_details = false; |
9417 { | 9417 goto _return; |
9418 if ( a1 == 13 ) | 9418 case 19: |
9419 { | 9419 pEventNumber = pCurrentNPCInfo->evt_A; |
9420 ptr_F8B1E8 = pNPCStats->pProfessions[v2->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); | 9420 break; |
9421 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); | 9421 case 20: |
9422 sub_4B40E6(); | 9422 pEventNumber = pCurrentNPCInfo->evt_B; |
9423 dialogue_show_profession_details = false; | 9423 break; |
9424 case 21: | |
9425 pEventNumber = pCurrentNPCInfo->evt_C; | |
9426 break; | |
9427 case 22: | |
9428 pEventNumber = pCurrentNPCInfo->evt_D; | |
9429 break; | |
9430 case 23: | |
9431 pEventNumber = pCurrentNPCInfo->evt_E; | |
9432 break; | |
9433 case 24: | |
9434 pEventNumber = pCurrentNPCInfo->evt_F; | |
9435 break; | |
9436 default: | |
9424 goto _return; | 9437 goto _return; |
9425 } | 9438 } |
9426 switch ( a1 ) | 9439 if ( pEventNumber < 200 || pEventNumber > 310 ) |
9427 { | 9440 { |
9428 case 19: | 9441 if ( pEventNumber < 400 || pEventNumber > 410 ) |
9429 v3 = v2->evt_A; | 9442 { |
9430 break; | 9443 if ( pEventNumber == 139 ) |
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 ) | |
9455 { | 9444 { |
9456 sub_4B1ECE(); | 9445 sub_4B1ECE(); |
9457 } | 9446 } |
9458 else | 9447 else |
9459 { | 9448 { |
9460 if ( v3 == 311 ) | 9449 if ( pEventNumber == 311 ) |
9461 { | 9450 { |
9462 sub_4BBA85_bounties(); | 9451 sub_4BBA85_bounties(); |
9463 } | 9452 } |
9464 else | 9453 else |
9465 { | 9454 { |
9466 ptr_F8B1E8 = 0; | 9455 ptr_F8B1E8 = 0; |
9467 _5C3420_pDecoration = (LevelDecoration *)1; | 9456 _5C3420_pDecoration = (LevelDecoration *)1; |
9468 EventProcessor(v3, 0, 1); | 9457 EventProcessor(pEventNumber, 0, 1); |
9469 _5C3420_pDecoration = 0; | 9458 _5C3420_pDecoration = 0; |
9470 } | 9459 } |
9471 } | 9460 } |
9472 } | 9461 } |
9473 else | 9462 else |
9474 { | 9463 { |
9475 dword_F8B1D8 = v1; | 9464 dword_F8B1D8 = uMessageParam; |
9476 sub_4B3EF0(v3 - 400); | 9465 DrawJoinGuildWindow(pEventNumber - 400); |
9477 } | 9466 } |
9478 } | 9467 } |
9479 else | 9468 else |
9480 { | 9469 { |
9481 sub_4B3FE5(v3); | 9470 sub_4B3FE5(pEventNumber); |
9482 } | 9471 } |
9483 goto _return; | 9472 goto _return; |
9484 } | 9473 |
9485 if ( a1 != 76 ) | 9474 if ( uMessageParam != 76 ) |
9486 { | 9475 { |
9487 if ( a1 == 77 ) | 9476 if ( uMessageParam == 77 ) |
9488 { | 9477 { |
9489 v16 = v2->uProfession; | 9478 v16 = pCurrentNPCInfo->uProfession; |
9490 if (dialogue_show_profession_details) | 9479 if (dialogue_show_profession_details) |
9491 v17 = pNPCStats->pProfessions[v2->uProfession - 1].pJoinText; | 9480 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; |
9492 else | 9481 else |
9493 v17 = pNPCStats->pProfessions[v2->uProfession - 1].pBenefits; | 9482 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pBenefits; |
9494 ptr_F8B1E8 = v17; | 9483 ptr_F8B1E8 = v17; |
9495 v18 = BuilDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0); | 9484 v18 = BuilDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0); |
9496 dialogue_show_profession_details = ~dialogue_show_profession_details; | 9485 dialogue_show_profession_details = ~dialogue_show_profession_details; |
9497 ptr_F8B1E8 = v18; | 9486 ptr_F8B1E8 = v18; |
9498 } | 9487 } |
9499 else | 9488 else |
9500 { | 9489 { |
9501 if ( a1 == 79 ) | 9490 if ( uMessageParam == 79 ) |
9502 { | 9491 { |
9503 if ( dword_F8B1A8 ) | 9492 if ( dword_F8B1A8 ) |
9504 { | 9493 { |
9505 Party::TakeGold(gold_transaction_amount); | 9494 Party::TakeGold(gold_transaction_amount); |
9506 if ( uActiveCharacter ) | 9495 if ( uActiveCharacter ) |
9534 }*/ | 9523 }*/ |
9535 } | 9524 } |
9536 } | 9525 } |
9537 else | 9526 else |
9538 { | 9527 { |
9539 if ( a1 == 82 && dword_F8B1A8 ) | 9528 if ( uMessageParam == 82 && dword_F8B1A8 ) |
9540 { | 9529 { |
9541 Party::TakeGold(gold_transaction_amount); | 9530 Party::TakeGold(gold_transaction_amount); |
9542 v4 = pParty->pPlayers; | 9531 v4 = pParty->pPlayers; |
9543 do | 9532 do |
9544 { | 9533 { |
9547 } | 9536 } |
9548 while ( (signed int)v4 < (signed int)pParty->pHirelings ); | 9537 while ( (signed int)v4 < (signed int)pParty->pHirelings ); |
9549 switch ( dword_F8B1D8 ) | 9538 switch ( dword_F8B1D8 ) |
9550 { | 9539 { |
9551 case 19: | 9540 case 19: |
9552 v10 = v2->evt_A; | 9541 v10 = pCurrentNPCInfo->evt_A; |
9553 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 ) | 9542 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 ) |
9554 v2->evt_A = 0; | 9543 pCurrentNPCInfo->evt_A = 0; |
9555 break; | 9544 break; |
9556 case 20: | 9545 case 20: |
9557 v9 = v2->evt_B; | 9546 v9 = pCurrentNPCInfo->evt_B; |
9558 if ( v9 >= 400 && v9 <= 416 ) | 9547 if ( v9 >= 400 && v9 <= 416 ) |
9559 v2->evt_B = 0; | 9548 pCurrentNPCInfo->evt_B = 0; |
9560 break; | 9549 break; |
9561 case 21: | 9550 case 21: |
9562 v8 = v2->evt_C; | 9551 v8 = pCurrentNPCInfo->evt_C; |
9563 if ( v8 >= 400 && v8 <= 416 ) | 9552 if ( v8 >= 400 && v8 <= 416 ) |
9564 v2->evt_C = 0; | 9553 pCurrentNPCInfo->evt_C = 0; |
9565 break; | 9554 break; |
9566 case 22: | 9555 case 22: |
9567 v7 = v2->evt_D; | 9556 v7 = pCurrentNPCInfo->evt_D; |
9568 if ( v7 >= 400 && v7 <= 416 ) | 9557 if ( v7 >= 400 && v7 <= 416 ) |
9569 v2->evt_D = 0; | 9558 pCurrentNPCInfo->evt_D = 0; |
9570 break; | 9559 break; |
9571 case 23: | 9560 case 23: |
9572 v6 = v2->evt_E; | 9561 v6 = pCurrentNPCInfo->evt_E; |
9573 if ( v6 >= 400 && v6 <= 416 ) | 9562 if ( v6 >= 400 && v6 <= 416 ) |
9574 v2->evt_E = 0; | 9563 pCurrentNPCInfo->evt_E = 0; |
9575 break; | 9564 break; |
9576 case 24: | 9565 case 24: |
9577 v5 = v2->evt_F; | 9566 v5 = pCurrentNPCInfo->evt_F; |
9578 if ( v5 >= 400 ) | 9567 if ( v5 >= 400 ) |
9579 { | 9568 { |
9580 if ( v5 <= 416 ) | 9569 if ( v5 <= 416 ) |
9581 v2->evt_F = 0; | 9570 pCurrentNPCInfo->evt_F = 0; |
9582 } | 9571 } |
9583 break; | 9572 break; |
9584 } | 9573 } |
9585 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 9574 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
9586 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 9575 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
9610 LABEL_77: | 9599 LABEL_77: |
9611 ShowStatusBarString(v19, 2u); | 9600 ShowStatusBarString(v19, 2u); |
9612 goto _return; | 9601 goto _return; |
9613 } | 9602 } |
9614 //v20 = v2->uProfession; | 9603 //v20 = v2->uProfession; |
9615 if ( v2->uProfession != 51 ) | 9604 if ( pCurrentNPCInfo->uProfession != 51 ) |
9616 { | 9605 { |
9617 v21 = pNPCStats->pProfessions[v2->uProfession - 1].uHirePrice; | 9606 v21 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].uHirePrice; |
9618 if ( pParty->uNumGold < v21 ) | 9607 if ( pParty->uNumGold < v21 ) |
9619 { | 9608 { |
9620 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); | 9609 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); |
9621 dialogue_show_profession_details = false; | 9610 dialogue_show_profession_details = false; |
9622 uDialogueType = 13; | 9611 uDialogueType = 13; |
9623 ptr_F8B1E8 = pNPCStats->pProfessions[v2->uProfession - 1].pJoinText; | 9612 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; |
9624 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); | 9613 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); |
9625 if ( uActiveCharacter ) | 9614 if ( uActiveCharacter ) |
9626 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | 9615 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); |
9627 v19 = pGlobalTXT_LocalizationStrings[155]; | 9616 v19 = pGlobalTXT_LocalizationStrings[155]; |
9628 goto LABEL_77; | 9617 goto LABEL_77; |
9629 } | 9618 } |
9630 Party::TakeGold(v21); | 9619 Party::TakeGold(v21); |
9631 } | 9620 } |
9632 //LOBYTE(v2->uFlags) |= 0x80u; | 9621 //LOBYTE(v2->uFlags) |= 0x80u; |
9633 v2->uFlags = 128; | 9622 pCurrentNPCInfo->uFlags = 128; |
9634 pParty->field_709 = 0; | 9623 pParty->field_709 = 0; |
9635 sub_44A56A(); | 9624 sub_44A56A(); |
9636 if ( pParty->pHirelings[0].pName ) | 9625 if ( pParty->pHirelings[0].pName ) |
9637 { | 9626 { |
9638 memcpy(&pParty->pHirelings[1], v2, sizeof(pParty->pHirelings[1])); | 9627 memcpy(&pParty->pHirelings[1], pCurrentNPCInfo, sizeof(pParty->pHirelings[1])); |
9639 v24 = v2->pName; | 9628 v24 = pCurrentNPCInfo->pName; |
9640 v22 = pParty->pHireling2Name; | 9629 v22 = pParty->pHireling2Name; |
9641 } | 9630 } |
9642 else | 9631 else |
9643 { | 9632 { |
9644 memcpy(pParty->pHirelings, v2, 0x4Cu); | 9633 memcpy(pParty->pHirelings, pCurrentNPCInfo, 0x4Cu); |
9645 v24 = v2->pName; | 9634 v24 = pCurrentNPCInfo->pName; |
9646 v22 = pParty->pHireling1Name; | 9635 v22 = pParty->pHireling1Name; |
9647 } | 9636 } |
9648 strcpy(v22, v24); | 9637 strcpy(v22, v24); |
9649 pParty->field_709 = 0; | 9638 pParty->field_709 = 0; |
9650 sub_44A56A(); | 9639 sub_44A56A(); |
10000 } | 9989 } |
10001 | 9990 |
10002 | 9991 |
10003 | 9992 |
10004 //----- (004B29F2) -------------------------------------------------------- | 9993 //----- (004B29F2) -------------------------------------------------------- |
10005 const char *__fastcall sub_4B29F2(int a1) | 9994 const char *__fastcall ContractSelectText(int pEventNumber) |
10006 { | 9995 { |
10007 int v1; // esi@1 | |
10008 Player *v2; // edi@1 | |
10009 int v3; // eax@1 | |
10010 Player *v4; // ecx@1 | |
10011 | |
10012 v1 = a1; | |
10013 dword_F8B1A8 = 0; | 9996 dword_F8B1A8 = 0; |
10014 v2 = pPlayers[uActiveCharacter]; | 9997 dword_F8B1AC_something_todo_with_awards = pEventNumber + 50; |
10015 v3 = a1 + 50; | 9998 gold_transaction_amount = dword_4F08EC[pEventNumber]; |
10016 v4 = pPlayers[uActiveCharacter]; | 9999 if ( pPlayers[uActiveCharacter]->CanAct() ) |
10017 dword_F8B1AC_something_todo_with_awards = v3; | 10000 { |
10018 gold_transaction_amount = dword_4F08EC[v1]; | 10001 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->field_152, dword_F8B1AC_something_todo_with_awards) ) |
10019 if ( v4->CanAct() ) | |
10020 { | |
10021 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)v2->field_152, dword_F8B1AC_something_todo_with_awards) ) | |
10022 { | 10002 { |
10023 return pNPCTopics[123].pText; | 10003 return pNPCTopics[123].pText; |
10024 } | 10004 } |
10025 else | 10005 else |
10026 { | 10006 { |
10027 if ( gold_transaction_amount <= pParty->uNumGold ) | 10007 if ( gold_transaction_amount <= pParty->uNumGold ) |
10028 { | 10008 { |
10029 dword_F8B1A8 = 1; | 10009 dword_F8B1A8 = 1; |
10030 return pNPCTopics[v1 + 110].pText; | 10010 return pNPCTopics[pEventNumber + 110].pText; |
10031 } | 10011 } |
10032 else | 10012 else |
10033 { | 10013 { |
10034 return pNPCTopics[124].pText; | 10014 return pNPCTopics[124].pText; |
10035 } | 10015 } |
10041 } | 10021 } |
10042 } | 10022 } |
10043 | 10023 |
10044 | 10024 |
10045 //----- (004B2A74) -------------------------------------------------------- | 10025 //----- (004B2A74) -------------------------------------------------------- |
10046 char __cdecl SimpleHouseDialog() | 10026 char __cdecl SimpleHouseAndBoatsDialog() |
10047 { | 10027 { |
10048 char *v0; // esi@3 | 10028 char *v0; // esi@3 |
10049 char *v1; // ST1C_4@3 | 10029 char *v1; // ST1C_4@3 |
10050 char *v2; // eax@3 | 10030 char *v2; // eax@3 |
10051 const char *v3; // ST1C_4@5 | 10031 const char *v3; // ST1C_4@5 |
10103 int v56; // [sp+110h] [bp-Ch]@13 | 10083 int v56; // [sp+110h] [bp-Ch]@13 |
10104 char *pInString; // [sp+114h] [bp-8h]@12 | 10084 char *pInString; // [sp+114h] [bp-8h]@12 |
10105 NPCData *v58; // [sp+118h] [bp-4h]@6 | 10085 NPCData *v58; // [sp+118h] [bp-4h]@6 |
10106 | 10086 |
10107 memcpy(&a1, pDialogueWindow, sizeof(a1)); | 10087 memcpy(&a1, pDialogueWindow, sizeof(a1)); |
10108 if ( array_5913D8[6] == (NPCData *)uNumDialogueNPCPortraits && uHouse_ExitPic ) | 10088 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
10109 { | 10089 { |
10110 v0 = pMapStats->pInfos[uHouse_ExitPic].pName; | 10090 v0 = pMapStats->pInfos[uHouse_ExitPic].pName; |
10111 v1 = pMapStats->pInfos[uHouse_ExitPic].pName; | 10091 v1 = pMapStats->pInfos[uHouse_ExitPic].pName; |
10112 a1.uFrameX = 493; | 10092 a1.uFrameX = 493; |
10113 a1.uFrameWidth = 126; | 10093 a1.uFrameWidth = 126; |
10127 LOBYTE(i) = (unsigned int)a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u); | 10107 LOBYTE(i) = (unsigned int)a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u); |
10128 return i; | 10108 return i; |
10129 } | 10109 } |
10130 a1.uFrameWidth -= 10; | 10110 a1.uFrameWidth -= 10; |
10131 a1.uFrameZ -= 10; | 10111 a1.uFrameZ -= 10; |
10132 v58 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)]; | 10112 v58 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; |
10133 v6 = v58; | 10113 v6 = v58; |
10134 v55 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 10114 v55 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
10135 v7 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); | 10115 v7 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); |
10136 v8 = v6->uProfession; | 10116 v8 = v6->uProfession; |
10137 if ( v8 ) | 10117 if ( v8 ) |
10202 goto LABEL_49; | 10182 goto LABEL_49; |
10203 } | 10183 } |
10204 v27 = v26 - 3; | 10184 v27 = v26 - 3; |
10205 if ( !v27 ) | 10185 if ( !v27 ) |
10206 { | 10186 { |
10207 v33 = (char *)sub_4B29F2((int)v52.ptr_1C); | 10187 v33 = (char *)ContractSelectText((int)v52.ptr_1C); |
10208 goto LABEL_44; | 10188 goto LABEL_44; |
10209 } | 10189 } |
10210 v28 = v27 - 1; | 10190 v28 = v27 - 1; |
10211 if ( !v28 ) | 10191 if ( !v28 ) |
10212 { | 10192 { |
11059 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять | 11039 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять |
11060 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1); | 11040 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1); |
11061 } | 11041 } |
11062 | 11042 |
11063 //----- (004B3EF0) -------------------------------------------------------- | 11043 //----- (004B3EF0) -------------------------------------------------------- |
11064 void __fastcall sub_4B3EF0(int a4) | 11044 void __fastcall DrawJoinGuildWindow(int pEventNumber) |
11065 { | 11045 { |
11066 int v1; // edi@1 | |
11067 | |
11068 v1 = a4; | |
11069 uDialogueType = 81; | 11046 uDialogueType = 81; |
11070 ptr_F8B1E8 = (char *)pNPCTopics[a4 + 99].pText; | 11047 ptr_F8B1E8 = (char *)pNPCTopics[pEventNumber + 99].pText; |
11071 sub_4B29F2(a4); | 11048 ContractSelectText(pEventNumber); |
11072 pDialogueWindow->Release(); | 11049 pDialogueWindow->Release(); |
11073 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, v1, 0); | 11050 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventNumber, 0); |
11074 pBtn_ExitCancel = pDialogueWindow->CreateButton( | 11051 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], |
11075 0x1D7, | 11052 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); |
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); | |
11087 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); | 11053 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); |
11088 pDialogueWindow->CreateButton( | 11054 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); |
11089 0x1E0u, | |
11090 0xA0u, | |
11091 0x8Cu, | |
11092 0x1Eu, | |
11093 1, | |
11094 0, | |
11095 0xAFu, | |
11096 0x52u, | |
11097 0, | |
11098 pGlobalTXT_LocalizationStrings[122], | |
11099 0); | |
11100 pDialogueWindow->_41D08F(1, 1, 0, 2); | 11055 pDialogueWindow->_41D08F(1, 1, 0, 2); |
11101 dword_F8B19C = -1; | 11056 dword_F8B19C = -1; |
11102 } | 11057 } |
11103 // F8B19C: using guessed type int dword_F8B19C; | 11058 // F8B19C: using guessed type int dword_F8B19C; |
11104 | 11059 |
11143 { | 11098 { |
11144 signed int v0; // ebx@1 | 11099 signed int v0; // ebx@1 |
11145 NPCData *v1; // edi@1 | 11100 NPCData *v1; // edi@1 |
11146 | 11101 |
11147 v0 = 0; | 11102 v0 = 0; |
11148 v1 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)]; | 11103 v1 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; |
11149 pDialogueWindow->Release(); | 11104 pDialogueWindow->Release(); |
11150 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); | 11105 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); |
11151 pBtn_ExitCancel = pDialogueWindow->CreateButton( | 11106 pBtn_ExitCancel = pDialogueWindow->CreateButton( |
11152 0x1D7u, | 11107 0x1D7u, |
11153 0x1BDu, | 11108 0x1BDu, |
11208 int v14; // eax@36 | 11163 int v14; // eax@36 |
11209 int v16; // eax@41 | 11164 int v16; // eax@41 |
11210 NPCData *v17; // [sp+10h] [bp-4h]@4 | 11165 NPCData *v17; // [sp+10h] [bp-4h]@4 |
11211 | 11166 |
11212 num_menu_buttons = 0; | 11167 num_menu_buttons = 0; |
11213 array_5913D8[6] = (NPCData *)(_this + 1); | 11168 pDialogueNPCCount = (_this + 1); |
11214 if ( _this + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) | 11169 if ( _this + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
11215 { | 11170 { |
11216 pDialogueWindow->Release(); | 11171 pDialogueWindow->Release(); |
11217 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); | 11172 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); |
11218 sprintf(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName); | 11173 sprintf(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName); |
11225 pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0, 0xBFu, 1u, 0x20u, sHouseName, 0); | 11180 pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0, 0xBFu, 1u, 0x20u, sHouseName, 0); |
11226 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); | 11181 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); |
11227 } | 11182 } |
11228 else | 11183 else |
11229 { | 11184 { |
11230 v17 = array_5913D8[_this + 1 - ((dword_591080 != 0) + 1)]; | 11185 v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) + 1)]; |
11231 if ( dword_F8B19C == -1 ) | 11186 if ( dword_F8B19C == -1 ) |
11232 { | 11187 { |
11233 pDialogueWindow->Release(); | 11188 pDialogueWindow->Release(); |
11234 } | 11189 } |
11235 else | 11190 else |
11236 { | 11191 { |
11237 for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) | 11192 for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) |
11238 GUIButton::_41D0D8((GUIButton *)array_5913D8[i + 7]); | 11193 GUIButton::_41D0D8((GUIButton *)HouseNPCData[i + 7]); |
11239 } | 11194 } |
11240 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); | 11195 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); |
11241 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, 0x71u, 0, 0, | 11196 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, 0x71u, 0, 0, |
11242 pGlobalTXT_LocalizationStrings[74],// "End Conversation" | 11197 pGlobalTXT_LocalizationStrings[74],// "End Conversation" |
11243 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); | 11198 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); |
11244 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0); | 11199 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0); |
11245 if ( array_5913D8[6] == (NPCData *)1 && dword_591080 ) | 11200 if ( pDialogueNPCCount == 1 && dword_591080 ) |
11246 { | 11201 { |
11247 sub_4B3B42(dword_F8B198); | 11202 sub_4B3B42(dword_F8B198); |
11248 } | 11203 } |
11249 else | 11204 else |
11250 { | 11205 { |
12664 } | 12619 } |
12665 } | 12620 } |
12666 else | 12621 else |
12667 { | 12622 { |
12668 dword_F8B1D8 = newDialogueType; | 12623 dword_F8B1D8 = newDialogueType; |
12669 sub_4B3EF0(v4 - 400); | 12624 DrawJoinGuildWindow(v4 - 400); |
12670 } | 12625 } |
12671 } | 12626 } |
12672 else | 12627 else |
12673 { | 12628 { |
12674 sub_4B3FE5(v4); | 12629 sub_4B3FE5(v4); |
14834 { | 14789 { |
14835 if (~npc->uFlags & 0x80) | 14790 if (~npc->uFlags & 0x80) |
14836 //if ( !(*(char *)v6 & 0x80) ) | 14791 //if ( !(*(char *)v6 & 0x80) ) |
14837 { | 14792 { |
14838 v7 = uNumDialogueNPCPortraits++ - dword_591080 ? 1 : 0; | 14793 v7 = uNumDialogueNPCPortraits++ - dword_591080 ? 1 : 0; |
14839 array_5913D8[v7] = npc; | 14794 HouseNPCData[v7] = npc; |
14840 //v6 = v17; | 14795 //v6 = v17; |
14841 //*(&v13 + v2) = *(v17 - 1); | 14796 //*(&v13 + v2) = *(v17 - 1); |
14842 Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID; | 14797 Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID; |
14843 //v1 = v18; | 14798 //v1 = v18; |
14844 if ((npc->uFlags & 3) != 2) | 14799 if ((npc->uFlags & 3) != 2) |
15048 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break; | 15003 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break; |
15049 default: assert(false); | 15004 default: assert(false); |
15050 } | 15005 } |
15051 | 15006 |
15052 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | 15007 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); |
15053 array_5913D8[6] = 0; | 15008 pDialogueNPCCount = 0; |
15054 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17]; | 15009 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17]; |
15055 uTextureID_507B04 = uTextureID_right_panel; | 15010 uTextureID_507B04 = uTextureID_right_panel; |
15056 PrepareHouse(uHouseID); | 15011 PrepareHouse(uHouseID); |
15057 v18 = 1; | 15012 v18 = 1; |
15058 uTextureID_507B04 = uTextureID_right_panel; | 15013 uTextureID_507B04 = uTextureID_right_panel; |
15059 if ( uNumDialogueNPCPortraits == 1 ) | 15014 if ( uNumDialogueNPCPortraits == 1 ) |
15060 array_5913D8[6] = (NPCData *)1; | 15015 pDialogueNPCCount = 1; |
15061 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); | 15016 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); |
15062 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 ) | 15017 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 ) |
15063 { | 15018 { |
15064 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) ) | 15019 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) ) |
15065 goto LABEL_49; | 15020 goto LABEL_49; |