By completing this guide, you should be able to trigger successful character job league joins to function and build your own custom systems.
Stored Procedure: _OnJobJoinSuccess
Parameters:
@CharID INT - Character ID
@CharName16 VARCHAR(64) - Character name
@JobType TINYINT - Job type
Let's send a text notification message for a specific character when joining the merchant job league is successful using _Char_SendTextNotification to ensure that the trigger works fine for us.
USE [vPlus]
GO
/****** Object: StoredProcedure [dbo].[_OnJobJoinSuccess] Script Date: 1/11/2024 2:43:24 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[_OnJobJoinSuccess]
@CharID INT,
@CharName16 VARCHAR(64),
@JobType TINYINT
AS
BEGIN
SET NOCOUNT ON;
/*
This procedure is executed when a player
successfully joins a job league.
*/
-- This code is a part of the guard's default job ranking.
INSERT INTO _RankingJobPoints
VALUES (@CharID, @JobType, 0, GETDATE());
--------- 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, 'Welcome to the merchant league!', 1, 0, 0;
END
END