Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions docs/Packets/C1-BF-01-IllusionTempleState_by-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The player is in the illusion temple event and the server sends a cyclic update.

## Causes the following actions on the client side

The client shows the state in the user interface.
The client shows the score board, the remaining time, and the carrier of the holy relic and the own team mates on its mini map.

## Structure

Expand All @@ -17,24 +17,24 @@ The client shows the state in the user interface.
| 2 | 1 | Byte | 0xBF | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x01 | Packet header - sub packet type identifier |
| 4 | 2 | ShortLittleEndian | | RemainingSeconds |
| 4 | 2 | ShortLittleEndian | | PlayerIndex |
| 6 | 1 | Byte | | PositionX |
| 7 | 1 | Byte | | PositionY |
| 8 | 1 | Byte | | Team1Points |
| 9 | 1 | Byte | | Team2Points |
| 10 | 1 | Byte | | MyTeam |
| 11 | 1 | Byte | | PartyCount |
| 12 | IllusionTemplePartyEntry.Length * | Array of IllusionTemplePartyEntry | | PartyMembers |
| 6 | 2 | ShortLittleEndian | | RelicCarrierId |
| 8 | 1 | Byte | | PositionX |
| 9 | 1 | Byte | | PositionY |
| 10 | 1 | Byte | | AlliedForcesPoints |
| 11 | 1 | Byte | | IllusionForcesPoints |
| 12 | 1 | Byte | | MyTeam |
| 13 | 1 | Byte | | PartyCount |
| 14 | IllusionTempleTeamMate.Length * | Array of IllusionTempleTeamMate | | TeamMates |

### IllusionTemplePartyEntry Structure
### IllusionTempleTeamMate Structure

Contains the info about a party member in illusion temple.
Contains the info about a team mate in the illusion temple, so that the client can show him on its mini map. Only PartyCount entries are sent - there are no unused/zeroed slots.

Length: 5 Bytes

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 2 | ShortLittleEndian | | PlayerId |
| 2 | 2 | ShortLittleEndian | | MapNumber |
| 2 | 1 | Byte | | MapNumber |
| 3 | 1 | Byte | | PositionX |
| 4 | 1 | Byte | | PositionY |
8 changes: 4 additions & 4 deletions docs/Packets/C1-BF-04-IllusionTempleResult_by-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ The client shows the results.
| 4 | 1 | Byte | | Team1Points |
| 5 | 1 | Byte | | Team2Points |
| 6 | 1 | Byte | | PlayerCount |
| 10 | PlayerResult.Length * PlayerCount | Array of PlayerResult | | Players |
| 7 | PlayerResult.Length * PlayerCount | Array of PlayerResult | | Players |

### PlayerResult Structure

Contains the result of a player in the event.

Length: 17 Bytes
Length: 20 Bytes

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | | String | | Name |
| 0 | 10 | String | | Name |
| 10 | 1 | Byte | | MapNumber |
| 11 | 1 | Byte | | Team |
| 12 | 1 | Byte | | Class |
| 13 | 4 | IntegerLittleEndian | | AddedExperience |
| 16 | 4 | IntegerLittleEndian | | AddedExperience |
31 changes: 31 additions & 0 deletions docs/Packets/C1-BF-09-IllusionTempleEventState_by-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# C1 BF 09 - IllusionTempleEventState (by server)

## Is sent when

The state of an illusion temple event changed, e.g. when the battle starts.

## Causes the following actions on the client side

The client shows or hides the user interface of the event - the score board, the timer and the mini map - and applies the barriers of the arena, which are hardcoded at client side.

## Structure

| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC1 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 6 | Packet header - length of the packet |
| 2 | 1 | Byte | 0xBF | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x09 | Packet header - sub packet type identifier |
| 4 | 1 | Byte | | TempleNumber |
| 5 | 1 | EventState | | State |

### EventState Enum

Defines the state of an illusion temple event.

| Value | Name | Description |
|-------|------|-------------|
| 0 | WaitingRoom | The player entered the event and waits for it to start. It's only sent to the entering player, not to all participants. |
| 1 | Preparation | The preparation started: the players have been moved into the arena and assigned to their teams. The client opens the event interface with the score board, the timer and the mini map. |
| 2 | BattleStarted | The battle started: the statues are up and the barriers of the arena are removed, so that the players can reach the cursed statue. |
| 3 | Ended | The battle ended - the client closes the event interface. |
1 change: 1 addition & 0 deletions docs/Packets/ServerToClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
* [C1 BF 07 - IllusionTempleSkillEnded (by server)](C1-BF-07-IllusionTempleSkillEnded_by-server.md)
* [C1 BF 07 - IllusionTempleSkillEnd (by server)](C1-BF-07-IllusionTempleSkillEnd_by-server.md)
* [C1 BF 08 - IllusionTempleHolyItemRelics (by server)](C1-BF-08-IllusionTempleHolyItemRelics_by-server.md)
* [C1 BF 09 - IllusionTempleEventState (by server)](C1-BF-09-IllusionTempleEventState_by-server.md)
* [C1 BF 0A - ChainLightningHitInfo (by server)](C1-BF-0A-ChainLightningHitInfo_by-server.md)
* [C1 BF 51 - MuHelperStatusUpdate (by server)](C1-BF-51-MuHelperStatusUpdate_by-server.md)
* [C2 C0 - MessengerInitialization (by server)](C2-C0-MessengerInitialization_by-server.md)
Expand Down
1 change: 1 addition & 0 deletions docs/Progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ complexity and effort). Complexity 0 means we wont implement it.
| *JewelMix* | 0xBC | 100% | 4 | |
| CrywolfGroup | 0xBD | 0% | 10 | |
| GuildAssignStatus | 0xBE | 0% | 1 | |
| IllusionTempleGroup | 0xBF | 100% | 10 | Team-based PvP mini game: relic pickup/delivery, scoring, skill points, special skills, rewards |
| FriendListRequest | 0xC0 | 0% | 0 | Not needed, friend list is sent automatically |
| *FriendAdd* | 0xC1 | 100% | 2 | |
| *WaitFriendAdd* | 0xC2 | 100% | 2 | |
Expand Down
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/MiniGameDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ public partial class MiniGameDefinition
/// </summary>
public int MaximumPlayerCount { get; set; }

/// <summary>
/// Gets or sets the minimum player count which is required for the game to start, and below which
/// a running game is aborted early. A value of <c>0</c> means the game type's built-in default applies.
/// </summary>
public int MinimumPlayerCount { get; set; }

/// <summary>
/// Gets or sets a value indicating whether to save the score as <see cref="MUnique.OpenMU.DataModel.Statistics.MiniGameRankingEntry"/>.
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions src/GameLogic/GameContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ public async ValueTask<MiniGameContext> GetMiniGameAsync(MiniGameDefinition mini
case MiniGameType.BloodCastle:
miniGameContext = new BloodCastleContext(miniGameKey, miniGameDefinition, this, this._mapInitializer);
break;
case MiniGameType.IllusionTemple:
miniGameContext = new IllusionTempleContext(miniGameKey, miniGameDefinition, this, this._mapInitializer);
break;
default:
miniGameContext = new MiniGameContext(miniGameKey, miniGameDefinition, this, this._mapInitializer);
break;
Expand Down
50 changes: 50 additions & 0 deletions src/GameLogic/MiniGames/IIllusionTempleEventStateViewPlugIn.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// <copyright file="IIllusionTempleEventStateViewPlugIn.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>

namespace MUnique.OpenMU.GameLogic.MiniGames;

using MUnique.OpenMU.GameLogic.Views;

/// <summary>
/// The state of an illusion temple event, as far as the game client is concerned.
/// </summary>
public enum IllusionTempleEventStatus
{
/// <summary>
/// The player entered the event and waits for it to start. In contrast to the other states, this
/// one is only told to the entering player, not to all participants.
/// </summary>
WaitingRoom = 0,

/// <summary>
/// The preparation started: the players have been moved into the arena and assigned to their teams.
/// The client opens the event interface with the score board, the timer and the mini map.
/// </summary>
Preparation = 1,

/// <summary>
/// The battle started: the statues are up and the barriers of the arena are removed, so that the
/// players can reach the cursed statue. The barrier areas are hardcoded at client side, so this is
/// the only way for the server to open them.
/// </summary>
BattleStarted = 2,

/// <summary>
/// The battle ended - the client closes the event interface.
/// </summary>
Ended = 3,
}

/// <summary>
/// Interface of a view whose implementation informs about the state of an illusion temple event.
/// </summary>
public interface IIllusionTempleEventStateViewPlugIn : IViewPlugIn
{
/// <summary>
/// Changes the state of the illusion temple event at the client.
/// </summary>
/// <param name="templeNumber">The number of the temple, from 1 to 6.</param>
/// <param name="state">The new state of the event.</param>
ValueTask ChangeEventStateAsync(byte templeNumber, IllusionTempleEventStatus state);
}
21 changes: 21 additions & 0 deletions src/GameLogic/MiniGames/IIllusionTempleHolyItemRelicsViewPlugIn.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// <copyright file="IIllusionTempleHolyItemRelicsViewPlugIn.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>

namespace MUnique.OpenMU.GameLogic.MiniGames;

using MUnique.OpenMU.GameLogic.Views;

/// <summary>
/// Interface of a view whose implementation announces the player who just picked up the holy relic of
/// an illusion temple event.
/// </summary>
public interface IIllusionTempleHolyItemRelicsViewPlugIn : IViewPlugIn
{
/// <summary>
/// Announces the player who just picked up the holy relic.
/// </summary>
/// <param name="playerId">The id of the player who picked up the relic.</param>
/// <param name="playerName">The name of the player who picked up the relic.</param>
ValueTask ShowHolyItemRelicsAsync(ushort playerId, string playerName);
}
21 changes: 21 additions & 0 deletions src/GameLogic/MiniGames/IIllusionTempleScoreTableViewPlugIn.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// <copyright file="IIllusionTempleScoreTableViewPlugIn.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>

namespace MUnique.OpenMU.GameLogic.MiniGames;

using MUnique.OpenMU.GameLogic.Views;

/// <summary>
/// Interface of a view whose implementation informs about the result of an illusion temple event.
/// </summary>
public interface IIllusionTempleScoreTableViewPlugIn : IViewPlugIn
{
/// <summary>
/// Shows the result of the finished event to the player.
/// </summary>
/// <param name="alliedForcesPoints">The points which the allied forces scored.</param>
/// <param name="illusionForcesPoints">The points which the illusion forces scored.</param>
/// <param name="results">The result of each participant.</param>
ValueTask ShowScoreTableAsync(byte alliedForcesPoints, byte illusionForcesPoints, IReadOnlyCollection<(string Name, byte MapNumber, IllusionTempleTeam Team, byte CharacterClass, int AddedExperience)> results);
}
21 changes: 21 additions & 0 deletions src/GameLogic/MiniGames/IIllusionTempleSkillEndedViewPlugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// <copyright file="IIllusionTempleSkillEndedViewPlugin.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>

namespace MUnique.OpenMU.GameLogic.MiniGames;

using MUnique.OpenMU.GameLogic.Views;

/// <summary>
/// Interface of a view whose implementation informs about a special illusion temple skill (210 to 213)
/// wearing off on an object.
/// </summary>
public interface IIllusionTempleSkillEndedViewPlugin : IViewPlugIn
{
/// <summary>
/// Announces that a skill's effect has ended on an object.
/// </summary>
/// <param name="skillNumber">The number of the skill (210 to 213).</param>
/// <param name="objectId">The id of the affected object.</param>
ValueTask ShowSkillEndedAsync(ushort skillNumber, ushort objectId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// <copyright file="IIllusionTempleSkillPointUpdateViewPlugin.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>

namespace MUnique.OpenMU.GameLogic.MiniGames;

using MUnique.OpenMU.GameLogic.Views;

/// <summary>
/// Interface of a view whose implementation informs a player about his current skill point balance
/// during a running illusion temple event.
/// </summary>
public interface IIllusionTempleSkillPointUpdateViewPlugin : IViewPlugIn
{
/// <summary>
/// Updates the skill points of the receiving player.
/// </summary>
/// <param name="skillPoints">The current skill point balance.</param>
ValueTask UpdateSkillPointsAsync(byte skillPoints);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// <copyright file="IIllusionTempleSkillUsageResultViewPlugin.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>

namespace MUnique.OpenMU.GameLogic.MiniGames;

using MUnique.OpenMU.GameLogic.Views;

/// <summary>
/// Interface of a view whose implementation informs a player about the result of a special illusion
/// temple skill (210 to 213) he requested to use.
/// </summary>
public interface IIllusionTempleSkillUsageResultViewPlugin : IViewPlugIn
{
/// <summary>
/// Shows the result of a requested illusion temple skill.
/// </summary>
/// <param name="success">Whether the skill was used successfully.</param>
/// <param name="skillNumber">The number of the skill (210 to 213).</param>
/// <param name="sourceId">The id of the player who used the skill.</param>
/// <param name="targetId">The id of the target, or <c>0</c> if the skill didn't target anyone.</param>
ValueTask ShowSkillUsageResultAsync(bool success, ushort skillNumber, ushort sourceId, ushort targetId);
}
38 changes: 38 additions & 0 deletions src/GameLogic/MiniGames/IIllusionTempleStateViewPlugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// <copyright file="IIllusionTempleStateViewPlugin.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>

namespace MUnique.OpenMU.GameLogic.MiniGames;

using MUnique.OpenMU.GameLogic.Views;

/// <summary>
/// Interface of a view whose implementation informs about the state of a running illusion temple event.
/// </summary>
/// <remarks>
/// In contrast to the other mini games, this update is not the same for all participants: it tells the
/// receiver which team he belongs to, and where his own team mates currently are - so it has to be
/// built per player.
/// </remarks>
public interface IIllusionTempleStateViewPlugin : IViewPlugIn
{
/// <summary>
/// Updates the state of the illusion temple event.
/// </summary>
/// <param name="remainingTime">The remaining time of the event.</param>
/// <param name="alliedForcesPoints">The points which the allied forces scored so far.</param>
/// <param name="illusionForcesPoints">The points which the illusion forces scored so far.</param>
/// <param name="ownTeam">The team of the player who receives the update.</param>
/// <param name="teamMembers">The team mates of the receiving player, with their current position.</param>
/// <param name="relicCarrier">
/// The player who currently carries the holy relic, with his current position - or <c>null</c> if
/// nobody currently carries it.
/// </param>
ValueTask UpdateStateAsync(
TimeSpan remainingTime,
byte alliedForcesPoints,
byte illusionForcesPoints,
IllusionTempleTeam ownTeam,
IReadOnlyCollection<(ushort PlayerId, byte MapNumber, byte PositionX, byte PositionY)> teamMembers,
(ushort PlayerId, byte PositionX, byte PositionY)? relicCarrier);
}
19 changes: 19 additions & 0 deletions src/GameLogic/MiniGames/IShowIllusionTempleUserCountViewPlugIn.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// <copyright file="IShowIllusionTempleUserCountViewPlugIn.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>

namespace MUnique.OpenMU.GameLogic.MiniGames;

using MUnique.OpenMU.GameLogic.Views;

/// <summary>
/// Interface for view plugins which show how many players are currently in each illusion temple.
/// </summary>
public interface IShowIllusionTempleUserCountViewPlugIn : IViewPlugIn
{
/// <summary>
/// Shows how many players are currently in each of the six illusion temples.
/// </summary>
/// <param name="userCounts">The player counts, indexed by temple (index 0 is temple 1).</param>
ValueTask ShowUserCountAsync(IReadOnlyList<int> userCounts);
}
Loading