By completing this guide, you should be able to trigger character job league join requests to function and build your own custom systems.
Stored Procedure: _OnJobJoinRequest
Parameters:
@CharID INT - Character ID
@CharName16 VARCHAR(64) - Character name
@JobType TINYINT - Job type
Let's block joining the trader job league for a specific character and send a text notification using _Char_SendTextNotification to ensure that the trigger works fine for us.
USE [vPlus]
GO
/****** Object: StoredProcedure [dbo].[_OnJobJoinRequest] Script Date: 1/11/2024 2:22:54 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[_OnJobJoinRequest]
@CharID INT,
@CharName16 VARCHAR(64),
@JobType TINYINT
AS
BEGIN
SET NOCOUNT ON;
/*
This procedure is executed when a player tries
to join a job league.
You can cancel the request based on your own restrictions
and send an error message to the player.
*/
--------- Your code starts here --------
-- Checking the character name and the job league ID
IF (@JobType = 1 AND @CharName16 = 'character_name')
BEGIN
EXEC _Char_SendTextNotification @CharID, 'Joining trader job league is currently disabled for your character!', 1, 0, 0;
RETURN 0; -- Block the job league joining request
END
-- RETURN 0; -- Invalid
RETURN 1; -- Valid
END
