comparison mm7_4.cpp @ 964:d7f0572335ec

Слияние
author Ritor1
date Sat, 04 May 2013 18:19:08 +0600
parents cbf623f00e6c e9292c58644a
children c8a0f6d89c70
comparison
equal deleted inserted replaced
963:cbf623f00e6c 964:d7f0572335ec
6837 } 6837 }
6838 6838
6839 //----- (004B254D) -------------------------------------------------------- 6839 //----- (004B254D) --------------------------------------------------------
6840 char *__thiscall _4B254D_SkillMasteryTeacher(int _this) 6840 char *__thiscall _4B254D_SkillMasteryTeacher(int _this)
6841 { 6841 {
6842 Player *v1; // esi@1 6842 //Player *v1; // esi@1
6843 int v2; // edx@1 6843 int v2; // edx@1
6844 int v3; // ecx@1 6844 int v3; // ecx@1
6845 int v4; // edi@1 6845 int v4; // edi@1
6846 int v5; // eax@7 6846 int pClassType; // eax@7
6847 int v6; // eax@7 6847 int v6; // eax@7
6848 int v7; // ebx@7 6848 int v7; // ebx@7
6849 int v8; // ebx@8 6849 //int v8; // ebx@8
6850 signed int v9; // esi@8 6850 signed int v9; // esi@8
6851 int v10; // eax@8 6851 int v10; // eax@8
6852 char *v11; // ecx@8 6852 char *v11; // ecx@8
6853 int v12; // edi@9 6853 int v12; // edi@9
6854 char *v13; // edx@9 6854 char *v13; // edx@9
6855 signed int v14; // edi@10 6855 signed int v14; // edi@10
6856 unsigned int v16; // eax@29 6856 unsigned int v16; // eax@29
6857 int v17; // eax@36 6857 //int v17; // eax@36
6858 char v18; // cl@46 6858 char v18; // cl@46
6859 __int16 v19; // dx@56 6859 __int16 v19; // dx@56
6860 int v20; // eax@60 6860 int v20; // eax@60
6861 char *v21; // [sp-Ch] [bp-38h]@82 6861 //char *v21; // [sp-Ch] [bp-38h]@82
6862 const char *v22; // [sp-8h] [bp-34h]@21 6862 //const char *v22; // [sp-8h] [bp-34h]@21
6863 unsigned int v23; // [sp-8h] [bp-34h]@38 6863 //unsigned int v23; // [sp-8h] [bp-34h]@38
6864 char *v24; // [sp-8h] [bp-34h]@82 6864 //char *v24; // [sp-8h] [bp-34h]@82
6865 char *v25; // [sp-4h] [bp-30h]@14 6865 char *v25; // [sp-4h] [bp-30h]@14
6866 int v26; // [sp-4h] [bp-30h]@38 6866 //int v26; // [sp-4h] [bp-30h]@38
6867 int v27; // [sp-4h] [bp-30h]@82 6867 //int v27; // [sp-4h] [bp-30h]@82
6868 char v28[4]; // [sp+Ch] [bp-20h]@9 6868 char v28[4]; // [sp+Ch] [bp-20h]@9
6869 int v29; // [sp+10h] [bp-1Ch]@13 6869 int v29; // [sp+10h] [bp-1Ch]@13
6870 int v30; // [sp+14h] [bp-18h]@15 6870 int v30; // [sp+14h] [bp-18h]@15
6871 int v31; // [sp+18h] [bp-14h]@16 6871 int v31; // [sp+18h] [bp-14h]@16
6872 unsigned __int16 a1[2]; // [sp+1Ch] [bp-10h]@7 6872 unsigned __int16 a1[2]; // [sp+1Ch] [bp-10h]@7
6873 int v33; // [sp+20h] [bp-Ch]@7 6873 //int v33; // [sp+20h] [bp-Ch]@7
6874 int v34; // [sp+24h] [bp-8h]@7 6874 int v34; // [sp+24h] [bp-8h]@7
6875 char *v35; // [sp+28h] [bp-4h]@1 6875 char *v35; // [sp+28h] [bp-4h]@1
6876 6876
6877 v1 = pPlayers[uActiveCharacter];
6878 contract_approved = 0; 6877 contract_approved = 0;
6879 v2 = (_this - 200) % 3; 6878 v2 = (_this - 200) % 3;
6880 v3 = (_this - 200) / 3; 6879 v3 = (_this - 200) / 3;
6881 v4 = v2; 6880 v4 = v2;
6882 v35 = (char *)pNPCTopics[127].pText; 6881 v35 = (char *)pNPCTopics[127].pText;
6900 else 6899 else
6901 { 6900 {
6902 gold_transaction_amount = 2000; 6901 gold_transaction_amount = 2000;
6903 dword_F8B1B0 = 2; 6902 dword_F8B1B0 = 2;
6904 } 6903 }
6905 v5 = v1->classType; 6904 pClassType = pPlayers[uActiveCharacter]->classType;
6906 v33 = v5; 6905 //v33 = pClassType;
6907 v6 = byte_4ED970_skill_learn_ability_by_class_table[v5][v3]; 6906 v6 = byte_4ED970_skill_learn_ability_by_class_table[pClassType][v3];
6908 *(int *)a1 = v1->pActiveSkills[v3]; 6907 *(int *)a1 = pPlayers[uActiveCharacter]->pActiveSkills[v3];
6909 v7 = a1[0] & 0x3F; 6908 v7 = a1[0] & 0x3F;
6910 v34 = v2 + 2; 6909 v34 = v2 + 2;
6911 if ( v6 < v2 + 2 ) 6910 if ( v6 < v2 + 2 )
6912 { 6911 {
6913 v8 = v33; 6912 //v8 = v33;
6914 v9 = 0; 6913 v9 = 0;
6915 v10 = v33 - v33 % 4; 6914 v10 = pClassType - pClassType % 4;
6916 v11 = &byte_4ED970_skill_learn_ability_by_class_table[v33 - v33 % 4][v3]; 6915 v11 = &byte_4ED970_skill_learn_ability_by_class_table[pClassType - pClassType % 4][v3];
6917 do 6916 do
6918 { 6917 {
6919 v12 = (unsigned __int8)*v11; 6918 v12 = (unsigned __int8)*v11;
6920 v13 = &v28[4 * v9]; 6919 v13 = &v28[4 * v9];
6921 *(int *)v13 = 0; 6920 *(int *)v13 = 0;
6936 { 6935 {
6937 v25 = pClassNames[v10 + 1]; 6936 v25 = pClassNames[v10 + 1];
6938 } 6937 }
6939 else 6938 else
6940 { 6939 {
6941 if ( v30 == v14 ) 6940 if ( v30 == v14 )//crash
6942 { 6941 {
6943 if ( v31 == v14 ) 6942 if ( v31 == v14 )
6944 { 6943 {
6945 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]); 6944 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]);// %s %s .
6946 return pTmpBuf; 6945 return pTmpBuf;
6947 } 6946 }
6948 v25 = pClassNames[v10 + 2]; 6947 v25 = pClassNames[v10 + 2];
6949 } 6948 }
6950 else 6949 else
6951 { 6950 {
6952 if ( v31 != v14 ) 6951 if ( v31 != v14 )
6953 { 6952 {
6954 v25 = pClassNames[v8]; 6953 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);// %s.
6955 v22 = pGlobalTXT_LocalizationStrings[632]; 6954 return pTmpBuf;
6956 goto LABEL_23;
6957 } 6955 }
6958 v25 = pClassNames[v10 + 3]; 6956 v25 = pClassNames[v10 + 3];
6959 } 6957 }
6960 } 6958 }
6961 v22 = pGlobalTXT_LocalizationStrings[633]; 6959 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[633], v25);// %s .
6962 LABEL_23:
6963 sprintf(pTmpBuf, v22, v25);
6964 return pTmpBuf; 6960 return pTmpBuf;
6965 } 6961 }
6966 if ( !v1->CanAct() ) 6962 if ( !pPlayers[uActiveCharacter]->CanAct() )
6967 return (char *)pNPCTopics[122].pText; 6963 return (char *)pNPCTopics[122].pText;
6968 if ( !v7 ) 6964 if ( !v7 )
6969 return (char *)pNPCTopics[131].pText; 6965 return (char *)pNPCTopics[131].pText;
6970 v16 = SkillToMastery(a1[0]); 6966 v16 = SkillToMastery(a1[0]);
6971 if ( (signed int)v16 > v4 + 1 ) 6967 if ( (signed int)v16 > v4 + 1 )
6974 { 6970 {
6975 if ( v34 == 3 ) 6971 if ( v34 == 3 )
6976 { 6972 {
6977 if ( (signed int)v16 >= 2 && v7 >= 7 ) 6973 if ( (signed int)v16 >= 2 && v7 >= 7 )
6978 { 6974 {
6979 v17 = dword_F8B1AC_award_bit_number;
6980 switch ( dword_F8B1AC_award_bit_number ) 6975 switch ( dword_F8B1AC_award_bit_number )
6981 { 6976 {
6982 default:
6983 goto LABEL_41;
6984 case 12: 6977 case 12:
6985 case 13: 6978 case 13:
6986 case 14: 6979 case 14:
6987 case 15: 6980 case 15:
6988 case 16: 6981 case 16:
6990 case 18: 6983 case 18:
6991 gold_transaction_amount = 4000; 6984 gold_transaction_amount = 4000;
6992 goto LABEL_42; 6985 goto LABEL_42;
6993 case 19: 6986 case 19:
6994 v19 = 114; 6987 v19 = 114;
6995 goto LABEL_57; 6988 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) )
6989 return v35;
6990 if ( !gold_transaction_amount )
6991 goto LABEL_79;
6992 goto LABEL_42;
6996 case 20: 6993 case 20:
6997 v19 = 110; 6994 v19 = 110;
6998 LABEL_57:
6999 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) ) 6995 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) )
7000 return v35; 6996 return v35;
7001 goto LABEL_40; 6997 if ( !gold_transaction_amount )
6998 goto LABEL_79;
6999 goto LABEL_42;
7002 case 22: 7000 case 22:
7003 v20 = v1->GetBaseWillpower(); 7001 v20 = pPlayers[uActiveCharacter]->GetBaseWillpower();
7004 goto LABEL_61; 7002 if ( v20 < 50 )
7003 return v35;
7004 if ( !gold_transaction_amount )
7005 goto LABEL_79;
7006 goto LABEL_42;
7005 case 24: 7007 case 24:
7006 gold_transaction_amount = 2500; 7008 gold_transaction_amount = 2500;
7007 v20 = v1->GetBaseEndurance(); 7009 v20 = pPlayers[uActiveCharacter]->GetBaseEndurance();
7008 goto LABEL_61;
7009 case 36:
7010 v20 = v1->GetBaseIntelligence();
7011 LABEL_61:
7012 if ( v20 < 50 ) 7010 if ( v20 < 50 )
7013 return v35; 7011 return v35;
7014 goto LABEL_40; 7012 if ( !gold_transaction_amount )
7013 goto LABEL_79;
7014 goto LABEL_42;
7015 case 36:
7016 v20 = pPlayers[uActiveCharacter]->GetBaseIntelligence();
7017 if ( v20 < 50 )
7018 return v35;
7019 if ( !gold_transaction_amount )
7020 goto LABEL_79;
7021 goto LABEL_42;
7015 case 21: 7022 case 21:
7016 case 23: 7023 case 23:
7017 case 25: 7024 case 25:
7018 case 26: 7025 case 26:
7019 case 29: 7026 case 29:
7027 case 10: 7034 case 10:
7028 case 11: 7035 case 11:
7029 gold_transaction_amount = 3000; 7036 gold_transaction_amount = 3000;
7030 goto LABEL_42; 7037 goto LABEL_42;
7031 case 7: 7038 case 7:
7032 goto LABEL_67; 7039 gold_transaction_amount = 0;
7040 if ( !gold_transaction_amount )
7041 goto LABEL_79;
7042 goto LABEL_42;
7043 default:
7044 if ( !gold_transaction_amount )
7045 goto LABEL_79;
7046 goto LABEL_42;
7033 } 7047 }
7034 goto LABEL_67; 7048 gold_transaction_amount = 0;
7049 if ( !gold_transaction_amount )
7050 goto LABEL_79;
7051 goto LABEL_42;
7035 } 7052 }
7036 } 7053 }
7037 else 7054 else
7038 { 7055 {
7039 if ( v34 != 4 ) 7056 if ( v34 != 4 )
7040 { 7057 {
7041 LABEL_40: 7058 if ( !gold_transaction_amount )
7042 v17 = dword_F8B1AC_award_bit_number; 7059 goto LABEL_79;
7043 goto LABEL_41; 7060 goto LABEL_42;
7044 } 7061 }
7045 if ( (signed int)v16 >= 3 && v7 >= 10 ) 7062 if ( (signed int)v16 >= 3 && v7 >= 10 )
7046 { 7063 {
7047 v17 = dword_F8B1AC_award_bit_number;
7048 switch ( dword_F8B1AC_award_bit_number ) 7064 switch ( dword_F8B1AC_award_bit_number )
7049 { 7065 {
7050 case 19: 7066 case 19:
7051 if ( v1->_49327B(0x22u, 1) == 1 ) 7067 if ( pPlayers[uActiveCharacter]->_49327B(0x22u, 1) == 1 )
7052 goto LABEL_40; 7068 {
7053 v26 = 1; 7069 if ( !gold_transaction_amount )
7054 v23 = 26; 7070 goto LABEL_79;
7055 goto LABEL_39; 7071 goto LABEL_42;
7056 default: 7072 }
7057 goto LABEL_41; 7073 if ( pPlayers[uActiveCharacter]->_49327B(26, 1) == 1 )
7074 {
7075 if ( !gold_transaction_amount )
7076 goto LABEL_79;
7077 goto LABEL_42;
7078 }
7079 return v35;
7058 case 20: 7080 case 20:
7059 if ( v1->_49327B(0x23u, 1) == 1 ) 7081 if ( pPlayers[uActiveCharacter]->_49327B(0x23u, 1) == 1 )
7060 goto LABEL_40; 7082 {
7061 v26 = 1; 7083 if ( !gold_transaction_amount )
7062 v23 = 27; 7084 goto LABEL_79;
7063 LABEL_39: 7085 goto LABEL_42;
7064 if ( v1->_49327B(v23, v26) == 1 ) 7086 }
7065 goto LABEL_40; 7087 if ( pPlayers[uActiveCharacter]->_49327B(27, 1) == 1 )
7088 {
7089 if ( !gold_transaction_amount )
7090 goto LABEL_79;
7091 goto LABEL_42;
7092 }
7066 return v35; 7093 return v35;
7067 case 30: 7094 case 30:
7068 v18 = LOBYTE(v1->pActiveSkills[31]); 7095 v18 = LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[31]);
7069 goto LABEL_47;
7070 case 31:
7071 v18 = LOBYTE(v1->pActiveSkills[30]);
7072 LABEL_47:
7073 if ( (v18 & 0x3Fu) < 0xA ) 7096 if ( (v18 & 0x3Fu) < 0xA )
7074 return v35; 7097 return v35;
7075 goto LABEL_41; 7098 if ( !gold_transaction_amount )
7099 goto LABEL_79;
7100 goto LABEL_42;
7101 case 31:
7102 v18 = LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[30]);
7103 if ( (v18 & 0x3Fu) < 0xA )
7104 return v35;
7105 if ( !gold_transaction_amount )
7106 goto LABEL_79;
7107 goto LABEL_42;
7076 case 21: 7108 case 21:
7077 case 23: 7109 case 23:
7078 case 24: 7110 case 24:
7079 case 25: 7111 case 25:
7080 case 26: 7112 case 26:
7090 case 11: 7122 case 11:
7091 gold_transaction_amount = 7000; 7123 gold_transaction_amount = 7000;
7092 goto LABEL_42; 7124 goto LABEL_42;
7093 case 7: 7125 case 7:
7094 break; 7126 break;
7127 default:
7128 if ( !gold_transaction_amount )
7129 goto LABEL_79;
7130 goto LABEL_42;
7095 } 7131 }
7096 LABEL_67:
7097 gold_transaction_amount = 0; 7132 gold_transaction_amount = 0;
7098 goto LABEL_41; 7133 if ( !gold_transaction_amount )
7134 goto LABEL_79;
7135 goto LABEL_42;
7099 } 7136 }
7100 } 7137 }
7101 return v35; 7138 return v35;
7102 } 7139 }
7103 if ( v7 < 4 ) 7140 if ( v7 < 4 )
7104 return v35; 7141 return v35;
7105 v17 = dword_F8B1AC_award_bit_number;
7106 if ( dword_F8B1AC_award_bit_number > 27 ) 7142 if ( dword_F8B1AC_award_bit_number > 27 )
7107 { 7143 {
7108 if ( dword_F8B1AC_award_bit_number != 29 7144 if ( dword_F8B1AC_award_bit_number != 29
7109 && dword_F8B1AC_award_bit_number != 32 7145 && dword_F8B1AC_award_bit_number != 32
7110 && (dword_F8B1AC_award_bit_number <= 33 || dword_F8B1AC_award_bit_number > 35) ) 7146 && (dword_F8B1AC_award_bit_number <= 33 || dword_F8B1AC_award_bit_number > 35) )
7111 { 7147 {
7112 LABEL_41:
7113 if ( !gold_transaction_amount ) 7148 if ( !gold_transaction_amount )
7114 goto LABEL_79; 7149 goto LABEL_79;
7115 goto LABEL_42; 7150 goto LABEL_42;
7116 } 7151 }
7117 LABEL_87:
7118 gold_transaction_amount = 500; 7152 gold_transaction_amount = 500;
7119 goto LABEL_41; 7153 if ( !gold_transaction_amount )
7154 goto LABEL_79;
7155 goto LABEL_42;
7120 } 7156 }
7121 if ( dword_F8B1AC_award_bit_number >= 23 ) 7157 if ( dword_F8B1AC_award_bit_number >= 23 )
7122 goto LABEL_87; 7158 {
7159 gold_transaction_amount = 500;
7160 if ( !gold_transaction_amount )
7161 goto LABEL_79;
7162 goto LABEL_42;
7163 }
7123 if ( dword_F8B1AC_award_bit_number == 7 ) 7164 if ( dword_F8B1AC_award_bit_number == 7 )
7124 { 7165 {
7125 gold_transaction_amount = 0; 7166 gold_transaction_amount = 0;
7126 goto LABEL_79; 7167 goto LABEL_79;
7127 } 7168 }
7128 if ( dword_F8B1AC_award_bit_number <= 7 ) 7169 if ( dword_F8B1AC_award_bit_number <= 7 )
7129 goto LABEL_41; 7170 {
7171 if ( !gold_transaction_amount )
7172 goto LABEL_79;
7173 goto LABEL_42;
7174 }
7130 if ( dword_F8B1AC_award_bit_number > 18 ) 7175 if ( dword_F8B1AC_award_bit_number > 18 )
7131 { 7176 {
7132 if ( dword_F8B1AC_award_bit_number != 21 ) 7177 if ( dword_F8B1AC_award_bit_number != 21 )
7133 goto LABEL_41; 7178 {
7134 goto LABEL_87; 7179 if ( !gold_transaction_amount )
7180 goto LABEL_79;
7181 goto LABEL_42;
7182 }
7183 gold_transaction_amount = 500;
7184 if ( !gold_transaction_amount )
7185 goto LABEL_79;
7186 goto LABEL_42;
7135 } 7187 }
7136 gold_transaction_amount = 1000; 7188 gold_transaction_amount = 1000;
7137 LABEL_42: 7189 LABEL_42:
7138 if ( gold_transaction_amount > pParty->uNumGold ) 7190 if ( gold_transaction_amount > pParty->uNumGold )
7139 return (char *)pNPCTopics[124].pText; 7191 return (char *)pNPCTopics[124].pText;
7140 LABEL_79: 7192 LABEL_79:
7141 contract_approved = 1; 7193 contract_approved = 1;
7142 if ( v34 == 2 ) 7194 if ( v34 == 2 )
7143 { 7195 {
7144 v27 = gold_transaction_amount; 7196 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534],// ^Pr[%s] ^Pr[%s] ^I[%lu] ^L[;;]
7145 v24 = pSkillNames[v17]; 7197 pGlobalTXT_LocalizationStrings[433], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//
7146 v21 = pGlobalTXT_LocalizationStrings[433]; 7198 return pTmpBuf2;
7147 goto LABEL_90;
7148 } 7199 }
7149 if ( v34 == 3 ) 7200 if ( v34 == 3 )
7150 { 7201 {
7151 v27 = gold_transaction_amount; 7202 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534],
7152 v24 = pSkillNames[v17]; 7203 pGlobalTXT_LocalizationStrings[432], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//
7153 v21 = pGlobalTXT_LocalizationStrings[432]; 7204 return pTmpBuf2;
7154 goto LABEL_90;
7155 } 7205 }
7156 if ( v34 == 4 ) 7206 if ( v34 == 4 )
7157 { 7207 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534],
7158 v27 = gold_transaction_amount; 7208 pGlobalTXT_LocalizationStrings[225], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//
7159 v24 = pSkillNames[v17];
7160 v21 = pGlobalTXT_LocalizationStrings[225];
7161 LABEL_90:
7162 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534], v21, v24, v27);
7163 }
7164 return pTmpBuf2; 7209 return pTmpBuf2;
7165 } 7210 }
7166 7211
7167 //----- (004B29F2) -------------------------------------------------------- 7212 //----- (004B29F2) --------------------------------------------------------
7168 const char * ContractSelectText( int pEventCode ) 7213 const char * ContractSelectText( int pEventCode )