Mercurial > mm7
comparison mm7_4.cpp @ 457:e5cf03a3d98e
m
author | Ritor1 |
---|---|
date | Sun, 24 Feb 2013 20:39:03 +0600 |
parents | 20d96ec810c8 |
children | c0ab5f64b37b |
comparison
equal
deleted
inserted
replaced
456:20d96ec810c8 | 457:e5cf03a3d98e |
---|---|
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; |
9373 // 722B3C: using guessed type int dword_722B3C; | 9373 // 722B3C: using guessed type int dword_722B3C; |
9374 // 722B44: using guessed type int dword_722B44; | 9374 // 722B44: using guessed type int dword_722B44; |
9375 // F8B1A8: using guessed type int dword_F8B1A8; | 9375 // F8B1A8: using guessed type int dword_F8B1A8; |
9376 | 9376 |
9377 //----- (004B2001) -------------------------------------------------------- | 9377 //----- (004B2001) -------------------------------------------------------- |
9378 void __fastcall sub_4B2001(signed int a1) | 9378 void __fastcall ClickNPCTopic(signed int uMessageParam) |
9379 { | 9379 { |
9380 signed int v1; // eax@1 | 9380 //signed int v1; // eax@1 |
9381 NPCData *v2; // ebp@1 | 9381 NPCData *pCurrentNPCInfo; // ebp@1 |
9382 int v3; // ecx@8 | 9382 int pEventNumber; // ecx@8 |
9383 Player *v4; // esi@20 | 9383 Player *v4; // esi@20 |
9384 int v5; // eax@28 | 9384 int v5; // eax@28 |
9385 int v6; // eax@31 | 9385 int v6; // eax@31 |
9386 int v7; // eax@34 | 9386 int v7; // eax@34 |
9387 int v8; // eax@37 | 9387 int v8; // eax@37 |
9401 char *v22; // [sp-Ch] [bp-18h]@73 | 9401 char *v22; // [sp-Ch] [bp-18h]@73 |
9402 int v23; // [sp-8h] [bp-14h]@49 | 9402 int v23; // [sp-8h] [bp-14h]@49 |
9403 char *v24; // [sp-8h] [bp-14h]@73 | 9403 char *v24; // [sp-8h] [bp-14h]@73 |
9404 int v25; // [sp-4h] [bp-10h]@49 | 9404 int v25; // [sp-4h] [bp-10h]@49 |
9405 | 9405 |
9406 v1 = a1; | 9406 //v1 = a1; |
9407 uDialogueType = a1 + 1; | 9407 uDialogueType = uMessageParam + 1; |
9408 v2 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)]; | 9408 pCurrentNPCInfo = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; |
9409 if ( a1 <= 23 ) | 9409 switch ( uMessageParam ) |
9410 { | 9410 { |
9411 if ( a1 == 23 ) | 9411 case 13: |
9412 { | 9412 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); |
9413 v3 = v2->evt_E; | 9413 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); |
9414 } | 9414 sub_4B40E6(); |
9415 else | 9415 dialogue_show_profession_details = false; |
9416 { | 9416 goto _return; |
9417 if ( a1 == 13 ) | 9417 case 19: |
9418 { | 9418 pEventNumber = pCurrentNPCInfo->evt_A; |
9419 ptr_F8B1E8 = pNPCStats->pProfessions[v2->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); | 9419 break; |
9420 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); | 9420 case 20: |
9421 sub_4B40E6(); | 9421 pEventNumber = pCurrentNPCInfo->evt_B; |
9422 dialogue_show_profession_details = false; | 9422 break; |
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: | |
9423 goto _return; | 9436 goto _return; |
9424 } | 9437 } |
9425 switch ( a1 ) | 9438 if ( pEventNumber < 200 || pEventNumber > 310 ) |
9426 { | 9439 { |
9427 case 19: | 9440 if ( pEventNumber < 400 || pEventNumber > 410 ) |
9428 v3 = v2->evt_A; | 9441 { |
9429 break; | 9442 if ( pEventNumber == 139 ) |
9430 case 20: | |
9431 v3 = v2->evt_B; | |
9432 break; | |
9433 case 21: | |
9434 v3 = v2->evt_C; | |
9435 break; | |
9436 default: | |
9437 if ( a1 != 22 ) | |
9438 goto _return; | |
9439 v3 = v2->evt_D; | |
9440 break; | |
9441 } | |
9442 } | |
9443 goto LABEL_84; | |
9444 } | |
9445 if ( a1 == 24 ) | |
9446 { | |
9447 v3 = v2->evt_F; | |
9448 LABEL_84: | |
9449 if ( v3 < 200 || v3 > 310 ) | |
9450 { | |
9451 if ( v3 < 400 || v3 > 410 ) | |
9452 { | |
9453 if ( v3 == 139 ) | |
9454 { | 9443 { |
9455 sub_4B1ECE(); | 9444 sub_4B1ECE(); |
9456 } | 9445 } |
9457 else | 9446 else |
9458 { | 9447 { |
9459 if ( v3 == 311 ) | 9448 if ( pEventNumber == 311 ) |
9460 { | 9449 { |
9461 sub_4BBA85_bounties(); | 9450 sub_4BBA85_bounties(); |
9462 } | 9451 } |
9463 else | 9452 else |
9464 { | 9453 { |
9465 ptr_F8B1E8 = 0; | 9454 ptr_F8B1E8 = 0; |
9466 _5C3420_pDecoration = (LevelDecoration *)1; | 9455 _5C3420_pDecoration = (LevelDecoration *)1; |
9467 EventProcessor(v3, 0, 1); | 9456 EventProcessor(pEventNumber, 0, 1); |
9468 _5C3420_pDecoration = 0; | 9457 _5C3420_pDecoration = 0; |
9469 } | 9458 } |
9470 } | 9459 } |
9471 } | 9460 } |
9472 else | 9461 else |
9473 { | 9462 { |
9474 dword_F8B1D8 = v1; | 9463 dword_F8B1D8 = uMessageParam; |
9475 sub_4B3EF0(v3 - 400); | 9464 DrawJoinGuildWindow(pEventNumber - 400); |
9476 } | 9465 } |
9477 } | 9466 } |
9478 else | 9467 else |
9479 { | 9468 { |
9480 sub_4B3FE5(v3); | 9469 sub_4B3FE5(pEventNumber); |
9481 } | 9470 } |
9482 goto _return; | 9471 goto _return; |
9483 } | 9472 |
9484 if ( a1 != 76 ) | 9473 if ( uMessageParam != 76 ) |
9485 { | 9474 { |
9486 if ( a1 == 77 ) | 9475 if ( uMessageParam == 77 ) |
9487 { | 9476 { |
9488 v16 = v2->uProfession; | 9477 v16 = pCurrentNPCInfo->uProfession; |
9489 if (dialogue_show_profession_details) | 9478 if (dialogue_show_profession_details) |
9490 v17 = pNPCStats->pProfessions[v2->uProfession - 1].pJoinText; | 9479 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; |
9491 else | 9480 else |
9492 v17 = pNPCStats->pProfessions[v2->uProfession - 1].pBenefits; | 9481 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pBenefits; |
9493 ptr_F8B1E8 = v17; | 9482 ptr_F8B1E8 = v17; |
9494 v18 = BuilDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0); | 9483 v18 = BuilDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0); |
9495 dialogue_show_profession_details = ~dialogue_show_profession_details; | 9484 dialogue_show_profession_details = ~dialogue_show_profession_details; |
9496 ptr_F8B1E8 = v18; | 9485 ptr_F8B1E8 = v18; |
9497 } | 9486 } |
9498 else | 9487 else |
9499 { | 9488 { |
9500 if ( a1 == 79 ) | 9489 if ( uMessageParam == 79 ) |
9501 { | 9490 { |
9502 if ( dword_F8B1A8 ) | 9491 if ( dword_F8B1A8 ) |
9503 { | 9492 { |
9504 Party::TakeGold(gold_transaction_amount); | 9493 Party::TakeGold(gold_transaction_amount); |
9505 if ( uActiveCharacter ) | 9494 if ( uActiveCharacter ) |
9533 }*/ | 9522 }*/ |
9534 } | 9523 } |
9535 } | 9524 } |
9536 else | 9525 else |
9537 { | 9526 { |
9538 if ( a1 == 82 && dword_F8B1A8 ) | 9527 if ( uMessageParam == 82 && dword_F8B1A8 ) |
9539 { | 9528 { |
9540 Party::TakeGold(gold_transaction_amount); | 9529 Party::TakeGold(gold_transaction_amount); |
9541 v4 = pParty->pPlayers; | 9530 v4 = pParty->pPlayers; |
9542 do | 9531 do |
9543 { | 9532 { |
9546 } | 9535 } |
9547 while ( (signed int)v4 < (signed int)pParty->pHirelings ); | 9536 while ( (signed int)v4 < (signed int)pParty->pHirelings ); |
9548 switch ( dword_F8B1D8 ) | 9537 switch ( dword_F8B1D8 ) |
9549 { | 9538 { |
9550 case 19: | 9539 case 19: |
9551 v10 = v2->evt_A; | 9540 v10 = pCurrentNPCInfo->evt_A; |
9552 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 ) | 9541 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 ) |
9553 v2->evt_A = 0; | 9542 pCurrentNPCInfo->evt_A = 0; |
9554 break; | 9543 break; |
9555 case 20: | 9544 case 20: |
9556 v9 = v2->evt_B; | 9545 v9 = pCurrentNPCInfo->evt_B; |
9557 if ( v9 >= 400 && v9 <= 416 ) | 9546 if ( v9 >= 400 && v9 <= 416 ) |
9558 v2->evt_B = 0; | 9547 pCurrentNPCInfo->evt_B = 0; |
9559 break; | 9548 break; |
9560 case 21: | 9549 case 21: |
9561 v8 = v2->evt_C; | 9550 v8 = pCurrentNPCInfo->evt_C; |
9562 if ( v8 >= 400 && v8 <= 416 ) | 9551 if ( v8 >= 400 && v8 <= 416 ) |
9563 v2->evt_C = 0; | 9552 pCurrentNPCInfo->evt_C = 0; |
9564 break; | 9553 break; |
9565 case 22: | 9554 case 22: |
9566 v7 = v2->evt_D; | 9555 v7 = pCurrentNPCInfo->evt_D; |
9567 if ( v7 >= 400 && v7 <= 416 ) | 9556 if ( v7 >= 400 && v7 <= 416 ) |
9568 v2->evt_D = 0; | 9557 pCurrentNPCInfo->evt_D = 0; |
9569 break; | 9558 break; |
9570 case 23: | 9559 case 23: |
9571 v6 = v2->evt_E; | 9560 v6 = pCurrentNPCInfo->evt_E; |
9572 if ( v6 >= 400 && v6 <= 416 ) | 9561 if ( v6 >= 400 && v6 <= 416 ) |
9573 v2->evt_E = 0; | 9562 pCurrentNPCInfo->evt_E = 0; |
9574 break; | 9563 break; |
9575 case 24: | 9564 case 24: |
9576 v5 = v2->evt_F; | 9565 v5 = pCurrentNPCInfo->evt_F; |
9577 if ( v5 >= 400 ) | 9566 if ( v5 >= 400 ) |
9578 { | 9567 { |
9579 if ( v5 <= 416 ) | 9568 if ( v5 <= 416 ) |
9580 v2->evt_F = 0; | 9569 pCurrentNPCInfo->evt_F = 0; |
9581 } | 9570 } |
9582 break; | 9571 break; |
9583 } | 9572 } |
9584 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | 9573 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
9585 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 9574 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
9609 LABEL_77: | 9598 LABEL_77: |
9610 ShowStatusBarString(v19, 2u); | 9599 ShowStatusBarString(v19, 2u); |
9611 goto _return; | 9600 goto _return; |
9612 } | 9601 } |
9613 //v20 = v2->uProfession; | 9602 //v20 = v2->uProfession; |
9614 if ( v2->uProfession != 51 ) | 9603 if ( pCurrentNPCInfo->uProfession != 51 ) |
9615 { | 9604 { |
9616 v21 = pNPCStats->pProfessions[v2->uProfession - 1].uHirePrice; | 9605 v21 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].uHirePrice; |
9617 if ( pParty->uNumGold < v21 ) | 9606 if ( pParty->uNumGold < v21 ) |
9618 { | 9607 { |
9619 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); | 9608 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); |
9620 dialogue_show_profession_details = false; | 9609 dialogue_show_profession_details = false; |
9621 uDialogueType = 13; | 9610 uDialogueType = 13; |
9622 ptr_F8B1E8 = pNPCStats->pProfessions[v2->uProfession - 1].pJoinText; | 9611 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; |
9623 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); | 9612 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); |
9624 if ( uActiveCharacter ) | 9613 if ( uActiveCharacter ) |
9625 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | 9614 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); |
9626 v19 = pGlobalTXT_LocalizationStrings[155]; | 9615 v19 = pGlobalTXT_LocalizationStrings[155]; |
9627 goto LABEL_77; | 9616 goto LABEL_77; |
9628 } | 9617 } |
9629 Party::TakeGold(v21); | 9618 Party::TakeGold(v21); |
9630 } | 9619 } |
9631 //LOBYTE(v2->uFlags) |= 0x80u; | 9620 //LOBYTE(v2->uFlags) |= 0x80u; |
9632 v2->uFlags = 128; | 9621 pCurrentNPCInfo->uFlags = 128; |
9633 pParty->field_709 = 0; | 9622 pParty->field_709 = 0; |
9634 sub_44A56A(); | 9623 sub_44A56A(); |
9635 if ( pParty->pHirelings[0].pName ) | 9624 if ( pParty->pHirelings[0].pName ) |
9636 { | 9625 { |
9637 memcpy(&pParty->pHirelings[1], v2, sizeof(pParty->pHirelings[1])); | 9626 memcpy(&pParty->pHirelings[1], pCurrentNPCInfo, sizeof(pParty->pHirelings[1])); |
9638 v24 = v2->pName; | 9627 v24 = pCurrentNPCInfo->pName; |
9639 v22 = pParty->pHireling2Name; | 9628 v22 = pParty->pHireling2Name; |
9640 } | 9629 } |
9641 else | 9630 else |
9642 { | 9631 { |
9643 memcpy(pParty->pHirelings, v2, 0x4Cu); | 9632 memcpy(pParty->pHirelings, pCurrentNPCInfo, 0x4Cu); |
9644 v24 = v2->pName; | 9633 v24 = pCurrentNPCInfo->pName; |
9645 v22 = pParty->pHireling1Name; | 9634 v22 = pParty->pHireling1Name; |
9646 } | 9635 } |
9647 strcpy(v22, v24); | 9636 strcpy(v22, v24); |
9648 pParty->field_709 = 0; | 9637 pParty->field_709 = 0; |
9649 sub_44A56A(); | 9638 sub_44A56A(); |
9999 } | 9988 } |
10000 | 9989 |
10001 | 9990 |
10002 | 9991 |
10003 //----- (004B29F2) -------------------------------------------------------- | 9992 //----- (004B29F2) -------------------------------------------------------- |
10004 const char *__fastcall sub_4B29F2(int a1) | 9993 const char *__fastcall ContractSelectText(int pEventNumber) |
10005 { | 9994 { |
10006 int v1; // esi@1 | |
10007 Player *v2; // edi@1 | |
10008 int v3; // eax@1 | |
10009 Player *v4; // ecx@1 | |
10010 | |
10011 v1 = a1; | |
10012 dword_F8B1A8 = 0; | 9995 dword_F8B1A8 = 0; |
10013 v2 = pPlayers[uActiveCharacter]; | 9996 dword_F8B1AC_something_todo_with_awards = pEventNumber + 50; |
10014 v3 = a1 + 50; | 9997 gold_transaction_amount = dword_4F08EC[pEventNumber]; |
10015 v4 = pPlayers[uActiveCharacter]; | 9998 if ( pPlayers[uActiveCharacter]->CanAct() ) |
10016 dword_F8B1AC_something_todo_with_awards = v3; | 9999 { |
10017 gold_transaction_amount = dword_4F08EC[v1]; | 10000 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->field_152, dword_F8B1AC_something_todo_with_awards) ) |
10018 if ( v4->CanAct() ) | |
10019 { | |
10020 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)v2->field_152, dword_F8B1AC_something_todo_with_awards) ) | |
10021 { | 10001 { |
10022 return pNPCTopics[123].pText; | 10002 return pNPCTopics[123].pText; |
10023 } | 10003 } |
10024 else | 10004 else |
10025 { | 10005 { |
10026 if ( gold_transaction_amount <= pParty->uNumGold ) | 10006 if ( gold_transaction_amount <= pParty->uNumGold ) |
10027 { | 10007 { |
10028 dword_F8B1A8 = 1; | 10008 dword_F8B1A8 = 1; |
10029 return pNPCTopics[v1 + 110].pText; | 10009 return pNPCTopics[pEventNumber + 110].pText; |
10030 } | 10010 } |
10031 else | 10011 else |
10032 { | 10012 { |
10033 return pNPCTopics[124].pText; | 10013 return pNPCTopics[124].pText; |
10034 } | 10014 } |
10102 int v56; // [sp+110h] [bp-Ch]@13 | 10082 int v56; // [sp+110h] [bp-Ch]@13 |
10103 char *pInString; // [sp+114h] [bp-8h]@12 | 10083 char *pInString; // [sp+114h] [bp-8h]@12 |
10104 NPCData *v58; // [sp+118h] [bp-4h]@6 | 10084 NPCData *v58; // [sp+118h] [bp-4h]@6 |
10105 | 10085 |
10106 memcpy(&a1, pDialogueWindow, sizeof(a1)); | 10086 memcpy(&a1, pDialogueWindow, sizeof(a1)); |
10107 if ( array_5913D8[6] == (NPCData *)uNumDialogueNPCPortraits && uHouse_ExitPic ) | 10087 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
10108 { | 10088 { |
10109 v0 = pMapStats->pInfos[uHouse_ExitPic].pName; | 10089 v0 = pMapStats->pInfos[uHouse_ExitPic].pName; |
10110 v1 = pMapStats->pInfos[uHouse_ExitPic].pName; | 10090 v1 = pMapStats->pInfos[uHouse_ExitPic].pName; |
10111 a1.uFrameX = 493; | 10091 a1.uFrameX = 493; |
10112 a1.uFrameWidth = 126; | 10092 a1.uFrameWidth = 126; |
10126 LOBYTE(i) = (unsigned int)a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u); | 10106 LOBYTE(i) = (unsigned int)a1.DrawTitleText(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u); |
10127 return i; | 10107 return i; |
10128 } | 10108 } |
10129 a1.uFrameWidth -= 10; | 10109 a1.uFrameWidth -= 10; |
10130 a1.uFrameZ -= 10; | 10110 a1.uFrameZ -= 10; |
10131 v58 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)]; | 10111 v58 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; |
10132 v6 = v58; | 10112 v6 = v58; |
10133 v55 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 10113 v55 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
10134 v7 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); | 10114 v7 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); |
10135 v8 = v6->uProfession; | 10115 v8 = v6->uProfession; |
10136 if ( v8 ) | 10116 if ( v8 ) |
10201 goto LABEL_49; | 10181 goto LABEL_49; |
10202 } | 10182 } |
10203 v27 = v26 - 3; | 10183 v27 = v26 - 3; |
10204 if ( !v27 ) | 10184 if ( !v27 ) |
10205 { | 10185 { |
10206 v33 = (char *)sub_4B29F2((int)v52.ptr_1C); | 10186 v33 = (char *)ContractSelectText((int)v52.ptr_1C); |
10207 goto LABEL_44; | 10187 goto LABEL_44; |
10208 } | 10188 } |
10209 v28 = v27 - 1; | 10189 v28 = v27 - 1; |
10210 if ( !v28 ) | 10190 if ( !v28 ) |
10211 { | 10191 { |
11058 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять | 11038 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять |
11059 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1); | 11039 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1); |
11060 } | 11040 } |
11061 | 11041 |
11062 //----- (004B3EF0) -------------------------------------------------------- | 11042 //----- (004B3EF0) -------------------------------------------------------- |
11063 void __fastcall sub_4B3EF0(int a4) | 11043 void __fastcall DrawJoinGuildWindow(int pEventNumber) |
11064 { | 11044 { |
11065 int v1; // edi@1 | 11045 //int v1; // edi@1 |
11066 | 11046 |
11067 v1 = a4; | 11047 //v1 = a4; |
11068 uDialogueType = 81; | 11048 uDialogueType = 81; |
11069 ptr_F8B1E8 = (char *)pNPCTopics[a4 + 99].pText; | 11049 ptr_F8B1E8 = (char *)pNPCTopics[pEventNumber + 99].pText; |
11070 sub_4B29F2(a4); | 11050 ContractSelectText(pEventNumber); |
11071 pDialogueWindow->Release(); | 11051 pDialogueWindow->Release(); |
11072 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, v1, 0); | 11052 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventNumber, 0); |
11073 pBtn_ExitCancel = pDialogueWindow->CreateButton( | 11053 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], |
11074 0x1D7, | 11054 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); |
11075 0x1BD, | |
11076 0xA9, | |
11077 0x23, | |
11078 1, | |
11079 0, | |
11080 0x71, | |
11081 0, | |
11082 0, | |
11083 pGlobalTXT_LocalizationStrings[34], | |
11084 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), | |
11085 0); | |
11086 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); | 11055 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); |
11087 pDialogueWindow->CreateButton( | 11056 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); |
11088 0x1E0u, | |
11089 0xA0u, | |
11090 0x8Cu, | |
11091 0x1Eu, | |
11092 1, | |
11093 0, | |
11094 0xAFu, | |
11095 0x52u, | |
11096 0, | |
11097 pGlobalTXT_LocalizationStrings[122], | |
11098 0); | |
11099 pDialogueWindow->_41D08F(1, 1, 0, 2); | 11057 pDialogueWindow->_41D08F(1, 1, 0, 2); |
11100 dword_F8B19C = -1; | 11058 dword_F8B19C = -1; |
11101 } | 11059 } |
11102 // F8B19C: using guessed type int dword_F8B19C; | 11060 // F8B19C: using guessed type int dword_F8B19C; |
11103 | 11061 |
11142 { | 11100 { |
11143 signed int v0; // ebx@1 | 11101 signed int v0; // ebx@1 |
11144 NPCData *v1; // edi@1 | 11102 NPCData *v1; // edi@1 |
11145 | 11103 |
11146 v0 = 0; | 11104 v0 = 0; |
11147 v1 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)]; | 11105 v1 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; |
11148 pDialogueWindow->Release(); | 11106 pDialogueWindow->Release(); |
11149 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); | 11107 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); |
11150 pBtn_ExitCancel = pDialogueWindow->CreateButton( | 11108 pBtn_ExitCancel = pDialogueWindow->CreateButton( |
11151 0x1D7u, | 11109 0x1D7u, |
11152 0x1BDu, | 11110 0x1BDu, |
11207 int v14; // eax@36 | 11165 int v14; // eax@36 |
11208 int v16; // eax@41 | 11166 int v16; // eax@41 |
11209 NPCData *v17; // [sp+10h] [bp-4h]@4 | 11167 NPCData *v17; // [sp+10h] [bp-4h]@4 |
11210 | 11168 |
11211 num_menu_buttons = 0; | 11169 num_menu_buttons = 0; |
11212 array_5913D8[6] = (NPCData *)(_this + 1); | 11170 pDialogueNPCCount = (_this + 1); |
11213 if ( _this + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) | 11171 if ( _this + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
11214 { | 11172 { |
11215 pDialogueWindow->Release(); | 11173 pDialogueWindow->Release(); |
11216 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); | 11174 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); |
11217 sprintf(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName); | 11175 sprintf(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName); |
11224 pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0, 0xBFu, 1u, 0x20u, sHouseName, 0); | 11182 pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0, 0xBFu, 1u, 0x20u, sHouseName, 0); |
11225 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); | 11183 pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); |
11226 } | 11184 } |
11227 else | 11185 else |
11228 { | 11186 { |
11229 v17 = array_5913D8[_this + 1 - ((dword_591080 != 0) + 1)]; | 11187 v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) + 1)]; |
11230 if ( dword_F8B19C == -1 ) | 11188 if ( dword_F8B19C == -1 ) |
11231 { | 11189 { |
11232 pDialogueWindow->Release(); | 11190 pDialogueWindow->Release(); |
11233 } | 11191 } |
11234 else | 11192 else |
11235 { | 11193 { |
11236 for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) | 11194 for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) |
11237 GUIButton::_41D0D8((GUIButton *)array_5913D8[i + 7]); | 11195 GUIButton::_41D0D8((GUIButton *)HouseNPCData[i + 7]); |
11238 } | 11196 } |
11239 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); | 11197 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); |
11240 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, 0x71u, 0, 0, | 11198 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, 0x71u, 0, 0, |
11241 pGlobalTXT_LocalizationStrings[74],// "End Conversation" | 11199 pGlobalTXT_LocalizationStrings[74],// "End Conversation" |
11242 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); | 11200 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); |
11243 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0); | 11201 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0); |
11244 if ( array_5913D8[6] == (NPCData *)1 && dword_591080 ) | 11202 if ( pDialogueNPCCount == 1 && dword_591080 ) |
11245 { | 11203 { |
11246 sub_4B3B42(dword_F8B198); | 11204 sub_4B3B42(dword_F8B198); |
11247 } | 11205 } |
11248 else | 11206 else |
11249 { | 11207 { |
12417 void OnSelectDialogueOption(DIALOGUE_TYPE newDialogueType) | 12375 void OnSelectDialogueOption(DIALOGUE_TYPE newDialogueType) |
12418 { | 12376 { |
12419 //unsigned int v1; // esi@1 | 12377 //unsigned int v1; // esi@1 |
12420 NPCData *v2; // ebp@1 | 12378 NPCData *v2; // ebp@1 |
12421 //unsigned int v3; // eax@1 | 12379 //unsigned int v3; // eax@1 |
12422 int v4; // ecx@10 | 12380 int pEventNumber; // ecx@10 |
12423 signed int v5; // edi@14 | 12381 signed int v5; // edi@14 |
12424 char *v6; // esi@15 | 12382 char *v6; // esi@15 |
12425 const char *v7; // ecx@22 | 12383 const char *v7; // ecx@22 |
12426 signed int v8; // edi@37 | 12384 signed int v8; // edi@37 |
12427 //unsigned int v9; // eax@56 | 12385 //unsigned int v9; // eax@56 |
12443 } | 12401 } |
12444 if ( (signed int)newDialogueType > 22 ) | 12402 if ( (signed int)newDialogueType > 22 ) |
12445 { | 12403 { |
12446 if ( newDialogueType == DIALOGUE_23 ) | 12404 if ( newDialogueType == DIALOGUE_23 ) |
12447 { | 12405 { |
12448 v4 = v2->evt_E; | 12406 pEventNumber = v2->evt_E; |
12449 goto LABEL_74; | 12407 goto LABEL_74; |
12450 } | 12408 } |
12451 if (newDialogueType == DIALOGUE_24) | 12409 if (newDialogueType == DIALOGUE_24) |
12452 { | 12410 { |
12453 v4 = v2->evt_F; | 12411 pEventNumber = v2->evt_F; |
12454 goto LABEL_74; | 12412 goto LABEL_74; |
12455 } | 12413 } |
12456 if (newDialogueType != DIALOGUE_76) | 12414 if (newDialogueType != DIALOGUE_76) |
12457 { | 12415 { |
12458 if (newDialogueType == DIALOGUE_PROFESSION_DETAILS) | 12416 if (newDialogueType == DIALOGUE_PROFESSION_DETAILS) |
12570 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0); | 12528 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0); |
12571 goto LABEL_87; | 12529 goto LABEL_87; |
12572 } | 12530 } |
12573 if (newDialogueType == DIALOGUE_22) | 12531 if (newDialogueType == DIALOGUE_22) |
12574 { | 12532 { |
12575 v4 = v2->evt_D; | 12533 pEventNumber = v2->evt_D; |
12576 goto LABEL_74; | 12534 goto LABEL_74; |
12577 } | 12535 } |
12578 if (newDialogueType == DIALOGUE_9) | 12536 if (newDialogueType == DIALOGUE_9) |
12579 { | 12537 { |
12580 if ( !sub_4BB756(v2->uProfession) ) | 12538 if ( !sub_4BB756(v2->uProfession) ) |
12619 } | 12577 } |
12620 goto LABEL_44; | 12578 goto LABEL_44; |
12621 } | 12579 } |
12622 if (newDialogueType == DIALOGUE_19) | 12580 if (newDialogueType == DIALOGUE_19) |
12623 { | 12581 { |
12624 v4 = v2->evt_A; | 12582 pEventNumber = v2->evt_A; |
12625 goto LABEL_74; | 12583 goto LABEL_74; |
12626 } | 12584 } |
12627 if (newDialogueType == DIALOGUE_20) | 12585 if (newDialogueType == DIALOGUE_20) |
12628 { | 12586 { |
12629 v4 = v2->evt_B; | 12587 pEventNumber = v2->evt_B; |
12630 goto LABEL_74; | 12588 goto LABEL_74; |
12631 } | 12589 } |
12632 if (newDialogueType == DIALOGUE_21) | 12590 if (newDialogueType == DIALOGUE_21) |
12633 { | 12591 { |
12634 v4 = v2->evt_C; | 12592 pEventNumber = v2->evt_C; |
12635 LABEL_74: | 12593 LABEL_74: |
12636 if ( v4 < 200 || v4 > 310 ) | 12594 if ( pEventNumber < 200 || pEventNumber > 310 ) |
12637 { | 12595 { |
12638 if ( v4 < 400 || v4 > 410 ) | 12596 if ( pEventNumber < 400 || pEventNumber > 410 ) |
12639 { | 12597 { |
12640 switch ( v4 ) | 12598 switch ( pEventNumber ) |
12641 { | 12599 { |
12642 case 139: | 12600 case 139: |
12643 sub_4B1ECE(); | 12601 sub_4B1ECE(); |
12644 break; | 12602 break; |
12645 case 311: | 12603 case 311: |
12649 sub_4BBCDD(); | 12607 sub_4BBCDD(); |
12650 break; | 12608 break; |
12651 default: | 12609 default: |
12652 _5C3420_pDecoration = (LevelDecoration *)1; | 12610 _5C3420_pDecoration = (LevelDecoration *)1; |
12653 ptr_F8B1E8 = 0; | 12611 ptr_F8B1E8 = 0; |
12654 EventProcessor(v4, 0, 1); | 12612 EventProcessor(pEventNumber, 0, 1); |
12655 _5C3420_pDecoration = 0; | 12613 _5C3420_pDecoration = 0; |
12656 break; | 12614 break; |
12657 } | 12615 } |
12658 } | 12616 } |
12659 else | 12617 else |
12660 { | 12618 { |
12661 dword_F8B1D8 = newDialogueType; | 12619 dword_F8B1D8 = newDialogueType; |
12662 sub_4B3EF0(v4 - 400); | 12620 DrawJoinGuildWindow(pEventNumber - 400); |
12663 } | 12621 } |
12664 } | 12622 } |
12665 else | 12623 else |
12666 { | 12624 { |
12667 sub_4B3FE5(v4); | 12625 sub_4B3FE5(pEventNumber); |
12668 } | 12626 } |
12669 } | 12627 } |
12670 LABEL_87: | 12628 LABEL_87: |
12671 if ( !dword_7241C8 ) | 12629 if ( !dword_7241C8 ) |
12672 pGame->Draw(); | 12630 pGame->Draw(); |
14825 { | 14783 { |
14826 if (~npc->uFlags & 0x80) | 14784 if (~npc->uFlags & 0x80) |
14827 //if ( !(*(char *)v6 & 0x80) ) | 14785 //if ( !(*(char *)v6 & 0x80) ) |
14828 { | 14786 { |
14829 v7 = uNumDialogueNPCPortraits++ - dword_591080 ? 1 : 0; | 14787 v7 = uNumDialogueNPCPortraits++ - dword_591080 ? 1 : 0; |
14830 array_5913D8[v7] = npc; | 14788 HouseNPCData[v7] = npc; |
14831 //v6 = v17; | 14789 //v6 = v17; |
14832 //*(&v13 + v2) = *(v17 - 1); | 14790 //*(&v13 + v2) = *(v17 - 1); |
14833 Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID; | 14791 Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID; |
14834 //v1 = v18; | 14792 //v1 = v18; |
14835 if ((npc->uFlags & 3) != 2) | 14793 if ((npc->uFlags & 3) != 2) |
15039 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break; | 14997 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break; |
15040 default: assert(false); | 14998 default: assert(false); |
15041 } | 14999 } |
15042 | 15000 |
15043 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | 15001 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); |
15044 array_5913D8[6] = 0; | 15002 pDialogueNPCCount = 0; |
15045 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17]; | 15003 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17]; |
15046 uTextureID_507B04 = uTextureID_right_panel; | 15004 uTextureID_507B04 = uTextureID_right_panel; |
15047 PrepareHouse(uHouseID); | 15005 PrepareHouse(uHouseID); |
15048 v18 = 1; | 15006 v18 = 1; |
15049 uTextureID_507B04 = uTextureID_right_panel; | 15007 uTextureID_507B04 = uTextureID_right_panel; |
15050 if ( uNumDialogueNPCPortraits == 1 ) | 15008 if ( uNumDialogueNPCPortraits == 1 ) |
15051 array_5913D8[6] = (NPCData *)1; | 15009 pDialogueNPCCount = 1; |
15052 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); | 15010 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); |
15053 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 ) | 15011 if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 ) |
15054 { | 15012 { |
15055 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) ) | 15013 if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) ) |
15056 goto LABEL_49; | 15014 goto LABEL_49; |