By completing this guide, you should be able to trigger Battle Arena event register success and build your own custom systems.
Stored Procedure: _OnBattleArenaRegisterSuccess
Parameters:
@CharID INT - Character ID
@CharName16 VARCHAR(64) - Character name
@ArenaType TINYINT - Battle Arena type
@MatchType TINYINT - Battle Arena match type
@IsRegister BIT - Determines whether the character registered or deregistered
Let's send a text notification to the character using _Char_SendTextNotification to ensure that the trigger works fine for us.
USE [vPlus]
GO
/****** Object: StoredProcedure [dbo].[_OnBattleArenaRegisterSuccess] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[_OnBattleArenaRegisterSuccess]
@CharID INT,
@CharName16 VARCHAR(64),
@ArenaType TINYINT,
@MatchType TINYINT,
@IsRegister BIT
AS
BEGIN
SET NOCOUNT ON;
/*
This procedure is executed when a character successfully
registers or deregisters from the Battle Arena event.
@ArenaType:
0 = Random
1 = Party
2 = Guild
3 = Job
@MatchType:
1 = Score
2 = Capture the Flag
@IsRegister:
1 = Registered
0 = Deregistered
*/
--------- Your code starts here --------
IF (@IsRegister = 1)
BEGIN
EXEC _Char_SendTextNotification @CharID, 'You have successfully registered for the Battle Arena event.', 1, 0, 0;
RETURN;
END
EXEC _Char_SendTextNotification @CharID, 'You have successfully deregistered from the Battle Arena event.', 1, 0, 0;
END