From b5a4042db2129009f640f20f95be242beaabb100 Mon Sep 17 00:00:00 2001 From: Benito Go III Date: Tue, 10 Dec 2024 04:16:22 +0800 Subject: [PATCH] Fixed nova skill not activating --- src/GameLogic/PlayerActions/Skills/NovaSkillStartPlugin.cs | 6 ++++-- src/GameServer/MessageHandler/TargetedSkillHandlerPlugIn.cs | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/GameLogic/PlayerActions/Skills/NovaSkillStartPlugin.cs b/src/GameLogic/PlayerActions/Skills/NovaSkillStartPlugin.cs index 37085fd16..5a4d5f833 100644 --- a/src/GameLogic/PlayerActions/Skills/NovaSkillStartPlugin.cs +++ b/src/GameLogic/PlayerActions/Skills/NovaSkillStartPlugin.cs @@ -19,6 +19,8 @@ namespace MUnique.OpenMU.GameLogic.PlayerActions.Skills; [Guid("e966e7eb-58b8-4356-8725-5da9f43c1fa4")] public class NovaSkillStartPlugin : TargetedSkillPluginBase { + private const ushort NovaEndSkillId = 40; + private static readonly TimeSpan NovaStepDelay = TimeSpan.FromMilliseconds(500); /// @@ -38,7 +40,7 @@ public override async ValueTask PerformSkillAsync(Player player, IAttackable tar return; } - var skillEntry = player.SkillList?.GetSkill(skillId); + var skillEntry = player.SkillList?.GetSkill(NovaEndSkillId); if (skillEntry?.Skill is null) { return; @@ -55,7 +57,7 @@ public override async ValueTask PerformSkillAsync(Player player, IAttackable tar var cancellationTokenSource = new SkillCancellationTokenSource(); player.SkillCancelTokenSource = cancellationTokenSource; - _ = this.RunNovaAsync(player, skillEntry, cancellationTokenSource); + _ = Task.Run(() => this.RunNovaAsync(player, skillEntry, cancellationTokenSource)); } private async ValueTask RunNovaAsync(Player player, SkillEntry skillEntry, SkillCancellationTokenSource cancellationTokenSource) diff --git a/src/GameServer/MessageHandler/TargetedSkillHandlerPlugIn.cs b/src/GameServer/MessageHandler/TargetedSkillHandlerPlugIn.cs index f2a9c864b..4cba3175d 100644 --- a/src/GameServer/MessageHandler/TargetedSkillHandlerPlugIn.cs +++ b/src/GameServer/MessageHandler/TargetedSkillHandlerPlugIn.cs @@ -45,11 +45,6 @@ public virtual async ValueTask HandlePacketAsync(Player player, Memory pac /// The target identifier. protected async ValueTask HandleAsync(Player player, ushort skillId, ushort targetId) { - if (player.SkillList is null || !player.SkillList.ContainsSkill(skillId)) - { - return; - } - var strategy = player.GameContext. PlugInManager.GetStrategy((short)skillId) ?? this._defaultStrategy;