Mercurial > mm7
diff mm7_4.cpp @ 2239:699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
author | Grumpy7 |
---|---|
date | Sun, 23 Feb 2014 15:54:00 +0100 |
parents | f66d8be6ad5b |
children | 1fc4223bddf6 |
line wrap: on
line diff
--- a/mm7_4.cpp Sun Feb 23 15:42:15 2014 +0100 +++ b/mm7_4.cpp Sun Feb 23 15:54:00 2014 +0100 @@ -1823,7 +1823,7 @@ } //----- (004B254D) -------------------------------------------------------- -const char * _4B254D_SkillMasteryTeacher(int _this) +const char * _4B254D_SkillMasteryTeacher(int trainerInfo) { int teacherLevel; // edx@1 int skillBeingTaught; // ecx@1 @@ -1836,12 +1836,13 @@ int masteryLevelBeingTaught; // [sp+24h] [bp-8h]@7 contract_approved = 0; - teacherLevel = (_this - 200) % 3; - skillBeingTaught = (_this - 200) / 3; - pClassType = pPlayers[uActiveCharacter]->classType; + teacherLevel = (trainerInfo - 200) % 3; + skillBeingTaught = (trainerInfo - 200) / 3; + Player* activePlayer = pPlayers[uActiveCharacter]; + pClassType = activePlayer->classType; currClassMaxMastery = byte_4ED970_skill_learn_ability_by_class_table[pClassType][skillBeingTaught]; masteryLevelBeingTaught = teacherLevel + 2; - dword_F8B1B0 = masteryLevelBeingTaught; + dword_F8B1B0_MasteryBeingTaught = masteryLevelBeingTaught; if ( currClassMaxMastery < masteryLevelBeingTaught ) { classBaseId = pClassType - pClassType % 4; @@ -1858,9 +1859,9 @@ sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);//Этот уровень навыка не может быть постигнут классом %s. This skill level can not be learned by the %s class. return pTmpBuf.data(); } - if ( !pPlayers[uActiveCharacter]->CanAct() ) + if ( !activePlayer->CanAct() ) return pNPCTopics[122].pText; //Not in your condition! - pointsInSkill = pPlayers[uActiveCharacter]->pActiveSkills[skillBeingTaught]; + pointsInSkill = activePlayer->pActiveSkills[skillBeingTaught]; pointsInSkillWOutMastery = pointsInSkill & 0x3F; if ( !pointsInSkillWOutMastery ) return pNPCTopics[131].pText; //You must know the skill before you can become an expert in it! @@ -2153,8 +2154,8 @@ gold_transaction_amount = 5000; break; case 4: - if ( !pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x22u, 1) || - !pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x1Au, 1)) + if ( !activePlayer->ProfessionOrGuildFlagsCorrect(0x22u, 1) || + !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Au, 1)) return pNPCTopics[127].pText; gold_transaction_amount = 8000; break; @@ -2172,8 +2173,8 @@ gold_transaction_amount = 5000; break; case 4: - if ( !pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x23u, 1) - || !pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x1Bu, 1)) + if ( !activePlayer->ProfessionOrGuildFlagsCorrect(0x23u, 1) + || !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Bu, 1)) return pNPCTopics[127].pText; gold_transaction_amount = 8000; break; @@ -2200,7 +2201,7 @@ gold_transaction_amount = 2000; break; case 3: - if ( pPlayers[uActiveCharacter]->GetBaseWillpower() < 50 ) + if ( activePlayer->GetBaseWillpower() < 50 ) return pNPCTopics[127].pText; gold_transaction_amount = 5000; break; @@ -2230,7 +2231,7 @@ gold_transaction_amount = 500; break; case 3: - if ( pPlayers[uActiveCharacter]->GetBaseEndurance() < 50 ) + if ( activePlayer->GetBaseEndurance() < 50 ) return pNPCTopics[127].pText; gold_transaction_amount = 2500; break; @@ -2297,7 +2298,7 @@ gold_transaction_amount = 5000; break; case 4: - if ( (pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_UNARMED] & 63) < 0xA ) + if ( (activePlayer->pActiveSkills[PLAYER_SKILL_UNARMED] & 63) < 0xA ) return pNPCTopics[127].pText; gold_transaction_amount = 8000; break; @@ -2313,7 +2314,7 @@ gold_transaction_amount = 5000; break; case 4: - if ( (pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_DODGE] & 63) < 0xA ) + if ( (activePlayer->pActiveSkills[PLAYER_SKILL_DODGE] & 63) < 0xA ) return pNPCTopics[127].pText; gold_transaction_amount = 8000; break; @@ -2382,7 +2383,7 @@ gold_transaction_amount = 2000; break; case 3: - if ( pPlayers[uActiveCharacter]->GetBaseIntelligence() < 50 ) + if ( activePlayer->GetBaseIntelligence() < 50 ) return pNPCTopics[127].pText; gold_transaction_amount = 5000; break;