Stored Procedure: _OnQuestReceiveRequest
Parameters:
@CharID INT- Character ID@CharName16 VARCHAR(64)- Character name@QuestID INT- Quest ID
Let us block the Jangan [Herb Delivery] quest receive request and send a text notification using
_Char_SendTextNotification
to make sure that the trigger works correctly.
USE [vPlus]
GO
/****** Object: StoredProcedure [dbo].[_OnQuestReceiveRequest] Script Date: 1/16/2024 2:47:26 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[_OnQuestReceiveRequest]
@CharID INT,
@CharName16 VARCHAR(64),
@QuestID INT
AS
BEGIN
SET NOCOUNT ON;
/*
You can control quest acceptance from NPCs in this procedure.
For example, you can block a quest from being accepted if the character does not meet your custom requirements.
Return Value:
0 = Cancel the quest receive request. You will have to send your own notification to the character.
1 = Proceed with the quest and allow the character to receive it.
*/
--------- Your code starts here --------
-- Checking the quest ID
IF (@QuestID = 50)
BEGIN
EXEC _Char_SendTextNotification @CharID, 'This quest is disabled at the moment! Please come back later.', 1, 0, 0
RETURN 0 -- Blocking the character from receiving the quest
END
RETURN 1 -- Valid
END