Cookies


Vsroplus only uses the cookies it needs to keep you signed in and remember your language. No ads, no tracking.

Got it

Need to learn more? Privacy policy

Our guides are in English for now.

Kill

By completing this guide, you should be able to trigger team kills of a specific region and build your own custom systems.

Stored Procedure: _OnBattleLogTeamKill
Parameters:

@GroupID INT - Group ID
@CharID INT - Killer character ID
@CharName16 VARCHAR(64) - Killer character name
@TeamType TINYINT - Killer character PvP cape color type
@DeadCharID INT - Dead character ID
@DeadCharName16 VARCHAR(64) - Dead character name
@DeadTeamType TINYINT - Dead character PvP cape color type

Let's add a kill score to the team counter using _BattleLogTeam_AddKill and send a global text notification using _Command_Global_SendTextNotification to ensure that the trigger works fine for us.

USE [vPlus]
GO

/****** Object: StoredProcedure [dbo].[_OnBattleLogTeamKill] ******/

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:      <Author,,Name>
-- ALTER date:  <ALTER Date,,>
-- Description: <Description,,>
-- =============================================

ALTER PROCEDURE [dbo].[_OnBattleLogTeamKill]
    @GroupID INT,
    @CharID INT,
    @CharName16 VARCHAR(64),
    @TeamType TINYINT,
    @DeadCharID INT,
    @DeadCharName16 VARCHAR(64),
    @DeadTeamType TINYINT
AS
BEGIN
    SET NOCOUNT ON;

    /*
        This procedure is executed when a character kills another
        character in a specific team counter region.

        This procedure is only executed when the TriggerKills option
        is enabled in the _RefBattleLogTeamGroup table.

        You may add your own kill restrictions here and return before
        _BattleLogTeam_AddKill is executed to prevent counting the kill.
    */

    --------- Your code starts here --------

    EXEC _BattleLogTeam_AddKill @GroupID, @TeamType, @CharName16, 1;

    DECLARE @Message VARCHAR(255) = @CharName16 + ' has killed ' + @DeadCharName16;

    EXEC _Command_Global_SendTextNotification @Message, 1, 0, 1;
END

The team kill will be added to the selected team counter group, and a global notification will be sent when the trigger is executed.

Last updated: 8 April, 2024

An error has occurred. This application may no longer respond until reloaded. Reload 🗙