Stored Procedure: _OnPartyFormCreateRequest
Parameters:
@CharID INT- Character ID@CharName16 VARCHAR(64)- Character name@Setting TINYINT- Party settings
0 = Item free for all, EXP free for all, only master can invite
1 = Item free for all, EXP auto share, only master can invite
2 = Item auto share, EXP free for all, only master can invite
3 = Item auto share, EXP auto share, only master can invite
4 = Item free for all, EXP free for all, other players can invite
5 = Item free for all, EXP auto share, other players can invite
6 = Item auto share, EXP free for all, other players can invite
7 = Item auto share, EXP auto share, other players can invite
@Purpose TINYINT- Party purpose
0 = Normal hunting
1 = Quest
2 = Trader/Hunter party
3 = Thief party
@MinLevel TINYINT- Party minimum level@MaxLevel TINYINT- Party maximum level@Title VARCHAR(64)- Party title
Let us block creating a party unless the option players can invite without master status is enabled, then send a text notification using
_Char_SendTextNotification
to make sure that the trigger works correctly.
USE [vPlus]
GO
/****** Object: StoredProcedure [dbo].[_OnPartyFormCreateRequest] Script Date: 1/18/2024 6:44:44 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[_OnPartyFormCreateRequest]
@CharID INT,
@CharName16 VARCHAR(64),
@Setting TINYINT,
@Purpose TINYINT,
@MinLevel TINYINT,
@MaxLevel TINYINT,
@Title VARCHAR(64)
AS
BEGIN
SET NOCOUNT ON;
/*
This procedure is executed when a player tries to create a party form.
You can cancel the request based on your own restrictions and send an error message.
*/
--------- Your code starts here --------
-- Checking the party settings
IF (@Setting IN (0, 1, 2, 3))
BEGIN
EXEC _Char_SendTextNotification @CharID, 'Creating a party without allowing players to invite others is disabled. Please change your party settings and try again!', 1, 0, 0
RETURN 0 -- Blocking the character from creating the party
END
RETURN 1 -- Valid request
END