Mercurial > mm7
comparison mm7_4.cpp @ 827:085eb19b7ffd
mr.Malvik
author | Ritor1 |
---|---|
date | Wed, 27 Mar 2013 01:39:54 +0600 |
parents | c1da83d8223f |
children | 08d90b633131 |
comparison
equal
deleted
inserted
replaced
826:1133e34a7560 | 827:085eb19b7ffd |
---|---|
6470 Player *v12; // [sp+14h] [bp-4h]@11 | 6470 Player *v12; // [sp+14h] [bp-4h]@11 |
6471 | 6471 |
6472 contract_approved = 0; | 6472 contract_approved = 0; |
6473 v11 = 0; | 6473 v11 = 0; |
6474 uDialogueType = 84; | 6474 uDialogueType = 84; |
6475 ptr_F8B1E8 = (char *)pNPCTopics[667].pText; | 6475 current_npc_text = (char *)pNPCTopics[667].pText; |
6476 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals; | 6476 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals; |
6477 while ( 1 ) | 6477 while ( 1 ) |
6478 { | 6478 { |
6479 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0) ) | 6479 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0) ) |
6480 { | 6480 { |
6497 if ( v0 > &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) | 6497 if ( v0 > &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) |
6498 break; | 6498 break; |
6499 } | 6499 } |
6500 if ( v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) | 6500 if ( v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) |
6501 { | 6501 { |
6502 ptr_F8B1E8 = (char *)pNPCTopics[666].pText; // Here's %s that you lost. Be careful | 6502 current_npc_text = (char *)pNPCTopics[666].pText; // Here's %s that you lost. Be careful |
6503 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; | 6503 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; |
6504 contract_approved = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; | 6504 contract_approved = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; |
6505 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4); | 6505 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4); |
6506 } | 6506 } |
6507 if ( contract_approved == 601 ) | 6507 if ( contract_approved == 601 ) |
6585 if ( uMessageParam <= 24 ) | 6585 if ( uMessageParam <= 24 ) |
6586 { | 6586 { |
6587 switch ( uMessageParam ) | 6587 switch ( uMessageParam ) |
6588 { | 6588 { |
6589 case 13: | 6589 case 13: |
6590 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); | 6590 current_npc_text = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); |
6591 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); | 6591 current_npc_text = BuilDialogueString((char *)current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); |
6592 NPCHireableDialogPrepare(); | 6592 NPCHireableDialogPrepare(); |
6593 dialogue_show_profession_details = false; | 6593 dialogue_show_profession_details = false; |
6594 goto _return; | 6594 goto _return; |
6595 case 19: | 6595 case 19: |
6596 pEventNumber = pCurrentNPCInfo->evt_A; | 6596 pEventNumber = pCurrentNPCInfo->evt_A; |
6636 { | 6636 { |
6637 sub_4BBA85_bounties(); | 6637 sub_4BBA85_bounties(); |
6638 } | 6638 } |
6639 else | 6639 else |
6640 { | 6640 { |
6641 ptr_F8B1E8 = 0; | 6641 current_npc_text = 0; |
6642 activeLevelDecoration = (LevelDecoration*)1; | 6642 activeLevelDecoration = (LevelDecoration*)1; |
6643 EventProcessor(pEventNumber, 0, 1); | 6643 EventProcessor(pEventNumber, 0, 1); |
6644 activeLevelDecoration = NULL; | 6644 activeLevelDecoration = NULL; |
6645 } | 6645 } |
6646 } | 6646 } |
6664 //v16 = pCurrentNPCInfo->uProfession; | 6664 //v16 = pCurrentNPCInfo->uProfession; |
6665 if (dialogue_show_profession_details) | 6665 if (dialogue_show_profession_details) |
6666 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; | 6666 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; |
6667 else | 6667 else |
6668 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pBenefits; | 6668 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pBenefits; |
6669 ptr_F8B1E8 = v17; | 6669 current_npc_text = v17; |
6670 v18 = BuilDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0); | 6670 v18 = BuilDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0); |
6671 dialogue_show_profession_details = ~dialogue_show_profession_details; | 6671 dialogue_show_profession_details = ~dialogue_show_profession_details; |
6672 ptr_F8B1E8 = v18; | 6672 current_npc_text = v18; |
6673 } | 6673 } |
6674 else | 6674 else |
6675 { | 6675 { |
6676 if ( uMessageParam == 79 ) | 6676 if ( uMessageParam == 79 ) |
6677 { | 6677 { |
6784 if ( pParty->uNumGold < pPrice ) | 6784 if ( pParty->uNumGold < pPrice ) |
6785 { | 6785 { |
6786 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); | 6786 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); |
6787 dialogue_show_profession_details = false; | 6787 dialogue_show_profession_details = false; |
6788 uDialogueType = 13; | 6788 uDialogueType = 13; |
6789 ptr_F8B1E8 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; | 6789 current_npc_text = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; |
6790 ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); | 6790 current_npc_text = BuilDialogueString((char *)current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); |
6791 if ( uActiveCharacter ) | 6791 if ( uActiveCharacter ) |
6792 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | 6792 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); |
6793 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); | 6793 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); |
6794 goto _return; | 6794 goto _return; |
6795 } | 6795 } |
7363 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 7363 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
7364 v31 = *(int *)v29; | 7364 v31 = *(int *)v29; |
7365 v32 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 7365 v32 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
7366 sprintf(pTmpBuf, &byte_4F0F98, v32, v31, v30); | 7366 sprintf(pTmpBuf, &byte_4F0F98, v32, v31, v30); |
7367 sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * (unsigned __int8)v29[8]); | 7367 sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * (unsigned __int8)v29[8]); |
7368 ptr_F8B1E8 = pTmpBuf2; | 7368 current_npc_text = pTmpBuf2; |
7369 v15 = ""; | 7369 v15 = ""; |
7370 goto LABEL_45; | 7370 goto LABEL_45; |
7371 } | 7371 } |
7372 if ( v28 != 10 ) | 7372 if ( v28 != 10 ) |
7373 goto LABEL_41; | 7373 goto LABEL_41; |
7405 v15 = ""; | 7405 v15 = ""; |
7406 } | 7406 } |
7407 if ( uDialogueType != 84 ) | 7407 if ( uDialogueType != 84 ) |
7408 goto LABEL_49; | 7408 goto LABEL_49; |
7409 sprintf(pTmpBuf, format_4E2D80, v55, pItemsTable->pItems[contract_approved].pUnidentifiedName); | 7409 sprintf(pTmpBuf, format_4E2D80, v55, pItemsTable->pItems[contract_approved].pUnidentifiedName); |
7410 sprintf(pTmpBuf2, ptr_F8B1E8, pTmpBuf); | 7410 sprintf(pTmpBuf2, current_npc_text, pTmpBuf); |
7411 ptr_F8B1E8 = pTmpBuf2; | 7411 current_npc_text = pTmpBuf2; |
7412 goto LABEL_45; | 7412 goto LABEL_45; |
7413 } | 7413 } |
7414 v21 = v20 - 1; | 7414 v21 = v20 - 1; |
7415 if ( !v21 ) | 7415 if ( !v21 ) |
7416 { | 7416 { |
7493 break; | 7493 break; |
7494 i = v56; | 7494 i = v56; |
7495 } | 7495 } |
7496 } | 7496 } |
7497 } | 7497 } |
7498 if ( ptr_F8B1E8 ) | 7498 if ( current_npc_text ) |
7499 { | 7499 { |
7500 w.uFrameWidth = 458; | 7500 w.uFrameWidth = 458; |
7501 w.uFrameZ = 457; | 7501 w.uFrameZ = 457; |
7502 v47 = pFontArrus; | 7502 v47 = pFontArrus; |
7503 v48 = pFontArrus->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7; | 7503 v48 = pFontArrus->CalcTextHeight(current_npc_text, &w, 13, 0) + 7; |
7504 if ( 352 - v48 < 8 ) | 7504 if ( 352 - v48 < 8 ) |
7505 { | 7505 { |
7506 v47 = pFontCreate; | 7506 v47 = pFontCreate; |
7507 v48 = pFontCreate->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7; | 7507 v48 = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7; |
7508 } | 7508 } |
7509 pRenderer->_4A6A68( | 7509 pRenderer->_4A6A68( |
7510 8u, | 7510 8u, |
7511 352 - v48, | 7511 352 - v48, |
7512 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | 7512 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), |
7513 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v48); | 7513 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v48); |
7514 pRenderer->DrawTextureIndexed(8u, 347 - v48, pTexture_591428); | 7514 pRenderer->DrawTextureIndexed(8u, 347 - v48, pTexture_591428); |
7515 v49 = FitTextInAWindow(ptr_F8B1E8, v47, &w, 0xDu, 0); | 7515 v49 = FitTextInAWindow(current_npc_text, v47, &w, 0xDu, 0); |
7516 a1.DrawText(v47, 13, 354 - v48, 0, v49, 0, 0, 0); | 7516 a1.DrawText(v47, 13, 354 - v48, 0, v49, 0, 0, 0); |
7517 } | 7517 } |
7518 } | 7518 } |
7519 | 7519 |
7520 //----- (004B36CC) -------------------------------------------------------- | 7520 //----- (004B36CC) -------------------------------------------------------- |
7790 | 7790 |
7791 //----- (004B3EF0) -------------------------------------------------------- | 7791 //----- (004B3EF0) -------------------------------------------------------- |
7792 void DrawJoinGuildWindow( int pEventCode ) | 7792 void DrawJoinGuildWindow( int pEventCode ) |
7793 { | 7793 { |
7794 uDialogueType = 81;//enum JoinGuildDialog | 7794 uDialogueType = 81;//enum JoinGuildDialog |
7795 ptr_F8B1E8 = (char *)pNPCTopics[pEventCode + 99].pText; | 7795 current_npc_text = (char *)pNPCTopics[pEventCode + 99].pText; |
7796 ContractSelectText(pEventCode); | 7796 ContractSelectText(pEventCode); |
7797 pDialogueWindow->Release(); | 7797 pDialogueWindow->Release(); |
7798 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventCode, 0); | 7798 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventCode, 0); |
7799 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], | 7799 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], |
7800 (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); | 7800 (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); |
7811 int v1; // edi@1 | 7811 int v1; // edi@1 |
7812 char *v2; // edi@1 | 7812 char *v2; // edi@1 |
7813 | 7813 |
7814 v1 = a4; | 7814 v1 = a4; |
7815 uDialogueType = 78; | 7815 uDialogueType = 78; |
7816 ptr_F8B1E8 = (char *)pNPCTopics[a4 + 168].pText; | 7816 current_npc_text = (char *)pNPCTopics[a4 + 168].pText; |
7817 _4B254D_SkillMasteryTeacher(a4); | 7817 _4B254D_SkillMasteryTeacher(a4); |
7818 pDialogueWindow->Release(); | 7818 pDialogueWindow->Release(); |
7819 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, v1, 0); | 7819 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, v1, 0); |
7820 v2 = ""; | 7820 v2 = ""; |
7821 pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, | 7821 pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, |
8212 case 399: | 8212 case 399: |
8213 sub_4BBCDD(); | 8213 sub_4BBCDD(); |
8214 break; | 8214 break; |
8215 default: | 8215 default: |
8216 activeLevelDecoration = (LevelDecoration*)1; | 8216 activeLevelDecoration = (LevelDecoration*)1; |
8217 ptr_F8B1E8 = 0; | 8217 current_npc_text = 0; |
8218 EventProcessor(npc_event_id, 0, 1); | 8218 EventProcessor(npc_event_id, 0, 1); |
8219 activeLevelDecoration = NULL; | 8219 activeLevelDecoration = NULL; |
8220 break; | 8220 break; |
8221 } | 8221 } |
8222 } | 8222 } |