Overview
The Olympiad system manages the competitive PvP arena system in L2J Mobius Chronicle 4. It handles player registration, match scheduling, rankings, ELO ratings, hero selection, and seasonal cycles. Key Classes:org.l2jmobius.gameserver.model.olympiad.Olympiad- Main olympiad manager (singleton)org.l2jmobius.gameserver.model.olympiad.OlympiadManager- Match coordination and stadium managementorg.l2jmobius.gameserver.model.olympiad.OlympiadGame- Individual match logic
Olympiad Manager
Location:org.l2jmobius.gameserver.model.olympiad.Olympiad
Singleton Pattern
Key Methods
Registration Management
Registers a noble player for olympiad competition.Parameters:
noble- The player attempting to registerclassBased- True for class-based matches, false for non-classed
true if registration successful, false otherwiseRequirements:- Player must be noble
- Must be in base class (no subclass)
- Inventory must be < 80% full
- Minimum 3 points (classed) or 5 points (non-classed)
- Must not be registered for events
- Competition period must be active
Unregisters a player from olympiad waiting list.Returns:
true if successfully unregisteredChecks if a player is registered for olympiad.
Match & Period Management
Checks if currently in competition period.Returns:
true if competitions are runningChecks if in validation period (not competition period).Returns:
true if period != 0 (validation mode)Gets milliseconds remaining until olympiad period ends.
Player Stats & Rankings
Retrieves a player’s olympiad statistics.Returns: StatSet containing:
olympiad_points- Current olympiad pointscompetitions_done- Total matches playedcompetitions_won- Matches woncompetitions_lost- Matches lostcompetitions_drawn- Matches drawnelo- ELO ratingclass_id- Player’s class IDchar_name- Player name
Gets a player’s current olympiad points.
Gets a player’s ELO rating.Returns: ELO rating or initial value if player not found
Gets number of competitions completed.
Spectator Management
Adds a spectator to an olympiad match.Parameters:
id- Stadium/game ID (0-21)spectator- Player to add as spectatorstoreCoords- Whether to store original coordinates
Removes a spectator from an olympiad stadium.
Gets the arena ID where a player is spectating.Returns: Arena ID or -1 if not spectating
ELO & Division System
Division Calculation
- Bronze: ELO < 1100
- Silver: 1100 ≤ ELO < 1300
- Gold: 1300 ≤ ELO < 1500
- Platinum: 1500 ≤ ELO < 1800
- Diamond: ELO ≥ 1800
Division Colors
- Bronze:
0x808080(Gray) - Silver:
0xFFFFFF(White) - Gold:
0xFFFF00(Yellow) - Platinum:
0x00FFFF(Cyan) - Diamond:
0xFF00FF(Magenta)
Period Management
The Olympiad operates in two periods: Period 0 - Competition Period:- Players can register and compete
- Matches run on configured days/times
- Points earned from victories
- Weekly bonus points distributed
- 24-hour period after competition ends
- Heroes selected from top players
- Rankings finalized
- Rewards calculated and distributed
Season System
Gets the current olympiad cycle number.
Gets the current olympiad season.
Data Persistence
Saves current olympiad state to database.Saves:
- Current cycle and period
- Olympiad/validation end times
- All noble player data (points, wins, losses, ELO)
OlympiadManager
Location:org.l2jmobius.gameserver.model.olympiad.OlympiadManager
Stadium Management
Stadium Count: 22 stadiums (STADIUMS array)Match Scheduling
The OlympiadManager implementsRunnable and manages:
- Match queue creation based on registered players
- ELO-based matchmaking
- Stadium allocation
- Game thread execution
Matchmaking Algorithm
- Sort players by ELO (descending)
- Select highest ELO player
- Pick opponent from top 5 or 20% of list (whichever is smaller)
- Randomize selection within scope for variety
Game Instance Management
Retrieves an olympiad game by stadium ID.
Gets all active olympiad games.
Configuration Constants
Database Constants
Division Constants
Usage Examples
Register Player for Olympiad
Check Player Stats
Add Spectator to Match
Get Active Matches
Related Systems
- Hero System (
org.l2jmobius.gameserver.model.olympiad.Hero) - Manages hero selection and rewards - AntiFeedManager - Prevents dual-boxing and match manipulation
- ZoneManager - Manages olympiad stadium zones
- OlympiadConfig - Configuration values for the system
Source Reference
- Source:
java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java:58 - Source:
java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java:34