SilkRoad Service Database Editor , Sys

SilkRoad Service Database Editor , Sys

SilkRoad Service Database Editor, Systems, cap, degree, Filter, autoevent, Gameserver, VPS Dedicated, setup, 2 server one machine



Vsro Gift Per Day With AntiCheat

Share
avatar
Trixy
Admin
Admin

Posts : 22
Join date : 2018-06-19
Age : 31
Location : USA

Vsro Gift Per Day With AntiCheat

Post by Trixy on Fri Jun 29, 2018 7:09 am

Welcome to Game Network Online
Today I will Release new system Gift per day Exclusive
on Game Network online 
that system Created by SafyStar
Code:
USE [SRO_VT_LOG]
GO

/****** Object:  Table [dbo].[_GiftPerDay_LOG]    Script Date: 2/21/2018 6:49:33 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[_GiftPerDay_LOG](
    [JID] [int] NOT NULL,
    [CharID] [int] NULL,
    [strUserID] [varchar](64) NULL,
    [CharName] [varchar](64) NULL,
    [CharLevel] [tinyint] NULL,
    [JobType] [tinyint] NULL,
    [JobLevel] [tinyint] NULL,
    [JobDsc] [varchar](50) NULL,
    [HwanLevel] [tinyint] NULL,
    [HwanName] [varchar](50) NULL,
    [sec_primary] [tinyint] NULL CONSTRAINT [DF__GiftPerDay_LOG_sec_primary]  DEFAULT ((3)),
    [sec_content] [tinyint] NULL CONSTRAINT [DF__GiftPerDay_LOG_sec_content]  DEFAULT ((3)),
    [Date] [date] NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

Code:
USE [SRO_VT_LOG]
GO

/****** Object:  Table [dbo].[_GiftPerDay_LOG_AntiCheat]    Script Date: 2/21/2018 6:50:32 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[_GiftPerDay_LOG_AntiCheat](
    [JID] [int] NOT NULL,
    [CharID] [int] NULL,
    [strUserID] [varchar](64) NULL,
    [CharName] [varchar](64) NULL,
    [CharLevel] [tinyint] NULL,
    [JobType] [tinyint] NULL,
    [JobLevel] [tinyint] NULL,
    [JobDsc] [varchar](50) NULL,
    [HwanLevel] [tinyint] NULL,
    [HwanName] [varchar](50) NULL,
    [sec_primary] [tinyint] NULL CONSTRAINT [DF__GiftPerDay_LOG_AntiCheat_sec_primary]  DEFAULT ((3)),
    [sec_content] [tinyint] NULL CONSTRAINT [DF__GiftPerDay_LOG_AntiCheat_sec_content]  DEFAULT ((3)),
    [Date] [date] NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


Code:
USE [SRO_VT_LOG]
GO
/****** Object:  StoredProcedure [dbo].[_Gift_PerDay_Reward]    Script Date: 2/21/2018 6:53:11 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER Procedure [dbo].[_Gift_PerDay_Reward]

@CharID INT

AS
Declare @JID INT
Declare @CharName VarChar (50)
Declare @strUserID VARCHAR(50)
Declare @CharLevel tinyint
Declare @JobType tinyint
Declare @JobLevel tinyint
Declare @IP varchar(MAX)
Declare @Date datetime2(7)
Declare @Date2 datetime2(7)
Declare @Login INT
Declare @JobDsc VarChar (50)
Declare @Gift VarChar(MAX)
Declare @QTY INT
Declare @Plus INT
Declare @HwanLevel tinyint
Declare @HwanName VarChar(50)
Declare @SilkOwn INT
Declare @SilkGift INT
DECLARE @AccountID varchar(128) = (SELECT AccountID FROM SRO_VT_SHARD.dbo._AccountJID As ID INNER JOIN SRO_VT_SHARD.dbo._User as JID ON Id.JID = JID.UserJID where CharID = @CharID)
Declare @sec_primary tinyint = (select sec_primary from [SRO_VT_ACCOUNT]..TB_User where JID in (select USERJID from [SRO_VT_SHARD].._User where CharID=@CharID ) )
Declare @sec_content tinyint = (select sec_content from [SRO_VT_ACCOUNT]..TB_User where JID in (select USERJID from [SRO_VT_SHARD].._User where CharID=@CharID ) )

SET @JID = (SELECT UserJID FROM [SRO_VT_SHARD].dbo._User where CharID = @CharID)
SET @CharID = (Select CharID From [SRO_VT_SHARD]..[_Char] where CharID =@CharID)
SET @CharName = (Select CharName16 From [SRO_VT_SHARD]..[_Char] where CharID =@CharID)
SET @strUserID = (SELECT StrUserID FROM [SRO_VT_ACCOUNT].dbo.TB_User As JID INNER JOIN [SRO_VT_SHARD].dbo._User as USERJID ON JID.JID = USERJID.UserJID where CharID = @CharID)
SET @CharLevel = (Select CurLevel From [SRO_VT_SHARD]..[_Char] where CharID =@CharID)
SET @JobType = (Select JobType From [SRO_VT_SHARD]..[_CharTrijob] where CharID =@CharID)
SET @JobLevel = (Select Level From [SRO_VT_SHARD]..[_CharTrijob] where CharID =@CharID)
select @Date = (select Date From [SRO_VT_LOG]..[_GiftPerDay_LOG] where CharID =@CharID )
select @Date2 = (select Date From [SRO_VT_LOG]..[_GiftPerDay_LOG_AntiCheat] where CharID =@CharID )
Set @HwanLevel = (select HwanLevel from [SRO_VT_SHARD].._Char where CharID = @CharID )
SeT @SilkOwn = (select Silk_Own from [SRO_VT_ACCOUNT]..SK_Silk where JID in (select USERJID from [SRO_VT_SHARD].._User where CharID=@CharID ) )
SEt @SilkGift = (select silk_gift from [SRO_VT_ACCOUNT]..SK_Silk where JID in (select USERJID from [SRO_VT_SHARD].._User where CharID=@CharID ) )

--set @Gift  = (SELECT TOP 1 CodeName FROM [SRO_VT_LOG].. [_Gift_Dialy_Reward] ORDER BY NEWID())

Select  @Qty = QTY , @Plus=Plus, @SilkOwn=SilkOwn , @SilkGift=SilkGift  from _Gift_Dialy_Reward where @CharID in (select CharID from _GiftPerDay_LOG where CharID =@CharID)


Set @Qty    = '1'
Set @Plus    = '0'
Set @Gift    = 'ITEM_MALL_SKYRIX_BOX'
SeT @SilkOwn    = '10'
SEt @SilkGift    = '0'

                SET @JobDsc = CASE
                    WHEN @JobType =0 THEN '0'
                    WHEN @JobType =1 THEN 'Trader'
                    WHEN @JobType =2 THEN 'Thief'
                    WHEN @JobType =3 THEN 'Hunter'
                END
                SET @HwanName = Case
                    WHEN @HwanLevel =0 THEN    '0'
                    WHEN @HwanLevel =1 THEN    'Knight / Capitan'
                    WHEN @HwanLevel =2 THEN    'Baronet / General'
                    WHEN @HwanLevel =3 THEN    'Baron / Senior General'
                    WHEN @HwanLevel =4 THEN    'Count / Chief General'
                    WHEN @HwanLevel =7 THEN    'Thief Assassin'
                    WHEN @HwanLevel =8 THEN    'Unstoppable'
                    WHEN @HwanLevel =9 THEN    'Immortal'
                    WHEN @HwanLevel =10 THEN    'Black Bird'
                    WHEN @HwanLevel =11 THEN    'Demon'
                    WHEN @HwanLevel =12 THEN    'Mystic'
                    WHEN @HwanLevel =13 THEN    'The Killer'
                    WHEN @HwanLevel =14 THEN    'Dark Knight'
                    WHEN @HwanLevel =15 THEN    'Hulk'
                    WHEN @HwanLevel =16 THEN    'Avenger'
                    WHEN @HwanLevel =17 THEN    'Twilight'
                    WHEN @HwanLevel =18 THEN    'Incredible'
                    WHEN @HwanLevel =19 THEN    'Evil'
                    WHEN @HwanLevel =20 THEN    'Gladiator'
                    WHEN @HwanLevel =21 THEN    'Terminator'
                    WHEN @HwanLevel =22 THEN    'Hannibal'
                    WHEN @HwanLevel =23 THEN    'Godzilla'
                    WHEN @HwanLevel =24 THEN    'Overdose'
                    WHEN @HwanLevel =25 THEN    'S.W.A.T'
                    WHEN @HwanLevel =26 THEN    'F.B.I'
                    WHEN @HwanLevel =27 THEN    'C.S.I'
                    WHEN @HwanLevel =28 THEN    'Raven Bird'
                    WHEN @HwanLevel =29 THEN    'Striker'
                    WHEN @HwanLevel =30 THEN    'Dark Sider'
                    WHEN @HwanLevel =31 THEN    'Witcher'
                    WHEN @HwanLevel =32 THEN    'FAR CRY'
                    WHEN @HwanLevel =33 THEN    'Admiral'
                    WHEN @HwanLevel =34 THEN    'Dealer'
                    WHEN @HwanLevel =35 THEN    'Revenger'
                    WHEN @HwanLevel =36 THEN    'Epic'
                    WHEN @HwanLevel =37 THEN    'The Punisher'
                    WHEN @HwanLevel =38 THEN    'Brothers'
                    WHEN @HwanLevel =39 THEN    'Dovakiin'
                    WHEN @HwanLevel =40 THEN    'Kryptonary'
                    WHEN @HwanLevel =41 THEN    'Legend of the Sekear'
                    WHEN @HwanLevel =42 THEN    'Virus'
                    WHEN @HwanLevel =43 THEN    'Vampire'
                    WHEN @HwanLevel =44 THEN    'Eternal'
                    WHEN @HwanLevel =45 THEN    'Respect'
                    WHEN @HwanLevel =46 THEN    'Fantastic'
                    WHEN @HwanLevel =47 THEN    'Thief Assassin'
                    WHEN @HwanLevel =48 THEN    'Unstoppable'
                    WHEN @HwanLevel =49 THEN    'Immortal'
                    WHEN @HwanLevel =50 THEN    'Black Bird'
                    WHEN @HwanLevel =51 THEN    'Demon'
                    WHEN @HwanLevel =52 THEN    'Mystic'
                    WHEN @HwanLevel =53 THEN    'The Killer'
                    WHEN @HwanLevel =54 THEN    'Dark Knight'
                    WHEN @HwanLevel =55 THEN    'Hulk'
                    WHEN @HwanLevel =56 THEN    'Avenger'
                    WHEN @HwanLevel =57 THEN    'Twilight'
                    WHEN @HwanLevel =58 THEN    'Incredible'
                    WHEN @HwanLevel =59 THEN    'Evil'
                    WHEN @HwanLevel =60 THEN    'Gladiator'
                    WHEN @HwanLevel =61 THEN    'Terminator'
                    WHEN @HwanLevel =62 THEN    'Hannibal'
                    WHEN @HwanLevel =63 THEN    'Godzilla'
                    WHEN @HwanLevel =64 THEN    'Overdose'
                    WHEN @HwanLevel =65 THEN    'S.W.A.T'
                    WHEN @HwanLevel =66 THEN    'F.B.I'
                    WHEN @HwanLevel =67 THEN    'C.S.I'
                    WHEN @HwanLevel =68 THEN    'Raven Bird'
                    WHEN @HwanLevel =69 THEN    'Striker'
                    WHEN @HwanLevel =70 THEN    'Dark Sider'
                    WHEN @HwanLevel =71 THEN    'Witcher'
                    WHEN @HwanLevel =72 THEN    'FAR CRY'
                    WHEN @HwanLevel =73 THEN    'Admiral'
                    WHEN @HwanLevel =74 THEN    'Dealer'
                    WHEN @HwanLevel =75 THEN    'Revenger'
                    WHEN @HwanLevel =76 THEN    'Epic'
                    WHEN @HwanLevel =77 THEN    'The Punisher'
                    WHEN @HwanLevel =78 THEN    'Brothers'
                    WHEN @HwanLevel =79 THEN    'Dovakiin'
                    WHEN @HwanLevel =80 THEN    'Kryptonary'
                    WHEN @HwanLevel =81 THEN    'Legend of the Sekear'
                    WHEN @HwanLevel =82 THEN    'Virus'
                    WHEN @HwanLevel =83 THEN    'Vampire'
                    WHEN @HwanLevel =84 THEN    'Eternal'
                    WHEN @HwanLevel =85 THEN    'Respect'
                    WHEN @HwanLevel =86 THEN    'Fantastic'
                    WHEN @HwanLevel =87 THEN    'Thief Assassin'
                    WHEN @HwanLevel =88 THEN    'Unstoppable'
                    WHEN @HwanLevel =89 THEN    'Immortal'
                    WHEN @HwanLevel =90 THEN    'Black Bird'
                    WHEN @HwanLevel =91 THEN    'Demon'
                    WHEN @HwanLevel =92 THEN    'Mystic'
                    WHEN @HwanLevel =93 THEN    'The Killer'
                    WHEN @HwanLevel =94 THEN    'Dark Knight'
                    WHEN @HwanLevel =95 THEN    'Hulk'
                    WHEN @HwanLevel =96 THEN    'Avenger'
                    WHEN @HwanLevel =97 THEN    'Twilight'
                    WHEN @HwanLevel =98 THEN    'Incredible'
                    WHEN @HwanLevel =99 THEN    'Evil'
                    WHEN @HwanLevel =100 THEN    'Gladiator'
                    WHEN @HwanLevel =101 THEN    'Terminator'
                    WHEN @HwanLevel =102 THEN    'Hannibal'
                    WHEN @HwanLevel =103 THEN    'Godzilla'
                    WHEN @HwanLevel =104 THEN    'Overdose'
                    WHEN @HwanLevel =105 THEN    'S.W.A.T'
                    WHEN @HwanLevel =106 THEN    'F.B.I'
                    WHEN @HwanLevel =107 THEN    'C.S.I'
                    WHEN @HwanLevel =108 THEN    'Raven Bird'
                    WHEN @HwanLevel =109 THEN    'Striker'
                    WHEN @HwanLevel =110 THEN    'Dark Sider'
                    WHEN @HwanLevel =111 THEN    'Witcher'
                    WHEN @HwanLevel =112 THEN    'FAR CRY'
                    WHEN @HwanLevel =113 THEN    'Admiral'
                    WHEN @HwanLevel =114 THEN    'Dealer'
                    WHEN @HwanLevel =115 THEN    'Revenger'
                    WHEN @HwanLevel =116 THEN    'Epic'
                    WHEN @HwanLevel =117 THEN    'The Punisher'
                    WHEN @HwanLevel =118 THEN    'Brothers'
                    WHEN @HwanLevel =119 THEN    'Dovakiin'
                    WHEN @HwanLevel =120 THEN    'Kryptonary'
                    WHEN @HwanLevel =121 THEN    'Legend of the Sekear'
                    WHEN @HwanLevel =122 THEN    'Virus'
                    WHEN @HwanLevel =123 THEN    'Vampire'
                    WHEN @HwanLevel =124 THEN    'Eternal'
                    WHEN @HwanLevel =125 THEN    'Respect'
                    WHEN @HwanLevel =126 THEN    'Fantastic'
                    WHEN @HwanLevel =165 THEN    '[Supporter] Krypton-SRO'
                    WHEN @HwanLevel =166 THEN    '[GameMaster] Krypton-SRO'
                    End

                    /*
                    sec_primary    tinyint    Unchecked
sec_content    tinyint    Unchecked
*/

if not exists (select CharID From [SRO_VT_LOG]..[_GiftPerDay_LOG] where CharID=@CharID )
Begin
Insert Into [SRO_VT_LOG]..[_GiftPerDay_LOG] (JID,CharID,strUserID,CharName,CharLevel,JobType,JobLevel,JobDsc,HwanLevel,HwanName,sec_primary,sec_content,Date) Values (@JID,@CharID,@strUserID,@CharName,@CharLevel,@JobType,@JobLevel,@JobDsc,@HwanLevel,@HwanName,@sec_primary,@sec_content,GETDATE())
END

If Exists (select CharID From [SRO_VT_LOG]..[_GiftPerDay_LOG] where CharID=@CharID  )
Begin
Update [SRO_VT_LOG]..[_GiftPerDay_LOG]  set CharName=@CharName ,Date = GETDATE() , CharLevel=@CharLevel ,JobType=@JobType,JobLevel=@JobLevel,JobDsc = @JobDsc,HwanLevel=@HwanLevel,HwanName=@HwanName,sec_primary=@sec_primary,sec_content=@sec_content where CharID=@CharID
END

If not Exists (select CharID From [SRO_VT_LOG]..[_GiftPerDay_LOG_AntiCheat] where CharID=@CharID )
Begin
Insert Into [SRO_VT_LOG]..[_GiftPerDay_LOG_AntiCheat] (JID,CharID,strUserID,CharName,CharLevel,JobType,JobLevel,JobDsc,HwanLevel,HwanName,sec_primary,sec_content,Date) values  (@JID,@CharID,@strUserID,@CharName,@CharLevel,@JobType,@JobLevel,@JobDsc,@HwanLevel,@HwanName,@sec_primary,@sec_content,GETDATE())
--exec [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN_CHEST] @AccountID, @Gift, @QTY, @Plus
END

If Exists (select CharID From [SRO_VT_LOG]..[_GiftPerDay_LOG_AntiCheat] where CharID=@CharID and @Date> @Date2)
Begin
--Exec [SRO_VT_SHARD]..[_ADD_ITEM_EXTERN]  @CharName,@Gift,@QTY,@Plus
exec [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN_CHEST] @AccountID, @Gift, @QTY, @Plus
UPDATE SRO_VT_ACCOUNT..SK_Silk Set silk_own=silk_own+@SilkOwn,silk_gift=silk_gift+@SilkGift Where JID =@JID
Update [SRO_VT_LOG]..[_GiftPerDay_LOG_AntiCheat]  set CharName=@CharName ,Date = GETDATE() ,JobType=@JobType,JobLevel=@JobLevel,JobDsc = @JobDsc,HwanLevel=@HwanLevel,HwanName=@HwanName,sec_primary=@sec_primary,sec_content=@sec_content  where CharID=@CharID

END


/*
If Exists (select CharID From [SRO_VT_LOG]..[_GiftPerDay_LOG_AntiCheat] where CharID=@CharID and Date = @Date2 )
Begin
Update [SRO_VT_LOG]..[_GiftPerDay_LOG_AntiCheat]  set CharName=@CharName ,Date = GETDATE() ,CharLevel=@CharLevel, JobType=@JobType,JobLevel=@JobLevel,JobDsc = @JobDsc,HwanLevel=@HwanLevel,HwanName=@HwanName where CharID=@CharID
END
*/
Add That on _AddLogChar, SRO_VT_LOG

Code:
-- Gift Per Day --By SafyStar
if (@EventID IN (9) )
Begin
Exec [SRO_VT_LOG].[dbo].[_Gift_PerDay_Reward] @CharID
END





    Current date/time is Mon Nov 19, 2018 7:09 pm