1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-04 09:47:46 +00:00

Additional EXP bonus on full map completion

When the map is fully completed, gain an additional EXP bonus equal to
10 times the regular amount.
This commit is contained in:
Sophie Hamilton 2020-03-02 08:52:28 +00:00
parent 579972278b
commit f8236147a6

View file

@ -622,7 +622,28 @@ void Sapphire::Entity::Player::discover( int16_t map_id, int16_t sub_id )
gainExp( exp ); gainExp( exp );
// gain 10x additional EXP if entire map is completed
uint32_t mask = info->discoveryFlag;
uint32_t discoveredAreas;
if( info->discoveryArrayByte )
{
discoveredAreas = ( m_discovery[ offset + 1 ] << 8 ) |
m_discovery[ offset ];
}
else
{
discoveredAreas = ( m_discovery[ offset + 3 ] << 24 ) |
( m_discovery[ offset + 2 ] << 16 ) |
( m_discovery[ offset + 1 ] << 8 ) |
m_discovery[ offset ];
}
bool allDiscovered = ( ( discoveredAreas & mask ) == mask );
if( allDiscovered )
{
gainExp( exp * 10 );
}
} }
bool Sapphire::Entity::Player::isNewAdventurer() const bool Sapphire::Entity::Player::isNewAdventurer() const