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.

Teleport Request

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

Stored Procedure: _OnTeleportRequest
Parameters:

@RefObjectID INT - Object ID
@RefObjectCodeName128 VARCHAR(129) - Object CodeName128
@TeleportID INT - Teleport ID
@TeleportCodeName128 VARCHAR(129) - Teleport CodeName128
@CharID INT - Character ID
@CharName16 VARCHAR(64) - Character name
@BadRequest BIT - Bad request

0 - Normal client
1 - Using bot

Let's block the character from teleporting to Jangan town and send a text notification using _Char_SendTextNotification to ensure that the trigger works fine for us.

USE [vPlus]
GO

/****** Object: StoredProcedure [dbo].[_OnTeleportRequest] Script Date: 1/18/2024 12:01:51 PM ******/

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

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

ALTER PROCEDURE [dbo].[_OnTeleportRequest]
    @RefObjectID INT,
    @RefObjectCodeName128 VARCHAR(129),
    @TeleportID INT,
    @TeleportCodeName128 VARCHAR(129),
    @CharID INT,
    @CharName16 VARCHAR(64),
    @BadRequest BIT -- Tells if the request is made by bot or real client
AS
BEGIN
    SET NOCOUNT ON;

    /*
        This procedure is executed when the teleport ID is added
        to the _RefTeleport table and TriggerRequest equals 1.

        This procedure is executed when the player requests to teleport
        through a teleport object or NPC.

        @RefObjectID: Teleport object / NPC ID from SRO_VT_SHARD.dbo._RefObjCommon
        @RefObjectCodeName128: Teleport object / NPC CodeName128 from SRO_VT_SHARD.dbo._RefObjCommon
        @TeleportID: Destination teleport ID from SRO_VT_SHARD.dbo._RefTeleport
        @TeleportCodeName128: Destination teleport CodeName128 from SRO_VT_SHARD.dbo._RefTeleport
        @CharID: Character ID
        @CharName16: Character name
        @BadRequest: Tells if the request is made by bot or real client
    */

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

    -- Checking the teleport ID
    IF (@TeleportID = 1)
    BEGIN
        EXEC _Char_SendTextNotification @CharID, 'Teleporting to Jangan town is currently disabled!', 1, 0, 0;

        RETURN 0; -- Block the character from teleporting
    END

    -- RETURN 0; -- Cancel the request
    RETURN 1; -- Create the request
END

Last updated: 18 January, 2024

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