SilkSystem

06/16/2019 09:12 sonzenbi#1
I hope it was useful for you :)
You can add or subtract silk/giftsilk/silkpoint without teleport character .
exec SRO_VT_ACCOUNT.._SilkSystem @charname,@silktype,@SilkAmount,@type -- cong or tru
06/16/2019 09:17 Ryotic#2
By kingdollar?

Sent from my Redmi Note 7 using Tapatalk
06/16/2019 09:19 sonzenbi#3
By me :rolleyes:
06/16/2019 09:21 Ryotic#4
Quote:
Originally Posted by sonzenbi View Post
By me :rolleyes:
I saw this before in king dollar filter

Sent from my Redmi Note 7 using Tapatalk
06/16/2019 09:29 sonzenbi#5
I did it 30 minutes ago :feelsbadman:
06/16/2019 11:10 sonzenbi#6
okay fine ,I'm so nucking foob
but i know it's really working
You can add or subtract silk/giftsilk/silkpoint without teleport character
If you can fix it become perfect,congratulations, you're not a noob like me :wutface:
06/16/2019 18:05 hoangphan7#7
Maybe, it help you! Too fast too furious.
btw... Silk_Point useless. It's contain a bug in database. If you don't fixed, you can buy anything sell as silk_point with 0 silk_point. :-)
Silk_Point reduce but it'll back after you reload your character!

PHP Code:
use SRO_VT_ACCOUNT
go
declare @Charname16 varchar(64
declare @
silk int,@gsilk int,@cursilk int
declare @accjid int, @CharID int
declare @AccountID varchar(55)
set @silk 4000 --- Put silk number to add (increase). Negative number if decrease
set 
@gsilk 0
set 
@Charname16 '' --- You need type only Charname16 or AccountID
set 
@AccountID ''
set @CharID = (select CharID from sro_vt_shard.dbo._Char where Charname16 = @Charname16)
begin
if @AccountID =  ''
    
begin
    set 
@accjid = (select UserJID from sro_vt_shard.dbo._user where CharID = @CharID)
    
set @cursilk = (select Silk_Own from SK_Silk where JID = @accjid)
    
set @AccountID = (select StrUserID from SRO_VT_ACCOUNT..TB_User where JID = @accjid)
    if @
accjid and (@silk != or @gsilk != 0)
        
begin
            update SK_Silk set silk_own 
silk_own + @silksilk_gift silk_gift + @gsilk    where JID = @accjid
        end
    
else
        
begin    
            
print 'Error! Cant find CharName or User Account'
        
end
    end
--@@@@@@@@@@@@@@@
else if @
Charname16 ''
    
begin
    set 
@accjid = (select JID from TB_User where StrUserID = @AccountID)
    
set @cursilk = (select Silk_Own from SK_Silk where JID = @accjid)
    if @
accjid and (@silk != or @gsilk != 0)
        
begin
            update SK_Silk set silk_own 
silk_own + @silksilk_gift silk_gift + @gsilk where JID = @accjid
        end
    
else
        
begin    
            
print 'Error! Cant find CharName or User Account'
        
end
    end
end 
06/16/2019 18:30 #HB#8
Quote:
Originally Posted by $WeGs View Post
IF ELSE
IF ELSE
IF ELSE
IF ELSE
IF ELSE
IF ELSE
IF ELSE
......
So, you're telling us if and else are bad conditional operators? :(
06/16/2019 18:35 $WeGs#9
Quote:
Originally Posted by #HB View Post
So, you're telling us if and else are bad conditional operators? :(
Have you ever heard about case switch?

Also look at that query lol it's messy

Sent from my JKM-LX1 using Tapatalk
06/16/2019 19:23 Laag#82#10
good job

PHP Code:
continue 
I edit to you

-- Remove

PHP Code:
BEGIN TRY
BEGIN TRANSACTION

COMMIT TRANSACTION
end 
TRY

BEGIN CATCH 
PHP Code:
COMMIT TRANSACTION
end 
TRY

BEGIN CATCH

IF @@
TRANCOUNT 0
BEGIN
ROLLBACK TRANSACTION
end

END 
CATCH 
PHP Code:
INSERT SRO_VT_ACCOUNT.dbo.SK_SilkChange_BY_Web(JID,silk_r emain,silk_offset,silk_type,reasonVALUES(@UserJID,@Cursilk-@Cursilk,@Cursilk,0,5
Change silk_r emain to silk_remain


Example:-

PHP Code:
USE [SRO_VT_ACCOUNT]
GO
/****** Object: StoredProcedure [dbo].[_SilkSystem] Script Date: 06/16/2019 1:50:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE proc 
[dbo].[_SilkSystem]
@
Charname varchar(25),
@
SilkType varchar(20),
@
SilkAmount int
as

DECLARE @
UserJID int = (SELECT JID FROM SRO_VT_ACCOUNT.dbo.TB_User U WITH(NOLOCK)JOIN SRO_VT_SHARD.dbo._User U2 WITH(NOLOCKON U.JID U2.UserJID JOIN SRO_VT_SHARD.dbo._Char C WITH(NOLOCKON U2.CharID C.CharID WHERE C.CharName16 = @Charname or C.NickName16 = @Charname)


IF(@
SilkType 'SILK')
BEGIN
IF not exists(SELECT JID from SRO_VT_ACCOUNT.dbo.SK_Silk WITH(NOLOCKwhere JID = @UserJID)
BEGIN
INSERT SRO_VT_ACCOUNT
.dbo.SK_SilkChange_BY_Web(JIDsilk_remain,silk_offset,silk_type,reasonVALUES(@UserJID,@SilkAmount,@SilkAmount,0,0)
INSERT SRO_VT_ACCOUNT.dbo.SK_Silk(JID,silk_own,silk_giftsilk_Point)VALUES(@UserJID,@SilkAmount,0,0)
end ELSE
INSERT SRO_VT_ACCOUNT.dbo.SK_SilkChange_BY_Web(JIDsilk_remain,silk_offset,silk_type,reasonVALUES(@UserJID,@SilkAmount,@SilkAmount,0,0)
UPDATE SK_Silk SET silk_own += @SilkAmount WHERE JID = @UserJID
END 

IF (@SilkType 'Silk_Gift')
BEGIN
IF not exists(SELECT JID from SRO_VT_ACCOUNT.dbo.SK_Silk WITH(NOLOCKwhere JID = @UserJID)
BEGIN
INSERT SRO_VT_ACCOUNT
.dbo.SK_SilkChange_BY_Web(JIDsilk_remain,silk_offset,silk_type,reasonVALUES(@UserJID,@SilkAmount,@SilkAmount,1,2)
INSERT SRO_VT_ACCOUNT.dbo.SK_Silk(JID,silk_own,silk_giftsilk_Point)VALUES(@UserJID,0,@SilkAmount,0)
end ELSE
INSERT SRO_VT_ACCOUNT.dbo.SK_SilkChange_BY_Web(JIDsilk_remain,silk_offset,silk_type,reasonVALUES(@UserJID,@SilkAmount,@SilkAmount,1,2)
UPDATE SK_Silk SET silk_gift += @SilkAmount WHERE JID = @UserJID
END

IF (@SilkType 'Silk_Point')
BEGIN
IF not exists(SELECT JID from SRO_VT_ACCOUNT.dbo.SK_Silk WITH(NOLOCKwhere JID = @UserJID)
BEGIN
INSERT SRO_VT_ACCOUNT
.dbo.SK_SilkChange_BY_Web(JIDsilk_remain,silk_offset,silk_type,reasonVALUES(@UserJID,@SilkAmount,@SilkAmount,2,2)
INSERT SRO_VT_ACCOUNT.dbo.SK_Silk(JID,silk_own,silk_giftsilk_Point)VALUES(@UserJID,0,0,@SilkAmount)
END ELSE
INSERT SRO_VT_ACCOUNT.dbo.SK_SilkChange_BY_Web(JIDsilk_remain,silk_offset,silk_type,reasonVALUES(@UserJID,@SilkAmount,@SilkAmount,2,2)
UPDATE SK_Silk SET silk_Point += @SilkAmount WHERE JID = @UserJID
END 

Fix if Char use job
PHP Code:
C.CharName16 = @Charname or C.NickName16 = @Charname 
PHP Code:
DECLARE @UserJID int = (SELECT JID FROM SRO_VT_ACCOUNT.dbo.TB_User U WITH(NOLOCK)JOIN SRO_VT_SHARD.dbo._User U2 WITH(NOLOCKON U.JID U2.UserJID JOIN SRO_VT_SHARD.dbo._Char C WITH(NOLOCKON U2.CharID C.CharID WHERE C.CharName16 = @Charname or C.NickName16 = @Charname

exec

PHP Code:
exec SRO_VT_ACCOUNT.._SilkSystem 'CharName','SilkType','SilkNumbers' 
Good Luck :)
06/16/2019 20:30 ntabkpro#11
Quote:
Originally Posted by sonzenbi View Post
By me :rolleyes:
Hi sonzenbi
Can you help me resolve this?

I used Athena filter. But Reward silk system per hour is not working..
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
And procedure here


USE [ATHENA]
GO
/****** Object: StoredProcedure [dbo].[_RewardSystem] Script Date: 6/17/2019 1:20:38 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[_RewardSystem]
@struserID varchar(64),
@Cur_level int,
@itemID varchar(64),
@optLevel int
AS

BEGIN
/*
EXAMPLE CODE, FOR REWARD LEVEL RESTRICT
IF @Cur_level < 100)
BEGIN
RETURN;
END
*/


DECLARE @jid bigint = (SELECT JID FROM [SRO_VT_ACCOUNT].[dbo].[TB_User] WITH(NOLOCK) WHERE StrUserID = @struserID);


IF NOT EXISTS(SELECT JID FROM [SRO_VT_ACCOUNT].[dbo].[SK_silk] WITH(NOLOCK) WHERE JID = @jid)
BEGIN
--- INSERT THEIR SHIT
INSERT INTO [SRO_VT_ACCOUNT].[dbo].[SK_silk] (JID, silk_own, silk_gift, silk_point) VALUES @jid, 0, 0, 0);
END

/*
EXAMPLE CODE:
IF @Curlevel BETWEEN 0 AND 50)
BEGIN
-- Higher reward for level 0-50?
SET @optLevel = 32;
END
*/

IF @itemID = 'silk')
BEGIN
UPDATE [SRO_VT_ACCOUNT].[dbo].[SK_silk] SET silk_own = (silk_own + @optLevel) WHERE JID = @jid;
END

ELSE IF @itemID = 'gift')
BEGIN
--- fyll refund oqe?
UPDATE [SRO_VT_ACCOUNT].[dbo].[SK_silk] SET silk_gift = (silk_gift + @optLevel) WHERE JID = @jid;
END

ELSE IF @itemID = 'point')
BEGIN
UPDATE [SRO_VT_ACCOUNT].[dbo].[SK_silk] SET silk_point = (silk_point + @optLevel) WHERE JID = @jid;
END

ELSE
BEGIN
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN_CHEST] @jid, @itemID, 0, @optLevel;
END
END
06/16/2019 20:46 Laag#82#12
Quote:
Originally Posted by ntabkpro View Post
Hi sonzenbi
Can you help me resolve this?

I used Athena filter. But Reward silk system per hour is not working..
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
And procedure here


USE [ATHENA]
GO
/****** Object: StoredProcedure [dbo].[_RewardSystem] Script Date: 6/17/2019 1:20:38 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[_RewardSystem]
@struserID varchar(64),
@Cur_level int,
@itemID varchar(64),
@optLevel int
AS

BEGIN
/*
EXAMPLE CODE, FOR REWARD LEVEL RESTRICT
IF @Cur_level < 100)
BEGIN
RETURN;
END
*/


DECLARE @jid bigint = (SELECT JID FROM [SRO_VT_ACCOUNT].[dbo].[TB_User] WITH(NOLOCK) WHERE StrUserID = @struserID);


IF NOT EXISTS(SELECT JID FROM [SRO_VT_ACCOUNT].[dbo].[SK_silk] WITH(NOLOCK) WHERE JID = @jid)
BEGIN
--- INSERT THEIR SHIT
INSERT INTO [SRO_VT_ACCOUNT].[dbo].[SK_silk] (JID, silk_own, silk_gift, silk_point) VALUES @jid, 0, 0, 0);
END

/*
EXAMPLE CODE:
IF @Curlevel BETWEEN 0 AND 50)
BEGIN
-- Higher reward for level 0-50?
SET @optLevel = 32;
END
*/

IF @itemID = 'silk')
BEGIN
UPDATE [SRO_VT_ACCOUNT].[dbo].[SK_silk] SET silk_own = (silk_own + @optLevel) WHERE JID = @jid;
END

ELSE IF @itemID = 'gift')
BEGIN
--- fyll refund oqe?
UPDATE [SRO_VT_ACCOUNT].[dbo].[SK_silk] SET silk_gift = (silk_gift + @optLevel) WHERE JID = @jid;
END

ELSE IF @itemID = 'point')
BEGIN
UPDATE [SRO_VT_ACCOUNT].[dbo].[SK_silk] SET silk_point = (silk_point + @optLevel) WHERE JID = @jid;
END

ELSE
BEGIN
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN_CHEST] @jid, @itemID, 0, @optLevel;
END
END
Hello,

PHP Code:
Reward Delay Specified in Minutes 
Change from 1 to 60

PHP Code:
1 minutes
60 
1 hour 
don't forget reload guard
06/18/2019 05:36 B1Q#13
Quote:
Originally Posted by $WeGs View Post
Have you ever heard about case switch?

Also look at that query lol it's messy

Sent from my JKM-LX1 using Tapatalk
I could say the same about your code LOL
06/18/2019 17:07 #HB#14
Quote:
Originally Posted by $WeGs View Post
Have you ever heard about case switch?
Switch case in SQL is used to define variables' value, so you cannot use it to do other operations like updating a table or inserting. Hope you realize that.
06/18/2019 17:50 $WeGs#15
Quote:
Originally Posted by #HB View Post
Switch case in SQL is used to define variables' value, so you cannot use it to do other operations like updating a table or inserting. Hope you realize that.
maybe you need to take a look at this


[Only registered and activated users can see links. Click Here To Register...]