|
USE [SRO_VT_SHARDLOG] GO /****** Object: StoredProcedure [dbo].[_MurdererAutoBanned] Script Date: 02/11/2015 23:02:18 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
---> Full System Coded by iLegend ---> Facebook : https://www.facebook.com/designer.ramy.saied
CREATE PROCEDURE [dbo].[_MurdererAutoBanned] @CharID INT AS
-- Start Auto PK Punishment system -- Declare @CharName Varchar (128) = (Select CharName16 From [SRO_VT_SHARD].[dbo].[_Char] Where CharID = @CharID) Declare @UserJID INT = (Select UserJID From [SRO_VT_SHARD].[dbo].[_User] Where CharID = @CharID) Declare @Now DateTime = GETDATE() Declare @EndTime DateTime Declare @SystemStartTime DateTime = '2015-02-10 00:00:00.000' Declare @MurderTimes INT = (Select MurderTimes From [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Where CharID = @CharID) Declare @BlockTimes INT = (Select BlockTimes From [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Where CharID = @CharID) Declare @LastWarning INT = (Select Warned From [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Where CharID = @CharID) Declare @WarningCharName Varchar (128) , @Message Varchar(max) Set @WarningCharName = 'Write Here Character Name to Send Warning Msg from it' -- Write here Warning char name. Set @Message = 'Hey you! PK is not allowed at our server, who do it get a penalties : 1- First time of pk, just warning and remind for our rules. 2- If u do it again, you will punished directly for 3 days, second time by 7 days, then 15 days, then 1 month, then 1 year, then for ever.'
-- Step 1 : add +1 to murder times of character name in _LogMurder Update [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Set MurderTimes = @MurderTimes +1 Where CharID = @CharID
-- Step 2 : Check murder times after first step and give punishment. Declare @LastMurderTimes INT = (Select MurderTimes From [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Where CharID = @CharID)
-- Case 1 : IF murder times = 1 -- Warning the player by Send Msg. IF @LastMurderTimes = 1 Begin Update [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Set Warned = (@LastWarning +1) Where CharID = @CharID Execute [SRO_VT_SHARD].[dbo].[_Memo_Add] @CharName,@WarningCharName,@Message,20 End
-- Case 2 : IF murder times = 2 -- Block 3 day IF @LastMurderTimes = 2 Begin Set @EndTime = DATEADD (D,3, GETDATE()) Execute [SRO_VT_ACCOUNT].[dbo].[_RegisterPunishment] @UserJID,1,'iLegend',64,@CharName,'Murderer',1,'Auto Punishment Murder System','Auto Punishment Murder System',@SystemStartTime,@Now,@EndTime,@Now Update [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Set BlockTimes = (@BlockTimes +1) , LastBlockDateStart = @Now , LastBlockDateEnd = @EndTime Where CharID = @CharID End -- Case 3 : IF murder times = 3 -- Block 7 days IF @LastMurderTimes = 3 Begin Set @EndTime = DATEADD (D,7, GETDATE()) Execute [SRO_VT_ACCOUNT].[dbo].[_RegisterPunishment] @UserJID,1,'iLegend',64,@CharName,'Murderer',1,'Auto Punishment Murder System','Auto Punishment Murder System',@SystemStartTime,@Now,@EndTime,@Now Update [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Set BlockTimes = (@BlockTimes +1) , LastBlockDateStart = @Now , LastBlockDateEnd = @EndTime Where CharID = @CharID End -- Case 4 : IF murder times = 4 -- Block 15 days IF @LastMurderTimes = 4 Begin Set @EndTime = DATEADD (D,15, GETDATE()) Execute [SRO_VT_ACCOUNT].[dbo].[_RegisterPunishment] @UserJID,1,'iLegend',64,@CharName,'Murderer',1,'Auto Punishment Murder System','Auto Punishment Murder System',@SystemStartTime,@Now,@EndTime,@Now Update [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Set BlockTimes = (@BlockTimes +1) , LastBlockDateStart = @Now , LastBlockDateEnd = @EndTime Where CharID = @CharID End -- Case 5 : IF murder times = 5 -- Block 1 Month IF @LastMurderTimes = 5 Begin Set @EndTime = DATEADD (M,1, GETDATE()) Execute [SRO_VT_ACCOUNT].[dbo].[_RegisterPunishment] @UserJID,1,'iLegend',64,@CharName,'Murderer',1,'Auto Punishment Murder System','Auto Punishment Murder System',@SystemStartTime,@Now,@EndTime,@Now Update [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Set BlockTimes = (@BlockTimes +1) , LastBlockDateStart = @Now , LastBlockDateEnd = @EndTime Where CharID = @CharID End -- Case 6 : IF murder times = 6 -- Block 1 Year IF @LastMurderTimes = 6 Begin Set @EndTime = DATEADD (Y,1, GETDATE()) Execute [SRO_VT_ACCOUNT].[dbo].[_RegisterPunishment] @UserJID,1,'iLegend',64,@CharName,'Murderer',1,'Auto Punishment Murder System','Auto Punishment Murder System',@SystemStartTime,@Now,@EndTime,@Now Update [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Set BlockTimes = (@BlockTimes +1) , LastBlockDateStart = @Now , LastBlockDateEnd = @EndTime Where CharID = @CharID End -- Case 7 : IF murder times = 7 -- Block 15 Years IF @LastMurderTimes = 7 Begin Set @EndTime = DATEADD (Y,15, GETDATE()) Execute [SRO_VT_ACCOUNT].[dbo].[_RegisterPunishment] @UserJID,1,'iLegend',64,@CharName,'Murderer',1,'Auto Punishment Murder System','Auto Punishment Murder System',@SystemStartTime,@Now,@EndTime,@Now Update [SRO_VT_SHARDLOG].[dbo].[_LogMurder] Set BlockTimes = (@BlockTimes +1) , LastBlockDateStart = @Now , LastBlockDateEnd = @EndTime Where CharID = @CharID End -- End Auto PK Punishment system --
|