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:
parent
579972278b
commit
f8236147a6
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue