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.

Unique Death

By completing this guide, you should be able to trigger unique kills to function and build your own custom systems.

Stored Procedure: _Logger_UniqueDeath
Parameters:

@CharID INT - Killer character ID
@CharName16 VARCHAR(64) - Killer character name
@RefUniqueID INT - Unique ID

Let's send a global text notification using _Command_Global_SendTextNotification to ensure that the trigger works fine for us.

USE [vPlus]
GO

/****** Object: StoredProcedure [dbo].[_Logger_UniqueDeath] Script Date: 1/18/2024 9:56:30 AM ******/

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

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

ALTER PROCEDURE [dbo].[_Logger_UniqueDeath]
    @CharID INT,
    @CharName16 VARCHAR(64), -- Note: This might be NickName16 if the character killed the unique in job mode
    @RefUniqueID INT
AS
BEGIN
    SET NOCOUNT ON;

    /*
        This procedure is executed whenever a unique monster dies.
    */

    DECLARE @RankPoints INT = (
        SELECT Points
        FROM _RefRankingUniquePoints
        WHERE RefUniqueID = @RefUniqueID
    );

    IF (@RankPoints > 0)
    BEGIN
        UPDATE _RankingUniquePoints
        SET TotalKills += 1,
            TotalPoints += @RankPoints,
            LastUpdate = GETDATE()
        WHERE CharID = @CharID;

        IF (@@ROWCOUNT = 0)
        BEGIN
            INSERT INTO _RankingUniquePoints
            VALUES (@CharID, 1, @RankPoints, GETDATE());
        END
    END

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

    DECLARE @RefUniqueCodeName128 VARCHAR(128) = (
        SELECT CodeName128
        FROM SRO_VT_SHARD.dbo._RefObjCommon
        WHERE ID = @RefUniqueID
    );

    IF (@RefUniqueCodeName128 = 'MOB_CH_TIGERWOMAN')
    BEGIN
        DECLARE @Message VARCHAR(255) = @CharName16 + ' has killed Tiger Girl in Tiger Mountain';

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

Last updated: 18 January, 2024

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