comparison mm7_4.cpp @ 2115:90cc547a7927

Fixing hireling prices
author Grumpy7
date Mon, 23 Dec 2013 15:17:50 +0100
parents 2318216e5206
children 18dee3152c52
comparison
equal deleted inserted replaced
2109:4fae5a167a05 2115:90cc547a7927
1537 dst = strlen(pTmpBuf2.data()); 1537 dst = strlen(pTmpBuf2.data());
1538 i += 2; 1538 i += 2;
1539 break; 1539 break;
1540 case 17://текст наёмного НПС 1540 case 17://текст наёмного НПС
1541 { 1541 {
1542 uint pay_percentage = pNPCStats->pProfessions[npc->uProfession - 1].uHirePrice / 100; 1542 uint pay_percentage = pNPCStats->pProfessions[npc->uProfession].uHirePrice / 100;
1543 if ( !pay_percentage ) 1543 if ( !pay_percentage )
1544 pay_percentage = 1; 1544 pay_percentage = 1;
1545 sprintf(a1, "%lu", pay_percentage); 1545 sprintf(a1, "%lu", pay_percentage);
1546 strcat(pTmpBuf2.data(), a1); 1546 strcat(pTmpBuf2.data(), a1);
1547 dst = strlen(pTmpBuf2.data()); 1547 dst = strlen(pTmpBuf2.data());
2779 } 2779 }
2780 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName ) 2780 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName )
2781 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full"" 2781 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full""
2782 else 2782 else
2783 { 2783 {
2784 if ( speakingNPC->uProfession != 51 ) 2784 if ( speakingNPC->uProfession != 51 ) //burglars have no hiring price
2785 { 2785 {
2786 if ( pParty->uNumGold < pNPCStats->pProfessions[speakingNPC->uProfession - 1].uHirePrice ) 2786 if ( pParty->uNumGold < pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice )
2787 { 2787 {
2788 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" 2788 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
2789 dialogue_show_profession_details = false; 2789 dialogue_show_profession_details = false;
2790 uDialogueType = 13; 2790 uDialogueType = 13;
2791 if ( uActiveCharacter ) 2791 if ( uActiveCharacter )
2793 if ( !dword_7241C8 ) 2793 if ( !dword_7241C8 )
2794 pGame->Draw(); 2794 pGame->Draw();
2795 dword_7241C8 = 0; 2795 dword_7241C8 = 0;
2796 return; 2796 return;
2797 } 2797 }
2798 Party::TakeGold(pNPCStats->pProfessions[speakingNPC->uProfession - 1].uHirePrice); 2798 Party::TakeGold(pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice);
2799 } 2799 }
2800 LOBYTE(speakingNPC->uFlags) |= 0x80u; 2800 LOBYTE(speakingNPC->uFlags) |= 0x80u;
2801 if ( pParty->pHirelings[0].pName ) 2801 if ( pParty->pHirelings[0].pName )
2802 { 2802 {
2803 memcpy(&pParty->pHirelings[1], speakingNPC, sizeof(pParty->pHirelings[1])); 2803 memcpy(&pParty->pHirelings[1], speakingNPC, sizeof(pParty->pHirelings[1]));