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.

COS Cart Sell Success

By completing this guide, you should be able to trigger job item sell success to function and build your own custom systems.

Stored Procedure: _OnCOSCartSellSuccess
Parameters:

@NPCID INT - NPC ID
@NPCCodeName128 VARCHAR(129) - NPC CodeName128
@CharID INT - Character ID
@CosID INT - Trade pet ID
@Slot TINYINT - Slot number
@RefItemID INT - Item ID
@RefItemCodeName128 VARCHAR(129) - Item CodeName128
@Quantity SMALLINT - Quantity of items

Let's count the amount of sold items and 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].[_OnCOSCartSellSuccess] Script Date: 1/11/2024 3:45:16 AM ******/

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

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

ALTER PROCEDURE [dbo].[_OnCOSCartSellSuccess]
    @NPCID INT,
    @NPCCodeName128 VARCHAR(129),
    @CharID INT,
    @CosID INT,
    @Slot TINYINT,
    @RefItemID INT,
    @RefItemCodeName128 VARCHAR(129),
    @Quantity SMALLINT
AS
BEGIN
    SET NOCOUNT ON;

    /*
        This procedure is executed whenever a character
        successfully sells job items from a trade pet.
    */

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

    -- Declaring a message to be sent to the character
    DECLARE @Message VARCHAR(255) = 'You sold ' + CAST(@Quantity AS NVARCHAR) + ' items.';

    -- Sending the message to the character
    EXEC _Char_SendTextNotification @CharID, @Message, 1, 0, 0;
END

Last updated: 11 January, 2024

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