قسم الشروحات و البرامج المستخدمة في عمل السيرفرات الخاصة[ قسم متخصص فى شروحات و البرامج في عمل السيرفرات الخاصة ] [ يرجى عدم وضع الأسئلة والاستفسارات في هذا القسم ]
USE [SRO_VT_SHARDLOG]
GO
/****** Object: StoredProcedure [dbo].[Top_Job_Count] Script Date: 20/04/2016 04:49:52 ص ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[Top_Job_Count]
@CharID int
as
---------- Main Declares ----------------------
DECLARE @UserID int = (SELECT userjid FROM [SRO_VT_SHARD].[dbo].[_User] where CharID = @CharID)
DECLARE @PointsTR int ,@Top_TR int ,@CharName1 varchar(20),@Points2 int , @Points3 int ,@CharName2 varchar(20) , @CharName3 varchar(20),@HwanTitle1 int
,@PointsHU int ,@PointsTH int ,@Top_HU int ,@Top_TH int ,@HwanTitle int ,@Reward1 varchar(MAX),@Num1 int,@Num2 int,@Num3 int ,@Reward2 varchar(MAX)
,@Reward3 varchar(MAX) , @Notice varchar(Max),@Silkown int,@Plus1 int,@Plus2 int,@Plus3 int,@Silkgift int ,@Count int , @CharNameOld varchar(20) ,@Hwanlevelchange int,@CheckHwanlevel tinyint
Set @PointsTR = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1')
Set @PointsHU = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3')
Set @PointsTH = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2')
----------- Start Top System --------------------------
/* Start Trader Section */
Set @Top_TR = (Select Top 1 (CharID) From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType='1' Order By Points desc)
Set @CharName1 = (Select CharName16 From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@Top_TR)
Select @Count = Points,@Notice=notice,@HwanTitle = HwanLevel ,@Reward1=Reward1,@Reward2=Reward2,@Reward3=Reward3,@Num1=Num1,@Num2=Num2,@Num3=Num3,@Silkown=Silk_Own,@Silkgift=Silk_Gift,@Plus1=Plus1,@Plus2=Plus2,@Plus3=Plus3 From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System] Where JopType = '1'
Set @CheckHwanlevel = (SELECT HwanLevel FROM [SRO_VT_SHARD].[dbo].[_Char] Where CharName16 = @CharName1)
Set @CharNameOld = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] Where HwanLevel = @HwanTitle)
Set @Hwanlevelchange = (SELECT OldHwan FROM [SRO_VT_SHARDLOG].[dbo].[_OldTitles_Jop] Where CharName=@CharNameOld)
IF @PointsTR >= @Count
BEGIN
-- Take the title from the player
IF Not EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName1)
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] ([CharName],[OldHwan],[UName]) Values (@CharName1,@CheckHwanlevel,@HwanTitle)
END
IF EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName1)
IF (@CheckHwanlevel Not In (Select Hwanlevel From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System]))
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] Set OldHwan=@CheckHwanlevel , UName=@HwanTitle where CharName=@CharName1
END
UPDATE [SRO_VT_SHARD].[dbo].[_Char] SET HwanLevel = @Hwanlevelchange where CharName16 = @CharNameOld
-- Adding the title to the new player
IF(@HwanTitle > '0')
Begin
UPDATE [SRO_VT_SHARD].[dbo].[_Char] set HwanLevel = @HwanTitle where CharName16 = @CharName1
END
-- Item Reward
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward1,@Num1,@Plus1
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward2,@Num2,@Plus2
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward3,@Num3,@Plus3
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Own] @UserID,@Silkown
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Gift] @UserID,@Silkgift
-- Notice Lines To show All server this char is Hero
insert into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] ([Service],[Type],[Message],[Date]) Values ('1','Notice',' *** '+@CharName1+'*** , '+@Notice+'',GETDATE())
-- Delete Log Unique From Table
DELETE from [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType = '1'
END
/* End Trader Section */
/* Start Thieves Section */
Set @Top_TH = (Select Top 1 (CharID) From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType='2' Order By Points desc)
Set @CharName2 = (Select CharName16 From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@Top_TH)
Set @CheckHwanlevel = (SELECT HwanLevel FROM [SRO_VT_SHARD].[dbo].[_Char] Where CharName16 = @CharName2)
Select @Count = Points,@Notice=notice,@HwanTitle = HwanLevel ,@Reward1=Reward1,@Reward2=Reward2,@Reward3=Reward3,@Num1=Num1,@Num2=Num2,@Num3=Num3,@Silkown=Silk_Own,@Silkgift=Silk_Gift,@Plus1=Plus1,@Plus2=Plus2,@Plus3=Plus3 From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System] Where JopType = '2'
Set @CharNameOld = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] Where HwanLevel = @HwanTitle)
Set @Hwanlevelchange = (SELECT OldHwan FROM [SRO_VT_SHARDLOG].[dbo].[_OldTitles_Jop] Where CharName=@CharNameOld)
IF @PointsTH >= @Count
BEGIN
-- Take the title from the player
IF Not EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName2)
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] ([CharName],[OldHwan],[UName]) Values (@CharName2,@CheckHwanlevel,@HwanTitle)
END
IF EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName2)
IF (@CheckHwanlevel Not In (Select Hwanlevel From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System]))
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] Set OldHwan=@CheckHwanlevel , UName=@HwanTitle where CharName=@CharName2
END
UPDATE [SRO_VT_SHARD].[dbo].[_Char] SET HwanLevel = @Hwanlevelchange where CharName16 = @CharNameOld
-- Adding the title to the new player
IF(@HwanTitle > '0')
Begin
UPDATE [SRO_VT_SHARD].[dbo].[_Char] set HwanLevel = @HwanTitle where CharName16 = @CharName2
END
-- Item Reward
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward1,@Num1,@Plus1
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward2,@Num2,@Plus2
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward3,@Num3,@Plus3
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Own] @UserID,@Silkown
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Gift] @UserID,@Silkgift
-- Notice Lines To show All server this char is Hero
insert into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] ([Service],[Type],[Message],[Date]) Values ('1','Notice',' *** '+@CharName2+'*** , '+@Notice+'',GETDATE())
-- Delete Log Unique From Table
DELETE from [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType = '2'
END
/* End Thieves Section */
/* Start Hunter Section */
Set @Top_HU = (Select Top 1 (CharID) From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType='3' Order By Points desc)
Set @CharName3 = (Select CharName16 From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@Top_HU)
Set @CheckHwanlevel = (SELECT HwanLevel FROM [SRO_VT_SHARD].[dbo].[_Char] Where CharName16 = @CharName3)
Select @Count = Points,@Notice=notice,@HwanTitle = HwanLevel ,@Reward1=Reward1,@Reward2=Reward2,@Reward3=Reward3,@Num1=Num1,@Num2=Num2,@Num3=Num3,@Silkown=Silk_Own,@Silkgift=Silk_Gift,@Plus1=Plus1,@Plus2=Plus2,@Plus3=Plus3 From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System] Where JopType = '3'
Set @CharNameOld = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] Where HwanLevel = @HwanTitle)
Set @Hwanlevelchange = (SELECT OldHwan FROM [SRO_VT_SHARDLOG].[dbo].[_OldTitles_Jop] Where CharName=@CharNameOld)
IF @PointsHU >= @Count
BEGIN
-- Take the title from the player
IF Not EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName3)
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] ([CharName],[OldHwan],[UName]) Values (@CharName3,@CheckHwanlevel,@HwanTitle)
END
IF EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName3)
IF (@CheckHwanlevel Not In (Select Hwanlevel From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System]))
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] Set OldHwan=@CheckHwanlevel , UName=@HwanTitle where CharName=@CharName3
END
UPDATE [SRO_VT_SHARD].[dbo].[_Char] SET HwanLevel = @Hwanlevelchange where CharName16 = @CharNameOld
-- Adding the title to the new player
IF(@HwanTitle > '0')
Begin
UPDATE [SRO_VT_SHARD].[dbo].[_Char] set HwanLevel = @HwanTitle where CharName16 = @CharName3
END
-- Item Reward
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward1,@Num1,@Plus1
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward2,@Num2,@Plus2
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward3,@Num3,@Plus3
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Own] @UserID,@Silkown
EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Gift] @UserID,@Silkgift
-- Notice Lines To show All server this char is Hero
insert into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] ([Service],[Type],[Message],[Date]) Values ('1','Notice',' *** '+@CharName3+'*** , '+@Notice+'',GETDATE())
-- Delete Log Unique From Table
DELETE from [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType = '3'
END
/* End Hunter Section */
_Job_Coin
كود PHP:
USE [SRO_VT_SHARDLOG]
GO
/****** Object: StoredProcedure [dbo].[_Job_Coin] Script Date: 20/04/2016 04:50:32 ص ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[_Job_Coin]
@CharID int
as
---------- Main & Select Declares ----------------------
DECLARE @JobType int ,@Contri bigint ,@CurLevel int ,@UserJID int , @Points int ,@CharName varchar(20),@Reqlevel int,@Reward_1_3Star varchar(max),@Reward_2_3Star varchar(max),@Reward_3_3Star varchar(max),@Num_1_3Star int,@Num_2_3Star int,@Num_3_3Star int
,@Reward_1_4Star varchar(max),@Reward_2_4Star varchar(max),@Reward_3_4Star varchar(max),@Num_1_4Star int,@Num_2_4Star int,@Num_3_4Star int,@Gold_3Star bigint,@Gold_4Star bigint,@Gold_5Star bigint
,@Reward_1_5Star varchar(max),@Reward_2_5Star varchar(max),@Reward_3_5Star varchar(max),@Num_1_5Star int,@Num_2_5Star int,@Num_3_5Star int,@Gold_2Star bigint,@Gold_1Star bigint
,@Reward_1_2Star varchar(max),@Reward_2_2Star varchar(max),@Reward_3_2Star varchar(max),@Num_1_2Star int,@Num_2_2Star int,@Num_3_2Star int
,@Reward_1_1Star varchar(max),@Reward_2_1Star varchar(max),@Reward_3_1Star varchar(max),@Num_1_1Star int,@Num_2_1Star int,@Num_3_1Star int
Set @JobType = (Select JobType From [SRO_VT_SHARD].[dbo].[_CharTrijob] where CharID=@CharID)
Set @CurLevel = (Select CurLevel From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@CharID)
Set @UserJID = (Select userjid FROM [SRO_VT_SHARD].[dbo].[_User] where CharID = @CharID)
Set @Contri = (Select Contribution From [SRO_VT_SHARD].[dbo].[_CharTrijob] where CharID=@CharID)
Set @Points = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1')
Set @CharName =(Select CharName16 From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@CharID)
Declare @Remaingold bigint = (Select RemainGold From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@CharID)
---------- Start Trader System ----------------------
Select @Reqlevel=Curlevel , @Reward_1_3Star=Reward_1_3Star ,@Num_1_3Star=Num_1_3Star ,@Reward_2_3Star=Reward_2_3Star,@Num_2_3Star=Num_2_3Star ,@Reward_3_3Star=Reward_3_3Star,@Num_3_3Star=Num_3_3Star
,@Reward_1_4Star=Reward_1_4Star ,@Num_1_4Star=Num_1_4Star ,@Reward_2_4Star=Reward_2_4Star,@Num_2_4Star=Num_2_4Star ,@Reward_3_4Star=Reward_3_4Star,@Num_3_4Star=Num_3_4Star,@Gold_3Star = Gold_3Star,@Gold_4Star = Gold_4Star,@Gold_5Star = Gold_5Star
,@Reward_1_5Star=Reward_1_5Star ,@Num_1_5Star=Num_1_5Star ,@Reward_2_5Star=Reward_2_5Star,@Num_2_5Star=Num_2_5Star ,@Reward_3_5Star=Reward_3_5Star,@Num_3_5Star=Num_3_5Star,@Gold_2Star = Gold_2Star
,@Reward_1_2Star=Reward_1_2Star ,@Num_1_2Star=Num_1_2Star ,@Reward_2_2Star=Reward_2_2Star,@Num_2_2Star=Num_2_2Star ,@Reward_3_2Star=Reward_3_2Star,@Num_3_2Star=Num_3_2Star,@Gold_1Star = Gold_1Star
,@Reward_1_1Star=Reward_1_1Star ,@Num_1_1Star=Num_1_1Star ,@Reward_2_1Star=Reward_2_1Star,@Num_2_1Star=Num_2_1Star ,@Reward_3_1Star=Reward_3_1Star,@Num_3_1Star=Num_3_1Star From [SRO_VT_SHARDLOG].[dbo].[Job_Reward] where JopType='1'
/* 1 Star Section */
IF (@JobType = '1' AND @Contri BETWEEN '2420' And '48400')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_1Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_1Star,@Num_1_1Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_1Star,@Num_2_1Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_1Star,@Num_3_1Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 1, ur points not increased',Getdate())
END
/* 2 Star Section */
IF (@JobType = '1' AND @Contri BETWEEN '50820' And '87120')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_2Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_2Star,@Num_1_2Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_2Star,@Num_2_2Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_2Star,@Num_3_2Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 2, ur points not increased',Getdate())
END
/* 3 Star Section */
IF (@JobType = '1' AND @Contri BETWEEN '89540' And '137940')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_3Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_3Star,@Num_1_3Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_3Star,@Num_2_3Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_3Star,@Num_3_3Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 3, ur point now increased +1',Getdate())
IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1')
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'1','1')
END
IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1')
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 1 where CharID=@CharID And JopType='1'
END
END
/* 4 Star Section */
IF (@JobType = '1' AND @Contri BETWEEN '140360' And '205700')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_4Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_4Star,@Num_1_4Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_4Star,@Num_2_4Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_4Star,@Num_3_4Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 4, ur point now increased +2',Getdate())
IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1')
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'1','2')
END
IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1')
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 2 where CharID=@CharID And JopType='1'
END
END
/* 5 Star Section */
IF (@JobType = '1' AND @Contri BETWEEN '208120' And '384780')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_5Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_5Star,@Num_1_5Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_5Star,@Num_2_5Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_5Star,@Num_3_5Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 5, ur point now increased +3',Getdate())
IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1')
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'1','3')
END
IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1')
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 3 where CharID=@CharID And JopType='1'
END
END
---------- End Trader System ----------------------
----------- Start Hunter System ----------------------
Set @Points = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3')
Select @Reqlevel=Curlevel , @Reward_1_3Star=Reward_1_3Star ,@Num_1_3Star=Num_1_3Star ,@Reward_2_3Star=Reward_2_3Star,@Num_2_3Star=Num_2_3Star ,@Reward_3_3Star=Reward_3_3Star,@Num_3_3Star=Num_3_3Star
,@Reward_1_4Star=Reward_1_4Star ,@Num_1_4Star=Num_1_4Star ,@Reward_2_4Star=Reward_2_4Star,@Num_2_4Star=Num_2_4Star ,@Reward_3_4Star=Reward_3_4Star,@Num_3_4Star=Num_3_4Star,@Gold_3Star = Gold_3Star,@Gold_4Star = Gold_4Star,@Gold_5Star = Gold_5Star
,@Reward_1_5Star=Reward_1_5Star ,@Num_1_5Star=Num_1_5Star ,@Reward_2_5Star=Reward_2_5Star,@Num_2_5Star=Num_2_5Star ,@Reward_3_5Star=Reward_3_5Star,@Num_3_5Star=Num_3_5Star,@Gold_2Star = Gold_2Star
,@Reward_1_2Star=Reward_1_2Star ,@Num_1_2Star=Num_1_2Star ,@Reward_2_2Star=Reward_2_2Star,@Num_2_2Star=Num_2_2Star ,@Reward_3_2Star=Reward_3_2Star,@Num_3_2Star=Num_3_2Star,@Gold_1Star = Gold_1Star
,@Reward_1_1Star=Reward_1_1Star ,@Num_1_1Star=Num_1_1Star ,@Reward_2_1Star=Reward_2_1Star,@Num_2_1Star=Num_2_1Star ,@Reward_3_1Star=Reward_3_1Star,@Num_3_1Star=Num_3_1Star From [SRO_VT_SHARDLOG].[dbo].[Job_Reward] where JopType='3'
/* 1 Star Section */
IF (@JobType = '3' AND @Contri BETWEEN '1776' And '35520')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_1Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_1Star,@Num_1_1Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_1Star,@Num_2_1Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_1Star,@Num_3_1Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 1, ur points not increased',Getdate())
END
/* 2 Star Section */
IF (@JobType = '3' AND @Contri BETWEEN '37296' And '63936')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_2Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_2Star,@Num_1_2Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_2Star,@Num_2_2Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_2Star,@Num_3_2Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 2, ur points not increased',Getdate())
END
/* 3 Star Section */
IF (@JobType = '3' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '65712' And '101232')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_3Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_3Star,@Num_1_3Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_3Star,@Num_2_3Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_3Star,@Num_3_3Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 3, ur point now increased +1',Getdate())
IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3')
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'3','1')
END
IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3')
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 1 where CharID=@CharID And JopType='3'
END
END
/* 4 Star Section */
IF (@JobType = '3' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '103008' And '150960')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_4Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_4Star,@Num_1_4Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_4Star,@Num_2_4Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_4Star,@Num_3_4Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 4, ur point now increased +2',Getdate())
IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3')
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'3','2')
END
IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3')
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 2 where CharID=@CharID And JopType='3'
END
END
/* 5 Star Section */
IF (@JobType = '3' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '152736' And '282384')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_5Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_5Star,@Num_1_5Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_5Star,@Num_2_5Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_5Star,@Num_3_5Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 5, ur point now increased +3',Getdate())
IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3')
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'3','3')
END
IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3')
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 3 where CharID=@CharID And JopType='3'
END
END
----------- End Hunter System ------------------------
----------- Start Thieves System ----------------------
Set @Points = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2')
Select @Reqlevel=Curlevel , @Reward_1_3Star=Reward_1_3Star ,@Num_1_3Star=Num_1_3Star ,@Reward_2_3Star=Reward_2_3Star,@Num_2_3Star=Num_2_3Star ,@Reward_3_3Star=Reward_3_3Star,@Num_3_3Star=Num_3_3Star
,@Reward_1_4Star=Reward_1_4Star ,@Num_1_4Star=Num_1_4Star ,@Reward_2_4Star=Reward_2_4Star,@Num_2_4Star=Num_2_4Star ,@Reward_3_4Star=Reward_3_4Star,@Num_3_4Star=Num_3_4Star,@Gold_3Star = Gold_3Star,@Gold_4Star = Gold_4Star,@Gold_5Star = Gold_5Star
,@Reward_1_5Star=Reward_1_5Star ,@Num_1_5Star=Num_1_5Star ,@Reward_2_5Star=Reward_2_5Star,@Num_2_5Star=Num_2_5Star ,@Reward_3_5Star=Reward_3_5Star,@Num_3_5Star=Num_3_5Star,@Gold_2Star = Gold_2Star
,@Reward_1_2Star=Reward_1_2Star ,@Num_1_2Star=Num_1_2Star ,@Reward_2_2Star=Reward_2_2Star,@Num_2_2Star=Num_2_2Star ,@Reward_3_2Star=Reward_3_2Star,@Num_3_2Star=Num_3_2Star,@Gold_1Star = Gold_1Star
,@Reward_1_1Star=Reward_1_1Star ,@Num_1_1Star=Num_1_1Star ,@Reward_2_1Star=Reward_2_1Star,@Num_2_1Star=Num_2_1Star ,@Reward_3_1Star=Reward_3_1Star,@Num_3_1Star=Num_3_1Star From [SRO_VT_SHARDLOG].[dbo].[Job_Reward] where JopType='2'
/* 1 Star Section */
IF (@JobType = '2' AND @Contri BETWEEN '6128' And '122560')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_1Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_1Star,@Num_1_1Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_1Star,@Num_2_1Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_1Star,@Num_3_1Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 1, ur points not increased',Getdate())
END
/* 2 Star Section */
IF (@JobType = '2' AND @Contri BETWEEN '128688' And '220608')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_2Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_2Star,@Num_1_2Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_2Star,@Num_2_2Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_2Star,@Num_3_2Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 2, ur points not increased',Getdate())
END
/* 3 Star Section */
IF (@JobType = '2' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '226736' And '349296')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_3Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_3Star,@Num_1_3Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_3Star,@Num_2_3Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_3Star,@Num_3_3Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 3, ur point now increased +1',Getdate())
IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2')
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'2','1')
END
IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2')
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 1 where CharID=@CharID And JopType='2'
END
END
/* 4 Star Section */
IF (@JobType = '2' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '355424' And '520880')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_4Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_4Star,@Num_1_4Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_4Star,@Num_2_4Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_4Star,@Num_3_4Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 4, ur point now increased +2',Getdate())
IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2')
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'2','2')
END
IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2')
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 2 where CharID=@CharID And JopType='2'
END
END
/* 5 Star Section */
IF (@JobType = '2' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '527008' And '974352')
BEGIN
UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID
UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_5Star where CharID=@CharID
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_5Star,@Num_1_5Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_5Star,@Num_2_5Star,0
EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_5Star,@Num_3_5Star,0
UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID
Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 5, ur point now increased +3',Getdate())
IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2')
Begin
Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'2','3')
END
IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2')
BEGIN
UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 3 where CharID=@CharID And JopType='2'
END
END
----------- End Thieves System ------------------------
USE [SRO_VT_SHARDLOG] GO /****** Object: StoredProcedure [dbo].[Top_Job_Count] Script Date: 20/04/2016 04:49:52 ص ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
ALTER procedure [dbo].[Top_Job_Count] @CharID int as ---------- Main Declares ---------------------- DECLARE @UserID int = (SELECT userjid FROM [SRO_VT_SHARD].[dbo].[_User] where CharID = @CharID) DECLARE @PointsTR int ,@Top_TR int ,@CharName1 varchar(20),@Points2 int , @Points3 int ,@CharName2 varchar(20) , @CharName3 varchar(20),@HwanTitle1 int ,@PointsHU int ,@PointsTH int ,@Top_HU int ,@Top_TH int ,@HwanTitle int ,@Reward1 varchar(MAX),@Num1 int,@Num2 int,@Num3 int ,@Reward2 varchar(MAX) ,@Reward3 varchar(MAX) , @Notice varchar(Max),@Silkown int,@Plus1 int,@Plus2 int,@Plus3 int,@Silkgift int ,@Count int , @CharNameOld varchar(20) ,@Hwanlevelchange int,@CheckHwanlevel tinyint Set @PointsTR = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1') Set @PointsHU = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3') Set @PointsTH = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2') ----------- Start Top System --------------------------
/* Start Trader Section */ Set @Top_TR = (Select Top 1 (CharID) From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType='1' Order By Points desc) Set @CharName1 = (Select CharName16 From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@Top_TR) Select @Count = Points,@Notice=notice,@HwanTitle = HwanLevel ,@Reward1=Reward1,@Reward2=Reward2,@Reward3=Reward3,@Num1=Num1,@Num2=Num2,@Num3=Num3,@Silkown=Silk_Own,@Silkgift=Silk_Gift,@Plus1=Plus1,@Plus2=Plus2,@Plus3=Plus3 From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System] Where JopType = '1' Set @CheckHwanlevel = (SELECT HwanLevel FROM [SRO_VT_SHARD].[dbo].[_Char] Where CharName16 = @CharName1) Set @CharNameOld = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] Where HwanLevel = @HwanTitle) Set @Hwanlevelchange = (SELECT OldHwan FROM [SRO_VT_SHARDLOG].[dbo].[_OldTitles_Jop] Where CharName=@CharNameOld) IF @PointsTR >= @Count BEGIN -- Take the title from the player IF Not EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName1) Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] ([CharName],[OldHwan],[UName]) Values (@CharName1,@CheckHwanlevel,@HwanTitle) END IF EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName1) IF (@CheckHwanlevel Not In (Select Hwanlevel From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System])) BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] Set OldHwan=@CheckHwanlevel , UName=@HwanTitle where CharName=@CharName1 END UPDATE [SRO_VT_SHARD].[dbo].[_Char] SET HwanLevel = @Hwanlevelchange where CharName16 = @CharNameOld -- Adding the title to the new player IF(@HwanTitle > '0') Begin UPDATE [SRO_VT_SHARD].[dbo].[_Char] set HwanLevel = @HwanTitle where CharName16 = @CharName1 END -- Item Reward EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward1,@Num1,@Plus1 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward2,@Num2,@Plus2 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward3,@Num3,@Plus3 EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Own] @UserID,@Silkown EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Gift] @UserID,@Silkgift -- Notice Lines To show All server this char is Hero insert into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] ([Service],[Type],[Message],[Date]) Values ('1','Notice',' *** '+@CharName1+'*** , '+@Notice+'',GETDATE()) -- Delete Log Unique From Table DELETE from [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType = '1' END
/* End Trader Section */
/* Start Thieves Section */ Set @Top_TH = (Select Top 1 (CharID) From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType='2' Order By Points desc) Set @CharName2 = (Select CharName16 From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@Top_TH) Set @CheckHwanlevel = (SELECT HwanLevel FROM [SRO_VT_SHARD].[dbo].[_Char] Where CharName16 = @CharName2) Select @Count = Points,@Notice=notice,@HwanTitle = HwanLevel ,@Reward1=Reward1,@Reward2=Reward2,@Reward3=Reward3,@Num1=Num1,@Num2=Num2,@Num3=Num3,@Silkown=Silk_Own,@Silkgift=Silk_Gift,@Plus1=Plus1,@Plus2=Plus2,@Plus3=Plus3 From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System] Where JopType = '2' Set @CharNameOld = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] Where HwanLevel = @HwanTitle) Set @Hwanlevelchange = (SELECT OldHwan FROM [SRO_VT_SHARDLOG].[dbo].[_OldTitles_Jop] Where CharName=@CharNameOld) IF @PointsTH >= @Count BEGIN -- Take the title from the player IF Not EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName2) Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] ([CharName],[OldHwan],[UName]) Values (@CharName2,@CheckHwanlevel,@HwanTitle) END IF EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName2) IF (@CheckHwanlevel Not In (Select Hwanlevel From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System])) BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] Set OldHwan=@CheckHwanlevel , UName=@HwanTitle where CharName=@CharName2 END UPDATE [SRO_VT_SHARD].[dbo].[_Char] SET HwanLevel = @Hwanlevelchange where CharName16 = @CharNameOld -- Adding the title to the new player IF(@HwanTitle > '0') Begin UPDATE [SRO_VT_SHARD].[dbo].[_Char] set HwanLevel = @HwanTitle where CharName16 = @CharName2 END -- Item Reward EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward1,@Num1,@Plus1 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward2,@Num2,@Plus2 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward3,@Num3,@Plus3 EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Own] @UserID,@Silkown EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Gift] @UserID,@Silkgift -- Notice Lines To show All server this char is Hero insert into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] ([Service],[Type],[Message],[Date]) Values ('1','Notice',' *** '+@CharName2+'*** , '+@Notice+'',GETDATE()) -- Delete Log Unique From Table DELETE from [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType = '2' END
/* End Thieves Section */
/* Start Hunter Section */ Set @Top_HU = (Select Top 1 (CharID) From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType='3' Order By Points desc) Set @CharName3 = (Select CharName16 From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@Top_HU) Set @CheckHwanlevel = (SELECT HwanLevel FROM [SRO_VT_SHARD].[dbo].[_Char] Where CharName16 = @CharName3) Select @Count = Points,@Notice=notice,@HwanTitle = HwanLevel ,@Reward1=Reward1,@Reward2=Reward2,@Reward3=Reward3,@Num1=Num1,@Num2=Num2,@Num3=Num3,@Silkown=Silk_Own,@Silkgift=Silk_Gift,@Plus1=Plus1,@Plus2=Plus2,@Plus3=Plus3 From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System] Where JopType = '3' Set @CharNameOld = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] Where HwanLevel = @HwanTitle) Set @Hwanlevelchange = (SELECT OldHwan FROM [SRO_VT_SHARDLOG].[dbo].[_OldTitles_Jop] Where CharName=@CharNameOld) IF @PointsHU >= @Count BEGIN -- Take the title from the player IF Not EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName3) Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] ([CharName],[OldHwan],[UName]) Values (@CharName3,@CheckHwanlevel,@HwanTitle) END IF EXISTS (Select Oldhwan From SRO_VT_SHARDLOG.dbo._OldTitles_jop where CharName=@CharName3) IF (@CheckHwanlevel Not In (Select Hwanlevel From [SRO_VT_SHARDLOG].[dbo].[Top_Jop_System])) BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[_OldTitles_jop] Set OldHwan=@CheckHwanlevel , UName=@HwanTitle where CharName=@CharName3 END UPDATE [SRO_VT_SHARD].[dbo].[_Char] SET HwanLevel = @Hwanlevelchange where CharName16 = @CharNameOld -- Adding the title to the new player IF(@HwanTitle > '0') Begin UPDATE [SRO_VT_SHARD].[dbo].[_Char] set HwanLevel = @HwanTitle where CharName16 = @CharName3 END -- Item Reward EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward1,@Num1,@Plus1 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward2,@Num2,@Plus2 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName1,@Reward3,@Num3,@Plus3 EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Own] @UserID,@Silkown EXEC SRO_VT_ACCOUNT.[CGI].[CGI_WebPurchaseSilk_Gift] @UserID,@Silkgift -- Notice Lines To show All server this char is Hero insert into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] ([Service],[Type],[Message],[Date]) Values ('1','Notice',' *** '+@CharName3+'*** , '+@Notice+'',GETDATE()) -- Delete Log Unique From Table DELETE from [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where JopType = '3' END
/* End Hunter Section */
_Job_Coin
كود PHP:
USE [SRO_VT_SHARDLOG] GO /****** Object: StoredProcedure [dbo].[_Job_Coin] Script Date: 20/04/2016 04:50:32 ص ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
ALTER procedure [dbo].[_Job_Coin] @CharID int as ---------- Main & Select Declares ---------------------- DECLARE @JobType int ,@Contri bigint ,@CurLevel int ,@UserJID int , @Points int ,@CharName varchar(20),@Reqlevel int,@Reward_1_3Star varchar(max),@Reward_2_3Star varchar(max),@Reward_3_3Star varchar(max),@Num_1_3Star int,@Num_2_3Star int,@Num_3_3Star int ,@Reward_1_4Star varchar(max),@Reward_2_4Star varchar(max),@Reward_3_4Star varchar(max),@Num_1_4Star int,@Num_2_4Star int,@Num_3_4Star int,@Gold_3Star bigint,@Gold_4Star bigint,@Gold_5Star bigint ,@Reward_1_5Star varchar(max),@Reward_2_5Star varchar(max),@Reward_3_5Star varchar(max),@Num_1_5Star int,@Num_2_5Star int,@Num_3_5Star int,@Gold_2Star bigint,@Gold_1Star bigint ,@Reward_1_2Star varchar(max),@Reward_2_2Star varchar(max),@Reward_3_2Star varchar(max),@Num_1_2Star int,@Num_2_2Star int,@Num_3_2Star int ,@Reward_1_1Star varchar(max),@Reward_2_1Star varchar(max),@Reward_3_1Star varchar(max),@Num_1_1Star int,@Num_2_1Star int,@Num_3_1Star int Set @JobType = (Select JobType From [SRO_VT_SHARD].[dbo].[_CharTrijob] where CharID=@CharID) Set @CurLevel = (Select CurLevel From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@CharID) Set @UserJID = (Select userjid FROM [SRO_VT_SHARD].[dbo].[_User] where CharID = @CharID) Set @Contri = (Select Contribution From [SRO_VT_SHARD].[dbo].[_CharTrijob] where CharID=@CharID) Set @Points = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1') Set @CharName =(Select CharName16 From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@CharID) Declare @Remaingold bigint = (Select RemainGold From [SRO_VT_SHARD].[dbo].[_Char] where CharID=@CharID) ---------- Start Trader System ---------------------- Select @Reqlevel=Curlevel , @Reward_1_3Star=Reward_1_3Star ,@Num_1_3Star=Num_1_3Star ,@Reward_2_3Star=Reward_2_3Star,@Num_2_3Star=Num_2_3Star ,@Reward_3_3Star=Reward_3_3Star,@Num_3_3Star=Num_3_3Star ,@Reward_1_4Star=Reward_1_4Star ,@Num_1_4Star=Num_1_4Star ,@Reward_2_4Star=Reward_2_4Star,@Num_2_4Star=Num_2_4Star ,@Reward_3_4Star=Reward_3_4Star,@Num_3_4Star=Num_3_4Star,@Gold_3Star = Gold_3Star,@Gold_4Star = Gold_4Star,@Gold_5Star = Gold_5Star ,@Reward_1_5Star=Reward_1_5Star ,@Num_1_5Star=Num_1_5Star ,@Reward_2_5Star=Reward_2_5Star,@Num_2_5Star=Num_2_5Star ,@Reward_3_5Star=Reward_3_5Star,@Num_3_5Star=Num_3_5Star,@Gold_2Star = Gold_2Star ,@Reward_1_2Star=Reward_1_2Star ,@Num_1_2Star=Num_1_2Star ,@Reward_2_2Star=Reward_2_2Star,@Num_2_2Star=Num_2_2Star ,@Reward_3_2Star=Reward_3_2Star,@Num_3_2Star=Num_3_2Star,@Gold_1Star = Gold_1Star ,@Reward_1_1Star=Reward_1_1Star ,@Num_1_1Star=Num_1_1Star ,@Reward_2_1Star=Reward_2_1Star,@Num_2_1Star=Num_2_1Star ,@Reward_3_1Star=Reward_3_1Star,@Num_3_1Star=Num_3_1Star From [SRO_VT_SHARDLOG].[dbo].[Job_Reward] where JopType='1' /* 1 Star Section */ IF (@JobType = '1' AND @Contri BETWEEN '2420' And '48400') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_1Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_1Star,@Num_1_1Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_1Star,@Num_2_1Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_1Star,@Num_3_1Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 1, ur points not increased',Getdate()) END
/* 2 Star Section */ IF (@JobType = '1' AND @Contri BETWEEN '50820' And '87120') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_2Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_2Star,@Num_1_2Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_2Star,@Num_2_2Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_2Star,@Num_3_2Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 2, ur points not increased',Getdate()) END
/* 3 Star Section */ IF (@JobType = '1' AND @Contri BETWEEN '89540' And '137940') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_3Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_3Star,@Num_1_3Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_3Star,@Num_2_3Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_3Star,@Num_3_3Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 3, ur point now increased +1',Getdate()) IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1') Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'1','1') END IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1') BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 1 where CharID=@CharID And JopType='1' END END
/* 4 Star Section */ IF (@JobType = '1' AND @Contri BETWEEN '140360' And '205700') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_4Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_4Star,@Num_1_4Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_4Star,@Num_2_4Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_4Star,@Num_3_4Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 4, ur point now increased +2',Getdate()) IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1') Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'1','2') END IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1') BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 2 where CharID=@CharID And JopType='1' END END
/* 5 Star Section */ IF (@JobType = '1' AND @Contri BETWEEN '208120' And '384780') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_5Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_5Star,@Num_1_5Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_5Star,@Num_2_5Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_5Star,@Num_3_5Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 5, ur point now increased +3',Getdate()) IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1') Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'1','3') END IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='1') BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 3 where CharID=@CharID And JopType='1' END END ---------- End Trader System ---------------------- ----------- Start Hunter System ---------------------- Set @Points = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3') Select @Reqlevel=Curlevel , @Reward_1_3Star=Reward_1_3Star ,@Num_1_3Star=Num_1_3Star ,@Reward_2_3Star=Reward_2_3Star,@Num_2_3Star=Num_2_3Star ,@Reward_3_3Star=Reward_3_3Star,@Num_3_3Star=Num_3_3Star ,@Reward_1_4Star=Reward_1_4Star ,@Num_1_4Star=Num_1_4Star ,@Reward_2_4Star=Reward_2_4Star,@Num_2_4Star=Num_2_4Star ,@Reward_3_4Star=Reward_3_4Star,@Num_3_4Star=Num_3_4Star,@Gold_3Star = Gold_3Star,@Gold_4Star = Gold_4Star,@Gold_5Star = Gold_5Star ,@Reward_1_5Star=Reward_1_5Star ,@Num_1_5Star=Num_1_5Star ,@Reward_2_5Star=Reward_2_5Star,@Num_2_5Star=Num_2_5Star ,@Reward_3_5Star=Reward_3_5Star,@Num_3_5Star=Num_3_5Star,@Gold_2Star = Gold_2Star ,@Reward_1_2Star=Reward_1_2Star ,@Num_1_2Star=Num_1_2Star ,@Reward_2_2Star=Reward_2_2Star,@Num_2_2Star=Num_2_2Star ,@Reward_3_2Star=Reward_3_2Star,@Num_3_2Star=Num_3_2Star,@Gold_1Star = Gold_1Star ,@Reward_1_1Star=Reward_1_1Star ,@Num_1_1Star=Num_1_1Star ,@Reward_2_1Star=Reward_2_1Star,@Num_2_1Star=Num_2_1Star ,@Reward_3_1Star=Reward_3_1Star,@Num_3_1Star=Num_3_1Star From [SRO_VT_SHARDLOG].[dbo].[Job_Reward] where JopType='3' /* 1 Star Section */ IF (@JobType = '3' AND @Contri BETWEEN '1776' And '35520') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_1Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_1Star,@Num_1_1Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_1Star,@Num_2_1Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_1Star,@Num_3_1Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 1, ur points not increased',Getdate()) END
/* 2 Star Section */ IF (@JobType = '3' AND @Contri BETWEEN '37296' And '63936') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_2Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_2Star,@Num_1_2Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_2Star,@Num_2_2Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_2Star,@Num_3_2Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 2, ur points not increased',Getdate()) END
/* 3 Star Section */ IF (@JobType = '3' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '65712' And '101232') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_3Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_3Star,@Num_1_3Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_3Star,@Num_2_3Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_3Star,@Num_3_3Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 3, ur point now increased +1',Getdate()) IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3') Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'3','1') END IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3') BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 1 where CharID=@CharID And JopType='3' END END /* 4 Star Section */ IF (@JobType = '3' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '103008' And '150960') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_4Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_4Star,@Num_1_4Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_4Star,@Num_2_4Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_4Star,@Num_3_4Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 4, ur point now increased +2',Getdate()) IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3') Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'3','2') END IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3') BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 2 where CharID=@CharID And JopType='3' END END /* 5 Star Section */ IF (@JobType = '3' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '152736' And '282384') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_5Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_5Star,@Num_1_5Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_5Star,@Num_2_5Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_5Star,@Num_3_5Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 5, ur point now increased +3',Getdate()) IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3') Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'3','3') END IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='3') BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 3 where CharID=@CharID And JopType='3' END END ----------- End Hunter System ------------------------
----------- Start Thieves System ---------------------- Set @Points = (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2') Select @Reqlevel=Curlevel , @Reward_1_3Star=Reward_1_3Star ,@Num_1_3Star=Num_1_3Star ,@Reward_2_3Star=Reward_2_3Star,@Num_2_3Star=Num_2_3Star ,@Reward_3_3Star=Reward_3_3Star,@Num_3_3Star=Num_3_3Star ,@Reward_1_4Star=Reward_1_4Star ,@Num_1_4Star=Num_1_4Star ,@Reward_2_4Star=Reward_2_4Star,@Num_2_4Star=Num_2_4Star ,@Reward_3_4Star=Reward_3_4Star,@Num_3_4Star=Num_3_4Star,@Gold_3Star = Gold_3Star,@Gold_4Star = Gold_4Star,@Gold_5Star = Gold_5Star ,@Reward_1_5Star=Reward_1_5Star ,@Num_1_5Star=Num_1_5Star ,@Reward_2_5Star=Reward_2_5Star,@Num_2_5Star=Num_2_5Star ,@Reward_3_5Star=Reward_3_5Star,@Num_3_5Star=Num_3_5Star,@Gold_2Star = Gold_2Star ,@Reward_1_2Star=Reward_1_2Star ,@Num_1_2Star=Num_1_2Star ,@Reward_2_2Star=Reward_2_2Star,@Num_2_2Star=Num_2_2Star ,@Reward_3_2Star=Reward_3_2Star,@Num_3_2Star=Num_3_2Star,@Gold_1Star = Gold_1Star ,@Reward_1_1Star=Reward_1_1Star ,@Num_1_1Star=Num_1_1Star ,@Reward_2_1Star=Reward_2_1Star,@Num_2_1Star=Num_2_1Star ,@Reward_3_1Star=Reward_3_1Star,@Num_3_1Star=Num_3_1Star From [SRO_VT_SHARDLOG].[dbo].[Job_Reward] where JopType='2' /* 1 Star Section */ IF (@JobType = '2' AND @Contri BETWEEN '6128' And '122560') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_1Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_1Star,@Num_1_1Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_1Star,@Num_2_1Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_1Star,@Num_3_1Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 1, ur points not increased',Getdate()) END
/* 2 Star Section */ IF (@JobType = '2' AND @Contri BETWEEN '128688' And '220608') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_2Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_2Star,@Num_1_2Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_2Star,@Num_2_2Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_2Star,@Num_3_2Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 2, ur points not increased',Getdate()) END
/* 3 Star Section */ IF (@JobType = '2' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '226736' And '349296') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_3Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_3Star,@Num_1_3Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_3Star,@Num_2_3Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_3Star,@Num_3_3Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 3, ur point now increased +1',Getdate()) IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2') Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'2','1') END IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2') BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 1 where CharID=@CharID And JopType='2' END END /* 4 Star Section */ IF (@JobType = '2' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '355424' And '520880') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_4Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_4Star,@Num_1_4Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_4Star,@Num_2_4Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_4Star,@Num_3_4Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 4, ur point now increased +2',Getdate()) IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2') Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'2','2') END IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2') BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 2 where CharID=@CharID And JopType='2' END END /* 5 Star Section */ IF (@JobType = '2' AND @CurLevel >= @Reqlevel AND @Contri BETWEEN '527008' And '974352') BEGIN UPDATE SRO_VT_SHARD.dbo._CharTrijob SET Contribution = '0' WHERE CharID = @CharID UPDATE [SRO_VT_SHARD].[dbo].[_Char] Set RemainGold = @Remaingold + @Gold_5Star where CharID=@CharID EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_1_5Star,@Num_1_5Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_2_5Star,@Num_2_5Star,0 EXEC [SRO_VT_SHARD].[dbo].[_ADD_ITEM_EXTERN] @CharName,@Reward_3_5Star,@Num_3_5Star,0 UPDATE [SRO_VT_SHARD].[dbo].[_CharTrijob] SET Contribution = '0' WHERE CharID = @CharID Insert Into [SRO_VT_SHARDLOG].[dbo].[iLegend_Tool] (Service,Type,Target,Message,Date) Values (1,'Private',@CharName,'u have achieved star 5, ur point now increased +3',Getdate()) IF Not EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2') Begin Insert Into [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] ([CharID],[Charname],[JopType],[Points]) Values (@CharID,@CharName,'2','3') END IF EXISTS (Select Points From [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] where CharID=@CharID And JopType='2') BEGIN UPDATE [SRO_VT_SHARDLOG].[dbo].[JobRewardLog] Set charname=@Charname , Points=@Points + 3 where CharID=@CharID And JopType='2' END END ----------- End Thieves System ------------------------
و طبعا addlogchar
لا سيسنم شغال ومفهوش مشاكل لما ارجع انشاء الله من السفر
هعمل فيدبو ازاي تضيفو صح
التعديل الأخير تم بواسطة elbattawy1st ; 20-04-2016 الساعة 07:07 AM
المشاركة الأصلية كتبت بواسطة Jayden
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
تسلم يا كبير .. مجهودك واضح ما شاء الله
مع ان فى Procedure اسرع من كده وده بالنسباله بطىء جدا بس تشكر على موضوعك
شكراا لمرورك
فى بروسيدور الاسرع انت قصدك الا هوا مستخدم فية Case when then
؟؟؟
وبرضو لو مكنتش عملت declares و select لتابل بتاع Reward
كان ممكن يكون اقل من كده يعنى كنت ممكن اعملو فى 5 سطور بكتير بس فى ناس مش بتعرف تعدل فى البروسيدور و انا كنت اولهم لما كنت باخد جاجة من على النت مكنتش بعرف اعدل على البروسيدور علشان
كده حبيت اسهل الموضوع على الناس
وانشاء الله فى اى system جديد هعملو هحاول اعملو يكون اسرع و اقل و شكراا للملاحظة ^_^
التعديل الأخير تم بواسطة elbattawy1st ; 22-04-2016 الساعة 11:38 AM