CREATE PROCEDURE [dbo].[RMS_TESTING]
@GameID varchar(14),
@ItemIndex int,
@WindowKind int,
@WindowIndex int
AS
set nocount on;
/*
--这个是简单版的,时间不累加,如果时间累加版的出现什么BUG,可以使用注释里的这一段替换
DECLARE @DeleteItemError int, @UpdateError int , @SETimer varchar(20),@Time int
SET @DeleteItemError = 1
SET @UpdateError = 1
BEGIN TRANSACTION REDZL
DELETE tblSpecialItem1 WHERE ID = (select top 1 ID FROM tblSpecialItem1 WHERE ItemKind = 6 AND ItemIndex = @ItemIndex AND Position = 1 AND GameID = @GameID AND WindowKind = @WindowKind AND WindowIndex = @WindowIndex)
IF @@ROWCOUNT > 0 and @@ERROR = 0 SET @DeleteItemError = 0
SET @Time = 60 --药水魔法持续时间,单位分钟
Select @SETimer =
Case @ItemIndex
When 204 Then '3' --飞莲舞
When 205 Then '60' --御剑术
When 206 Then '42' --星星
When 207 Then '62' --无限疾奔
Else '8' End --其他为蛋
UPDATE tblGameID1 SET SETimer = SETimer + @SETimer + ':' + Cast(@Time * 60000 as varchar)+ '.' WHERE GameID = @GameID
SET @UpdateError = @@ERROR
IF @DeleteItemError = 0 AND @UpdateError = 0
BEGIN
COMMIT TRANSACTION REDZL
END
ELSE
BEGIN
ROLLBACK TRANSACTION REDZL
END
*/
DECLARE @DeleteItemError int, @UpdateError int , @mf varchar(20), @Time int
SET @DeleteItemError = 1
SET @UpdateError = 1
BEGIN TRANSACTION REDZL
DELETE tblSpecialItem1 WHERE ID = (select top 1 ID FROM tblSpecialItem1 WHERE ItemKind = 6 AND ItemIndex = @ItemIndex AND Position = 1 AND GameID = @GameID AND WindowKind = @WindowKind AND WindowIndex = @WindowIndex)
IF @@ROWCOUNT > 0 and @@ERROR = 0 SET @DeleteItemError = 0
SET @Time = 60 --药水魔法持续时间,单位分钟
Select @mf =
Case @ItemIndex
When 204 Then '3' --飞莲舞
When 205 Then '60' --御剑术
When 206 Then '42' --星星
When 207 Then '62' --无限疾奔
Else '8' End --其他为蛋
declare @SETimer varchar(1000) , @overtime int, @tmp_str varchar(500)
select @SETimer = SETimer from tblGameID1 where GameID = @GameID