Mercurial > mm7
diff Party.cpp @ 1296:c423f946dc99
moving files continue
author | Ritor1 |
---|---|
date | Tue, 18 Jun 2013 17:28:11 +0600 |
parents | 86a83e12d795 |
children | 5450af4f57ef |
line wrap: on
line diff
--- a/Party.cpp Mon Jun 17 17:34:01 2013 +0600 +++ b/Party.cpp Tue Jun 18 17:28:11 2013 +0600 @@ -1232,4 +1232,37 @@ if ( CheckHiredNPCSpeciality(FallenWizard) ) v1 += 5; return v1 + v0->uReputation; -} \ No newline at end of file +} +//----- (004269A2) -------------------------------------------------------- +void __fastcall GivePartyExp(unsigned int pEXPNum) +{ + signed int pActivePlayerCount; // ecx@1 + int pLearningPercent; // eax@13 + + pActivePlayerCount = 0; + for ( uint i = 0; i < 4; ++i ) + { + if ( !pParty->pPlayers[i].pConditions[13] && !pParty->pPlayers[i].pConditions[14] && !pParty->pPlayers[i].pConditions[15] && !pParty->pPlayers[i].pConditions[16] ) + pActivePlayerCount ++; + } + if ( pActivePlayerCount ) + { + pEXPNum = pEXPNum / pActivePlayerCount; + for ( uint i = 0; i < 4; ++i ) + { + if ( !pParty->pPlayers[i].pConditions[13] && !pParty->pPlayers[i].pConditions[14] && !pParty->pPlayers[i].pConditions[15] && !pParty->pPlayers[i].pConditions[16] ) + { + if ( pEXPNum ) + { + pLearningPercent = pParty->pPlayers[i].GetLearningPercent(); + pEXPNum = pEXPNum + pEXPNum * pLearningPercent / 100; + pParty->pPlayers[i].uExperience += pEXPNum; + if ( pParty->pPlayers[i].uExperience > 4000000000i64 ) + { + pParty->pPlayers[i].uExperience = 0; + } + } + } + } + } +}