Display strings/messages/designations changed everywhere (Name, entrance messages, NPC designation, HUD title). Code identifiers/namespaces/commands unchanged. DB rows updated separately.
55 lines
1.9 KiB
C#
55 lines
1.9 KiB
C#
// <copyright file="HeykelSavasiNpcPlugin.cs" company="MUnique">
|
|
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
|
// </copyright>
|
|
|
|
namespace MUnique.OpenMU.GameLogic.PlugIns;
|
|
|
|
using System.Runtime.InteropServices;
|
|
using MUnique.OpenMU.GameLogic.MiniGames;
|
|
using MUnique.OpenMU.GameLogic.NPC;
|
|
using MUnique.OpenMU.GameLogic.Views;
|
|
using MUnique.OpenMU.GameLogic.Views.MiniGames;
|
|
using MUnique.OpenMU.Interfaces;
|
|
using MUnique.OpenMU.PlugIns;
|
|
|
|
/// <summary>
|
|
/// Handles talking to the TvT Event (statue war) NPC (number 560): opens the team-select
|
|
/// panel while the event's registration is open.
|
|
/// </summary>
|
|
[Guid("80E3B326-474F-45AC-9FA4-3464801AE079")]
|
|
[PlugIn]
|
|
public class HeykelSavasiNpcPlugin : IPlayerTalkToNpcPlugIn
|
|
{
|
|
/// <summary>
|
|
/// Gets the NPC number of the TvT Event event NPC.
|
|
/// </summary>
|
|
public static short NpcNumber => 560;
|
|
|
|
/// <inheritdoc />
|
|
public async ValueTask PlayerTalksToNpcAsync(Player player, NonPlayerCharacter npc, NpcTalkEventArgs eventArgs)
|
|
{
|
|
if (npc.Definition.Number != NpcNumber)
|
|
{
|
|
return;
|
|
}
|
|
|
|
eventArgs.HasBeenHandled = true;
|
|
eventArgs.LeavesDialogOpen = false;
|
|
|
|
var context = player.GameContext is GameContext gameContext
|
|
? await gameContext.GetOpenHeykelSavasiAsync().ConfigureAwait(false)
|
|
: null;
|
|
if (context is null)
|
|
{
|
|
await player.InvokeViewPlugInAsync<IShowMessagePlugIn>(p =>
|
|
p.ShowMessageAsync("TvT Event su an acik degil.", MessageType.BlueNormal)).ConfigureAwait(false);
|
|
return;
|
|
}
|
|
|
|
var red = context.TeamCount(HeykelSavasiTeam.Red);
|
|
var blue = context.TeamCount(HeykelSavasiTeam.Blue);
|
|
await player.InvokeViewPlugInAsync<IShowHeykelSavasiTeamPanelPlugIn>(p =>
|
|
p.ShowTeamPanelAsync(red, blue)).ConfigureAwait(false);
|
|
}
|
|
}
|