Stored Procedure: _OnAlchemyFuseRequest
Parameters:
@CharID INT- Character ID@CharName16 VARCHAR(64)- Character name@Slot TINYINT- Slot ID@RefItemID INT- Item ID@CurrentOptLevel TINYINT- Current item plus value
Let us block fusing items over +5 and send a text notification using
_Char_SendTextNotification
to make sure that the trigger works correctly.
USE [vPlus]
GO
/****** Object: StoredProcedure [dbo].[_OnAlchemyFuseRequest] Script Date: 1/18/2024 12:18:02 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- ALTER date: <ALTER Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[_OnAlchemyFuseRequest]
@CharID INT,
@CharName16 VARCHAR(64),
@Slot TINYINT,
@RefItemID INT,
@CurrentOptLevel TINYINT
AS
BEGIN
SET NOCOUNT ON;
/*
This procedure is executed when the player tries to fuse an item with elixirs and/or powder.
You can cancel the request by returning 0.
*/
--------- Your code starts here --------
-- Checking the current item plus value
IF (@CurrentOptLevel >= 5)
BEGIN
EXEC _Char_SendTextNotification @CharID, 'You have reached the maximum plus limit for this item!', 1, 0, 0
RETURN 0 -- Blocking the character from fusing
END
RETURN 1 -- Valid request
END