Stored Procedure: _OnAcademyInviteRequest
Parameters:
@CharID INT- Inviter character ID@TargetCharName VARCHAR(64)- Target character name
In this example, we will block sending an academy invitation to a specific character and send a notification to the inviter using
_Char_SendTextNotification to make sure that the trigger works correctly.
USE [vPlus]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[_OnAcademyInviteRequest]
@CharID INT,
@TargetCharName VARCHAR(64)
AS
BEGIN
SET NOCOUNT ON;
/*
This procedure is executed when a player sends an academy invitation request.
@CharID = Inviter character
@TargetCharName = Target character
*/
--------- Your code starts here --------
IF (@TargetCharName = 'target_character_name')
BEGIN
EXEC _Char_SendTextNotification @CharID, 'This character cannot be invited to the academy.', 1, 0, 0
RETURN 0 -- Block invitation
END
RETURN 1
END