Skip to content

Commit

Permalink
Fixed nova skill not activating
Browse files Browse the repository at this point in the history
  • Loading branch information
nitoygo committed Dec 9, 2024
1 parent 9442bf1 commit b5a4042
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/GameLogic/PlayerActions/Skills/NovaSkillStartPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/// <summary>
Expand All @@ -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;
Expand All @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions src/GameServer/MessageHandler/TargetedSkillHandlerPlugIn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ public virtual async ValueTask HandlePacketAsync(Player player, Memory<byte> pac
/// <param name="targetId">The target identifier.</param>
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, ITargetedSkillPlugin>((short)skillId) ??
this._defaultStrategy;
Expand Down

0 comments on commit b5a4042

Please sign in to comment.