comparison mm7_4.cpp @ 492:0e27362ac1d9

guild
author Gloval
date Thu, 28 Feb 2013 01:38:46 +0400
parents d5da524ec901
children 59649750a054
comparison
equal deleted inserted replaced
487:d5da524ec901 492:0e27362ac1d9
5009 if ( dword_A74CDC == -1 ) 5009 if ( dword_A74CDC == -1 )
5010 { 5010 {
5011 v24 = v23; 5011 v24 = v23;
5012 dword_A74CDC = v23; 5012 dword_A74CDC = v23;
5013 } 5013 }
5014 v11 = (char *)pAwards[v55[v24]-1].pText;//(char *)dword_723E80_award_related[2 * v55[v24]]; 5014 v11 = (char *)pAwards[v55[v24]].pText;//(char *)dword_723E80_award_related[2 * v55[v24]];
5015 } 5015 }
5016 else 5016 else
5017 { 5017 {
5018 v11 = (char *)pNPCTopics[55].pText; 5018 v11 = (char *)pNPCTopics[55].pText;
5019 } 5019 }
9501 if ( contract_approved ) 9501 if ( contract_approved )
9502 { 9502 {
9503 Party::TakeGold(gold_transaction_amount); 9503 Party::TakeGold(gold_transaction_amount);
9504 if ( uActiveCharacter ) 9504 if ( uActiveCharacter )
9505 { 9505 {
9506 v12 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards]; 9506 v12 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number];
9507 *(short *)v12 &= 0x3Fu; 9507 *(short *)v12 &= 0x3Fu;
9508 switch ( dword_F8B1B0 ) 9508 switch ( dword_F8B1B0 )
9509 { 9509 {
9510 case 2: 9510 case 2:
9511 v15 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards]; 9511 v15 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number];
9512 *v15 |= 0x40u; 9512 *v15 |= 0x40u;
9513 break; 9513 break;
9514 case 3: 9514 case 3:
9515 v14 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards]; 9515 v14 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number];
9516 *v14 |= 0x80u; 9516 *v14 |= 0x80u;
9517 break; 9517 break;
9518 case 4: 9518 case 4:
9519 v13 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards]; 9519 v13 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number];
9520 v13[1] |= 1u; 9520 v13[1] |= 1u;
9521 break; 9521 break;
9522 } 9522 }
9523 pPlayers[uActiveCharacter]->PlaySound(SPEECH_85, 0); 9523 pPlayers[uActiveCharacter]->PlaySound(SPEECH_85, 0);
9524 } 9524 }
9532 }*/ 9532 }*/
9533 } 9533 }
9534 } 9534 }
9535 else 9535 else
9536 { 9536 {
9537 if ( uMessageParam == 82 && contract_approved ) 9537 if ( uMessageParam == 82 && contract_approved ) //join guild
9538 { 9538 {
9539 Party::TakeGold(gold_transaction_amount); 9539 Party::TakeGold(gold_transaction_amount);
9540 v4 = pParty->pPlayers; 9540 v4 = pParty->pPlayers;
9541 do 9541 do
9542 { 9542 {
9543 v4->SetVariable(VAR_Award, dword_F8B1AC_something_todo_with_awards); 9543 v4->SetVariable(VAR_Award, dword_F8B1AC_award_bit_number);
9544 ++v4; 9544 ++v4;
9545 } 9545 }
9546 while ( (signed int)v4 < (signed int)pParty->pHirelings ); 9546 while ( (signed int)v4 < (signed int)pParty->pHirelings );
9547 switch ( dword_F8B1D8 ) 9547 switch ( dword_F8B1D8 )
9548 { 9548 {
9697 contract_approved = 0; 9697 contract_approved = 0;
9698 v2 = (_this - 200) % 3; 9698 v2 = (_this - 200) % 3;
9699 v3 = (_this - 200) / 3; 9699 v3 = (_this - 200) / 3;
9700 v4 = v2; 9700 v4 = v2;
9701 v35 = (char *)pNPCTopics[127].pText; 9701 v35 = (char *)pNPCTopics[127].pText;
9702 dword_F8B1AC_something_todo_with_awards = v3; 9702 dword_F8B1AC_award_bit_number = v3;
9703 if ( v2 ) 9703 if ( v2 )
9704 { 9704 {
9705 if ( v2 == 1 ) 9705 if ( v2 == 1 )
9706 { 9706 {
9707 gold_transaction_amount = 5000; 9707 gold_transaction_amount = 5000;
9793 { 9793 {
9794 if ( v34 == 3 ) 9794 if ( v34 == 3 )
9795 { 9795 {
9796 if ( (signed int)v16 >= 2 && v7 >= 7 ) 9796 if ( (signed int)v16 >= 2 && v7 >= 7 )
9797 { 9797 {
9798 v17 = dword_F8B1AC_something_todo_with_awards; 9798 v17 = dword_F8B1AC_award_bit_number;
9799 switch ( dword_F8B1AC_something_todo_with_awards ) 9799 switch ( dword_F8B1AC_award_bit_number )
9800 { 9800 {
9801 default: 9801 default:
9802 goto LABEL_41; 9802 goto LABEL_41;
9803 case 12: 9803 case 12:
9804 case 13: 9804 case 13:
9856 else 9856 else
9857 { 9857 {
9858 if ( v34 != 4 ) 9858 if ( v34 != 4 )
9859 { 9859 {
9860 LABEL_40: 9860 LABEL_40:
9861 v17 = dword_F8B1AC_something_todo_with_awards; 9861 v17 = dword_F8B1AC_award_bit_number;
9862 goto LABEL_41; 9862 goto LABEL_41;
9863 } 9863 }
9864 if ( (signed int)v16 >= 3 && v7 >= 10 ) 9864 if ( (signed int)v16 >= 3 && v7 >= 10 )
9865 { 9865 {
9866 v17 = dword_F8B1AC_something_todo_with_awards; 9866 v17 = dword_F8B1AC_award_bit_number;
9867 switch ( dword_F8B1AC_something_todo_with_awards ) 9867 switch ( dword_F8B1AC_award_bit_number )
9868 { 9868 {
9869 case 19: 9869 case 19:
9870 if ( v1->_49327B(0x22u, 1) == 1 ) 9870 if ( v1->_49327B(0x22u, 1) == 1 )
9871 goto LABEL_40; 9871 goto LABEL_40;
9872 v26 = 1; 9872 v26 = 1;
9919 } 9919 }
9920 return v35; 9920 return v35;
9921 } 9921 }
9922 if ( v7 < 4 ) 9922 if ( v7 < 4 )
9923 return v35; 9923 return v35;
9924 v17 = dword_F8B1AC_something_todo_with_awards; 9924 v17 = dword_F8B1AC_award_bit_number;
9925 if ( dword_F8B1AC_something_todo_with_awards > 27 ) 9925 if ( dword_F8B1AC_award_bit_number > 27 )
9926 { 9926 {
9927 if ( dword_F8B1AC_something_todo_with_awards != 29 9927 if ( dword_F8B1AC_award_bit_number != 29
9928 && dword_F8B1AC_something_todo_with_awards != 32 9928 && dword_F8B1AC_award_bit_number != 32
9929 && (dword_F8B1AC_something_todo_with_awards <= 33 || dword_F8B1AC_something_todo_with_awards > 35) ) 9929 && (dword_F8B1AC_award_bit_number <= 33 || dword_F8B1AC_award_bit_number > 35) )
9930 { 9930 {
9931 LABEL_41: 9931 LABEL_41:
9932 if ( !gold_transaction_amount ) 9932 if ( !gold_transaction_amount )
9933 goto LABEL_79; 9933 goto LABEL_79;
9934 goto LABEL_42; 9934 goto LABEL_42;
9935 } 9935 }
9936 LABEL_87: 9936 LABEL_87:
9937 gold_transaction_amount = 500; 9937 gold_transaction_amount = 500;
9938 goto LABEL_41; 9938 goto LABEL_41;
9939 } 9939 }
9940 if ( dword_F8B1AC_something_todo_with_awards >= 23 ) 9940 if ( dword_F8B1AC_award_bit_number >= 23 )
9941 goto LABEL_87; 9941 goto LABEL_87;
9942 if ( dword_F8B1AC_something_todo_with_awards == 7 ) 9942 if ( dword_F8B1AC_award_bit_number == 7 )
9943 { 9943 {
9944 gold_transaction_amount = 0; 9944 gold_transaction_amount = 0;
9945 goto LABEL_79; 9945 goto LABEL_79;
9946 } 9946 }
9947 if ( dword_F8B1AC_something_todo_with_awards <= 7 ) 9947 if ( dword_F8B1AC_award_bit_number <= 7 )
9948 goto LABEL_41; 9948 goto LABEL_41;
9949 if ( dword_F8B1AC_something_todo_with_awards > 18 ) 9949 if ( dword_F8B1AC_award_bit_number > 18 )
9950 { 9950 {
9951 if ( dword_F8B1AC_something_todo_with_awards != 21 ) 9951 if ( dword_F8B1AC_award_bit_number != 21 )
9952 goto LABEL_41; 9952 goto LABEL_41;
9953 goto LABEL_87; 9953 goto LABEL_87;
9954 } 9954 }
9955 gold_transaction_amount = 1000; 9955 gold_transaction_amount = 1000;
9956 LABEL_42: 9956 LABEL_42:
9984 } 9984 }
9985 9985
9986 9986
9987 9987
9988 //----- (004B29F2) -------------------------------------------------------- 9988 //----- (004B29F2) --------------------------------------------------------
9989 const char *__fastcall ContractSelectText(int pEventNumber) 9989 const char * ContractSelectText( int pEventCode )
9990 { 9990 {
9991 static const int dialogue_base=110;
9991 contract_approved = 0; 9992 contract_approved = 0;
9992 dword_F8B1AC_something_todo_with_awards = pEventNumber + 50; 9993 dword_F8B1AC_award_bit_number = pEventCode + 50;
9993 gold_transaction_amount = price_for_membership[pEventNumber]; 9994 gold_transaction_amount = price_for_membership[pEventCode];
9994 if ( pPlayers[uActiveCharacter]->CanAct() ) 9995 if ( pPlayers[uActiveCharacter]->CanAct() )
9995 { 9996 {
9996 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_guilds_member_bits, dword_F8B1AC_something_todo_with_awards) ) 9997 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_guilds_member_bits, dword_F8B1AC_award_bit_number) )
9997 { 9998 {
9998 return pNPCTopics[123].pText; 9999 return pNPCTopics[dialogue_base+13].pText;
9999 } 10000 }
10000 else 10001 else
10001 { 10002 {
10002 if ( gold_transaction_amount <= pParty->uNumGold ) 10003 if ( gold_transaction_amount <= pParty->uNumGold )
10003 { 10004 {
10004 contract_approved = 1; 10005 contract_approved = 1;
10005 return pNPCTopics[pEventNumber + 110].pText; 10006 return pNPCTopics[pEventCode + dialogue_base].pText;
10006 } 10007 }
10007 else 10008 else
10008 { 10009 {
10009 return pNPCTopics[124].pText; 10010 return pNPCTopics[dialogue_base+14].pText;
10010 } 10011 }
10011 } 10012 }
10012 } 10013 }
10013 else 10014 else
10014 { 10015 {
10015 return pNPCTopics[122].pText; 10016 return pNPCTopics[dialogue_base+12].pText;
10016 } 10017 }
10017 } 10018 }
10018 10019
10019 10020
10020 //----- (004B2A74) -------------------------------------------------------- 10021 //----- (004B2A74) --------------------------------------------------------
10620 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять 10621 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять
10621 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1); 10622 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1);
10622 } 10623 }
10623 10624
10624 //----- (004B3EF0) -------------------------------------------------------- 10625 //----- (004B3EF0) --------------------------------------------------------
10625 void __fastcall DrawJoinGuildWindow(int pEventNumber) 10626 void DrawJoinGuildWindow( int pEventCode )
10626 { 10627 {
10627 uDialogueType = 81;//enum JoinGuildDialog 10628 uDialogueType = 81;//enum JoinGuildDialog
10628 ptr_F8B1E8 = (char *)pNPCTopics[pEventNumber + 99].pText; 10629 ptr_F8B1E8 = (char *)pNPCTopics[pEventCode + 99].pText;
10629 ContractSelectText(pEventNumber); 10630 ContractSelectText(pEventCode);
10630 pDialogueWindow->Release(); 10631 pDialogueWindow->Release();
10631 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventNumber, 0); 10632 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventCode, 0);
10632 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], 10633 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34],
10633 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); 10634 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0);
10634 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); 10635 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0);
10635 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); 10636 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0);
10636 pDialogueWindow->_41D08F(1, 1, 0, 2); 10637 pDialogueWindow->_41D08F(1, 1, 0, 2);
10649 ptr_F8B1E8 = (char *)pNPCTopics[a4 + 168].pText; 10650 ptr_F8B1E8 = (char *)pNPCTopics[a4 + 168].pText;
10650 _4B254D_SkillMasteryTeacher(a4); 10651 _4B254D_SkillMasteryTeacher(a4);
10651 pDialogueWindow->Release(); 10652 pDialogueWindow->Release();
10652 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, v1, 0); 10653 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, v1, 0);
10653 v2 = ""; 10654 v2 = "";
10654 pBtn_ExitCancel = pDialogueWindow->CreateButton( 10655 pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0,
10655 0x1D7u,
10656 0x1BDu,
10657 0xA9u,
10658 0x23u,
10659 1,
10660 0,
10661 0x71u,
10662 0,
10663 0,
10664 pGlobalTXT_LocalizationStrings[34], 10656 pGlobalTXT_LocalizationStrings[34],
10665 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 10657 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
10666 0); 10658 0);
10667 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); 10659 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0);
10668 if ( contract_approved ) 10660 if ( contract_approved )
14381 dword_F8B1F4 = 0; 14373 dword_F8B1F4 = 0;
14382 memset(byte_F8B1F0, 0, 4); 14374 memset(byte_F8B1F0, 0, 4);
14383 memset(byte_F8B148, 0, 16); 14375 memset(byte_F8B148, 0, 16);
14384 pRenderer->ClearZBuffer(0, 479); 14376 pRenderer->ClearZBuffer(0, 479);
14385 14377
14386 if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour >=uOpenTime)||(pParty->uCurrentHour <=(uCloseTime - 1))))|| 14378 if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))||
14387 ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1))))) 14379 ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1)))))
14388 14380
14389 { 14381 {
14390 am_pm_flag_open = 0; 14382 am_pm_flag_open = 0;
14391 am_pm_flag_close = 0; 14383 am_pm_flag_close = 0;