用 vip/现金奖励前 1 名每周重置课程


Published:   Comment: No Comments

游戏设置

用 vip/现金奖励前 1 名每周重置课程

DECLARE @DIAS int
DECLARE @FREEWCOIN int
DECLARE @VIPWCOIN int
DECLARE @MINRESET int


SET @DIAS = 7 -- Quantidade de dias vips à adicionar.
SET @FREEWCOIN = 50 -- Quantidade de Wcoin à adicionar para usuários Free.
SET @VIPWCOIN = 50 -- Quantidade de Wcoin à adicionar para usuários Vip.
SET @MINRESET = 200 -- Mínimo de Resets semanais necessário para a premiação funcionar.


BEGIN


SET NOCOUNT ON
SET XACT_ABORT ON


-- INICIO CLASSE 1 --
IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (48,49) order by ResetWek desc, ResetCount desc) AND AccountLevel = 1)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @VIPWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (48,49) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountExpireDate = AccountExpireDate + @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (48,49) order by ResetWek desc, ResetCount desc)
END


IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (48,49) order by ResetWek desc, ResetCount desc) AND AccountLevel = 0)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @FREEWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (48,49) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountLevel = 1, AccountExpireDate = GETDATE()+ @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (48,49) order by ResetWek desc, ResetCount desc)
END
-- FIM CLASSE 1 --


-- INICIO CLASSE 2 --
IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (0,1,2) order by ResetWek desc, ResetCount desc) AND AccountLevel = 1)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @VIPWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (0,1,2) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountExpireDate = AccountExpireDate + @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (0,1,2) order by ResetWek desc, ResetCount desc)
END


IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (0,1,2) order by ResetWek desc, ResetCount desc) AND AccountLevel = 0)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @FREEWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (0,1,2) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountLevel = 1, AccountExpireDate = GETDATE()+ @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (0,1,2) order by ResetWek desc, ResetCount desc)
END
-- FIM CLASSE 2 --


-- INICIO CLASSE 3 --
IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (16,17,18) order by ResetWek desc, ResetCount desc) AND AccountLevel = 1)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @VIPWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (16,17,18) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountExpireDate = AccountExpireDate + @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (16,17,18) order by ResetWek desc, ResetCount desc)
END


IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (16,17,18) order by ResetWek desc, ResetCount desc) AND AccountLevel = 0)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @FREEWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (16,17,18) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountLevel = 1, AccountExpireDate = GETDATE()+ @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (16,17,18) order by ResetWek desc, ResetCount desc)
END
-- FIM CLASSE 3 --


-- INICIO CLASSE 4 --
IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (32,33,34) order by ResetWek desc, ResetCount desc) AND AccountLevel = 1)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @VIPWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (32,33,34) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountExpireDate = AccountExpireDate + @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (32,33,34) order by ResetWek desc, ResetCount desc)
END


IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (32,33,34) order by ResetWek desc, ResetCount desc) AND AccountLevel = 0)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @FREEWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (32,33,34) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountLevel = 1, AccountExpireDate = GETDATE()+ @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (32,33,34) order by ResetWek desc, ResetCount desc)
END
-- FIM CLASSE 4 --


-- INICIO CLASSE 5 --
IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (64,65,66) order by ResetWek desc, ResetCount desc) AND AccountLevel = 1)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @VIPWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (64,65,66) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountExpireDate = AccountExpireDate + @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (64,65,66) order by ResetWek desc, ResetCount desc)
END


IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (64,65,66) order by ResetWek desc, ResetCount desc) AND AccountLevel = 0)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @FREEWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (64,65,66) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountLevel = 1, AccountExpireDate = GETDATE()+ @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (64,65,66) order by ResetWek desc, ResetCount desc)
END
-- FIM CLASSE 5 --


-- INICIO CLASSE 6 --
IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (81,82) order by ResetWek desc, ResetCount desc) AND AccountLevel = 1)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @VIPWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (81,82) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountExpireDate = AccountExpireDate + @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (81,82) order by ResetWek desc, ResetCount desc)
END


IF EXISTS (SELECT AccountLevel FROM MEMB_INFO WHERE memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (81,82) order by ResetWek desc, ResetCount desc) AND AccountLevel = 0)
BEGIN
UPDATE CashShopData set WCoinC=WCoinC + @FREEWCOIN where AccountID = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (81,82) order by ResetWek desc, ResetCount desc)
UPDATE MEMB_INFO SET AccountLevel = 1, AccountExpireDate = GETDATE()+ @DIAS where memb___id = (select top 1 accountID from character WHERE ResetWek > @MINRESET AND Class IN (81,82) order by ResetWek desc, ResetCount desc)
END
-- FIM CLASSE 6 --






SET NOCOUNT OFF
SET XACT_ABORT OFF


END
none
Last Modified:2024-09-29 22:41:36

我有话说