Cookies


Vsroplus only uses the cookies it needs to keep you signed in and remember your language. No ads, no tracking.

Got it

Need to learn more? Privacy policy

Our guides are in English for now.

Receive

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

Last updated: 18 January, 2024

An error has occurred. This application may no longer respond until reloaded. Reload 🗙