comparison mm7_4.cpp @ 467:5d2667144526

m
author Ritor1
date Mon, 25 Feb 2013 11:09:55 +0600
parents 62ca9e2e1432
children 8822405efad2
comparison
equal deleted inserted replaced
466:91e1ba340f39 467:5d2667144526
9380 { 9380 {
9381 //signed int v1; // eax@1 9381 //signed int v1; // eax@1
9382 NPCData *pCurrentNPCInfo; // ebp@1 9382 NPCData *pCurrentNPCInfo; // ebp@1
9383 int pEventNumber; // 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
9389 int v9; // eax@40 9389 //int v9; // eax@40
9390 unsigned int v10; // eax@43 9390 //unsigned int v10; // eax@43
9391 unsigned int v11; // eax@48
9392 char *v12; // eax@53 9391 char *v12; // eax@53
9393 char *v13; // eax@56 9392 char *v13; // eax@56
9394 char *v14; // eax@57 9393 char *v14; // eax@57
9395 char *v15; // eax@58 9394 char *v15; // eax@58
9396 unsigned int v16; // ebp@62 9395 //unsigned int v16; // ebp@62
9397 char *v17; // ecx@63 9396 char *v17; // ecx@63
9398 char *v18; // eax@65 9397 char *v18; // eax@65
9399 const char *v19; // ecx@68 9398 const char *v19; // ecx@68
9400 //unsigned int v20; // eax@69 9399 //unsigned int v20; // eax@69
9401 unsigned int v21; // ecx@70 9400 signed int pPrice; // ecx@70
9402 char *v22; // [sp-Ch] [bp-18h]@73 9401 char *v22; // [sp-Ch] [bp-18h]@73
9403 int v23; // [sp-8h] [bp-14h]@49 9402 //int v23; // [sp-8h] [bp-14h]@49
9404 char *v24; // [sp-8h] [bp-14h]@73 9403 char *v24; // [sp-8h] [bp-14h]@73
9405 int v25; // [sp-4h] [bp-10h]@49 9404 //int v25; // [sp-4h] [bp-10h]@49
9406 9405
9407 //v1 = a1;
9408 uDialogueType = uMessageParam + 1; 9406 uDialogueType = uMessageParam + 1;
9409 pCurrentNPCInfo = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; 9407 pCurrentNPCInfo = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)];
9410 if ( uMessageParam <= 23 ) 9408 if ( uMessageParam <= 24 )
9411 { 9409 {
9412 switch ( uMessageParam ) 9410 switch ( uMessageParam )
9413 { 9411 {
9414 case 13: 9412 case 13:
9415 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); 9413 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession);
9434 break; 9432 break;
9435 case 24: 9433 case 24:
9436 pEventNumber = pCurrentNPCInfo->evt_F; 9434 pEventNumber = pCurrentNPCInfo->evt_F;
9437 break; 9435 break;
9438 default: 9436 default:
9439 goto _return; 9437 goto _return;
9440 } 9438 }
9439 /*switch ( pEventNumber )
9440 {
9441 case 139:
9442 sub_4B1ECE();
9443 goto _return;
9444 case 311:
9445 sub_4BBA85_bounties();
9446 goto _return;
9447 }*/
9441 if ( pEventNumber < 200 || pEventNumber > 310 ) 9448 if ( pEventNumber < 200 || pEventNumber > 310 )
9442 { 9449 {
9443 if ( pEventNumber < 400 || pEventNumber > 410 ) 9450 if ( pEventNumber < 400 || pEventNumber > 410 )
9444 { 9451 {
9445 if ( pEventNumber == 139 ) 9452 if ( pEventNumber == 139 )
9475 } 9482 }
9476 if ( uMessageParam != 76 ) 9483 if ( uMessageParam != 76 )
9477 { 9484 {
9478 if ( uMessageParam == 77 ) 9485 if ( uMessageParam == 77 )
9479 { 9486 {
9480 v16 = pCurrentNPCInfo->uProfession; 9487 //v16 = pCurrentNPCInfo->uProfession;
9481 if (dialogue_show_profession_details) 9488 if (dialogue_show_profession_details)
9482 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; 9489 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText;
9483 else 9490 else
9484 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pBenefits; 9491 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pBenefits;
9485 ptr_F8B1E8 = v17; 9492 ptr_F8B1E8 = v17;
9538 } 9545 }
9539 while ( (signed int)v4 < (signed int)pParty->pHirelings ); 9546 while ( (signed int)v4 < (signed int)pParty->pHirelings );
9540 switch ( dword_F8B1D8 ) 9547 switch ( dword_F8B1D8 )
9541 { 9548 {
9542 case 19: 9549 case 19:
9543 v10 = pCurrentNPCInfo->evt_A; 9550 pEventNumber = pCurrentNPCInfo->evt_A;
9544 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 ) 9551 if ( pEventNumber >= 400 && pEventNumber <= 416 )
9545 pCurrentNPCInfo->evt_A = 0; 9552 pCurrentNPCInfo->evt_A = 0;
9546 break; 9553 break;
9547 case 20: 9554 case 20:
9548 v9 = pCurrentNPCInfo->evt_B; 9555 pEventNumber = pCurrentNPCInfo->evt_B;
9549 if ( v9 >= 400 && v9 <= 416 ) 9556 if ( pEventNumber >= 400 && pEventNumber <= 416 )
9550 pCurrentNPCInfo->evt_B = 0; 9557 pCurrentNPCInfo->evt_B = 0;
9551 break; 9558 break;
9552 case 21: 9559 case 21:
9553 v8 = pCurrentNPCInfo->evt_C; 9560 pEventNumber = pCurrentNPCInfo->evt_C;
9554 if ( v8 >= 400 && v8 <= 416 ) 9561 if ( pEventNumber >= 400 && pEventNumber <= 416 )
9555 pCurrentNPCInfo->evt_C = 0; 9562 pCurrentNPCInfo->evt_C = 0;
9556 break; 9563 break;
9557 case 22: 9564 case 22:
9558 v7 = pCurrentNPCInfo->evt_D; 9565 pEventNumber = pCurrentNPCInfo->evt_D;
9559 if ( v7 >= 400 && v7 <= 416 ) 9566 if ( pEventNumber >= 400 && pEventNumber <= 416 )
9560 pCurrentNPCInfo->evt_D = 0; 9567 pCurrentNPCInfo->evt_D = 0;
9561 break; 9568 break;
9562 case 23: 9569 case 23:
9563 v6 = pCurrentNPCInfo->evt_E; 9570 pEventNumber = pCurrentNPCInfo->evt_E;
9564 if ( v6 >= 400 && v6 <= 416 ) 9571 if ( pEventNumber >= 400 && pEventNumber <= 416 )
9565 pCurrentNPCInfo->evt_E = 0; 9572 pCurrentNPCInfo->evt_E = 0;
9566 break; 9573 break;
9567 case 24: 9574 case 24:
9568 v5 = pCurrentNPCInfo->evt_F; 9575 pEventNumber = pCurrentNPCInfo->evt_F;
9569 if ( v5 >= 400 ) 9576 if ( pEventNumber >= 400 && pEventNumber <= 416)
9570 { 9577 pCurrentNPCInfo->evt_F = 0;
9571 if ( v5 <= 416 )
9572 pCurrentNPCInfo->evt_F = 0;
9573 }
9574 break; 9578 break;
9575 } 9579 }
9576 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); 9580 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
9577 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 9581 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
9578 { 9582 {
9579 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 9583 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
9580 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; 9584 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
9581 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 9585 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
9582 ++pMessageQueue_50CBD0->uNumMessages; 9586 ++pMessageQueue_50CBD0->uNumMessages;
9583 }*/ 9587 }*/
9584 v11 = uActiveCharacter; 9588 //v11 = uActiveCharacter;
9585 if ( uActiveCharacter ) 9589 if ( uActiveCharacter )
9586 { 9590 {
9587 v25 = 0; 9591 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_86, 0);
9588 v23 = SPEECH_86;
9589 LABEL_50:
9590 pPlayers[v11]->PlaySound((PlayerSpeech)v23, v25);
9591 goto _return; 9592 goto _return;
9592 } 9593 }
9593 } 9594 }
9594 } 9595 }
9595 } 9596 }
9596 goto _return; 9597 goto _return;
9597 } 9598 }
9598 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName ) 9599 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName )
9599 { 9600 {
9600 v19 = pGlobalTXT_LocalizationStrings[533]; // ""I cannot join you, you're party is full"" 9601 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full""
9601 LABEL_77:
9602 ShowStatusBarString(v19, 2u);
9603 goto _return; 9602 goto _return;
9604 } 9603 }
9605 //v20 = v2->uProfession;
9606 if ( pCurrentNPCInfo->uProfession != 51 ) 9604 if ( pCurrentNPCInfo->uProfession != 51 )
9607 { 9605 {
9608 v21 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].uHirePrice; 9606 pPrice = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].uHirePrice;
9609 if ( pParty->uNumGold < v21 ) 9607 if ( pParty->uNumGold < pPrice )
9610 { 9608 {
9611 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); 9609 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
9612 dialogue_show_profession_details = false; 9610 dialogue_show_profession_details = false;
9613 uDialogueType = 13; 9611 uDialogueType = 13;
9614 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; 9612 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText;
9615 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);
9616 if ( uActiveCharacter ) 9614 if ( uActiveCharacter )
9617 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); 9615 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0);
9618 v19 = pGlobalTXT_LocalizationStrings[155]; 9616 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
9619 goto LABEL_77; 9617 goto _return;
9620 } 9618 }
9621 Party::TakeGold(v21); 9619 Party::TakeGold(pPrice);
9622 } 9620 }
9623 //LOBYTE(v2->uFlags) |= 0x80u; 9621 //LOBYTE(v2->uFlags) |= 0x80u;
9624 pCurrentNPCInfo->uFlags = 128; 9622 pCurrentNPCInfo->uFlags = 128;
9625 pParty->field_709 = 0; 9623 pParty->field_709 = 0;
9626 sub_44A56A(); 9624 sub_44A56A();
9648 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 9646 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
9649 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; 9647 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
9650 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 9648 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
9651 ++pMessageQueue_50CBD0->uNumMessages; 9649 ++pMessageQueue_50CBD0->uNumMessages;
9652 }*/ 9650 }*/
9653 v11 = uActiveCharacter;
9654 if ( uActiveCharacter ) 9651 if ( uActiveCharacter )
9655 { 9652 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)61, 0);
9656 v25 = 0;
9657 v23 = 61;
9658 goto LABEL_50;
9659 }
9660 _return: 9653 _return:
9661 pVideoPlayer->_4BF5B2();//HouseVideo 9654 pVideoPlayer->_4BF5B2();//HouseVideo
9662 } 9655 }
9663 9656
9664 9657
11043 } 11036 }
11044 11037
11045 //----- (004B3EF0) -------------------------------------------------------- 11038 //----- (004B3EF0) --------------------------------------------------------
11046 void __fastcall DrawJoinGuildWindow(int pEventNumber) 11039 void __fastcall DrawJoinGuildWindow(int pEventNumber)
11047 { 11040 {
11048 uDialogueType = 81; 11041 uDialogueType = 81;//enum JoinGuildDialog
11049 ptr_F8B1E8 = (char *)pNPCTopics[pEventNumber + 99].pText; 11042 ptr_F8B1E8 = (char *)pNPCTopics[pEventNumber + 99].pText;
11050 ContractSelectText(pEventNumber); 11043 ContractSelectText(pEventNumber);
11051 pDialogueWindow->Release(); 11044 pDialogueWindow->Release();
11052 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventNumber, 0); 11045 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventNumber, 0);
11053 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], 11046 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34],