/// <inheritdoc /> public void HandlePacket(Player player, Span <byte> packet) { QuestProceedRequest request = packet; var questGroup = (short)request.QuestGroup; var questNumber = (short)request.QuestNumber; var questState = player.GetQuestState(questGroup, questNumber); if (request.ProceedAction == QuestProceedRequest.QuestProceedAction.AcceptQuest) { if (questState != null) { // keep it running and confirm that it started player.ViewPlugIns.GetPlugIn <IQuestStartedPlugIn>()?.QuestStarted(questState.ActiveQuest); } else { this.questStartAction.StartQuest(player, (short)request.QuestGroup, (short)request.QuestNumber); } } else { // Refused if (player.OpenedNpc?.Definition.Quests .FirstOrDefault(q => q.Group == questGroup && q.StartingNumber == questNumber) is { } quest) { player.ViewPlugIns.GetPlugIn <IQuestStepInfoPlugIn>()?.ShowQuestStepInfo(quest.Group, quest.RefuseNumber); } } }
/// <inheritdoc /> public void HandlePacket(Player player, Span <byte> packet) { QuestProceedRequest request = packet; var questState = player.GetQuestState((short)request.QuestGroup, (short)request.QuestNumber); if (request.ProceedAction == QuestProceedRequest.QuestProceedAction.AcceptQuest) { if (request.ProceedAction == QuestProceedRequest.QuestProceedAction.AcceptQuest && questState != null) { player.ViewPlugIns.GetPlugIn <IQuestProgressPlugIn>() ?.ShowQuestProgress(questState.ActiveQuest, true); } if (questState != null) { // keep it running and confirm that it started player.ViewPlugIns.GetPlugIn <IQuestStartedPlugIn>()?.QuestStarted(questState.ActiveQuest); } else { this.questStartAction.StartQuest(player, (short)request.QuestNumber, (short)request.QuestNumber); } } else { this.questCancelAction.CancelQuest(player, (short)request.QuestGroup, (short)request.QuestNumber); } }