Stored Procedure: _OnAlchemyFuseFail
Parameters:
@CharID INT- Character ID@CharName16 VARCHAR(64)- Character name@Slot TINYINT- Slot ID@RefItemID INT- Item ID@FailType TINYINT- Fail type
0 = Item still exists
1 = Item destroyed
@CurrentOptLevel TINYINT- Current item plus value
Let us send a text notification using _Char_SendTextNotification to make sure that the trigger works correctly.
USE [vPlus]
GO
/****** Object: StoredProcedure [dbo].[_OnAlchemyFuseFail] Script Date: 1/18/2024 6:28:27 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- ALTER date: <ALTER Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[_OnAlchemyFuseFail]
@CharID INT,
@CharName16 VARCHAR(64),
@Slot TINYINT,
@RefItemID INT,
@FailType TINYINT,
@CurrentOptLevel TINYINT
AS
BEGIN
SET NOCOUNT ON;
/*
This procedure is executed when the player fuses an item and the fuse fails.
@FailType:
0 = Normal failure, item still exists
1 = Item destroyed
*/
--------- Your code starts here --------
IF (@FailType = 0)
EXEC _Char_SendTextNotification @CharID, 'You have failed to fuse your item.', 1, 0, 0
IF (@FailType = 1)
EXEC _Char_SendTextNotification @CharID, 'Your item has been destroyed.', 1, 0, 0
END