By completing this guide, you should be able to trigger PvP kills to function and build your own custom systems.
Stored Procedure: _OnCharKillPvP
Parameters:
@CharID INT - Killer character ID
@CharName16 VARCHAR(64) - Killer character name
@PvPType TINYINT - Killer PvP type
@DeadCharID INT - Dead character ID
@DeadCharName16 VARCHAR(64) - Dead character name
@DeadPvPType TINYINT - Dead PvP type
@WorldID SMALLINT - Game world ID
@RegionID SMALLINT - Region ID
Let's send a global game notification using the _Command_Global_SendTextNotification command to ensure that the trigger works fine for us.
USE [vPlus]
GO
/****** Object: StoredProcedure [dbo].[_OnCharKillPvP] Script Date: 1/9/2024 5:07:28 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[_OnCharKillPvP]
@CharID INT,
@CharName16 VARCHAR(64),
@PvPType TINYINT,
@DeadCharID INT,
@DeadCharName16 VARCHAR(64),
@DeadPvPType TINYINT,
@WorldID SMALLINT,
@RegionID SMALLINT
AS
BEGIN
SET NOCOUNT ON;
/*
This procedure is executed whenever a character
kills another character in PvP mode.
*/
--------- Your code starts here --------
-- Declaring our message variable
DECLARE @Message VARCHAR(255) = @CharName16 + ' has killed ' + @DeadCharName16 + ' in PvP Mode!';
-- Executing the command
EXEC _Command_Global_SendTextNotification @Message, 1, 0, 0;
END