طيب انا في الوقت الحالي عملت كل ال contributions
و برضو مش بيجي اي reward
و دا باقي ال Query's اللي عملتها و معموله ب المنظر دا
-- _JayTradingReward --
كود بلغة HTML:
USE [SRO_VT_LOG]
GO
/****** Object: StoredProcedure [dbo].[_JayTradingReward] Script Date: 5/19/2021 8:18:58 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Jayden
-- Create date: 10-10-2016
-- Description: Giving reward after trade
-- =============================================
ALTER PROCEDURE [dbo].[_JayTradingReward]
@CharID INT
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
--DECLARES
DECLARE @CL INT, @JID int,@JT TINYINT,@CN varchar(128),@RL int,@CNT real,@DCT real,@DCF real,@DCH real,@CCT int,@CCF int,@CCH int,@ICT int,@ICF int,
@ICH int,@SCT int,@SCF int,@SCH int,@GCT int,@GCF int,@GCH int,@ACT int,@ACF int,@ACH int,@SKT int,@SKF int,@SKH int,@SGT int,@SGF int,
@SGH int,@SPT int,@SPF int,@SPH int,@GT int,@GF int,@GH int,@GLT int,@GLF int,@GLH int,@RET int,@REF int,@REH int,@RST int,@RSF int,@RSH int,@HNT int,@HNF int,@HNH int
DECLARE @CampID int = (SELECT CampID from SRO_VT_SHARD.._TrainingCampMember WHERE CharID = @CharID)
SELECT @CN = Charname16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID
SELECT @CL = C.CurLevel,@JID = U.UserJID,@JT = J.JobType,@CNT = J.Contribution
FROM SRO_VT_SHARD.._Char C INNER JOIN SRO_VT_SHARD.._CharTrijob J ON J.CharID = C.CharID
INNER JOIN SRO_VT_SHARD.._User U ON U.CharID = C.CharID WHERE C.CharID = @CharID
/*Not any shit*/
IF @JT = 0 BEGIN RETURN END ELSE
DECLARE @Star int
/* Calculating Shit */
--Trader
IF @JT = 1
BEGIN
DECLARE @DCT1 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 1)
, @DCT2 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 2)
, @DCT3 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 3)
, @DCT4 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 4)
, @DCT5 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 5)
BEGIN
IF @CNT <= @DCT1 BEGIN SET @Star = 1 END
ELSE IF @CNT <= @DCT2 and @CNT > @DCT1 BEGIN SET @Star = 2 END
ELSE IF @CNT <= @DCT3 and @CNT > @DCT2 BEGIN SET @Star = 3 END
ELSE IF @CNT <= @DCT4 and @CNT > @DCT3 BEGIN SET @Star = 4 END
ELSE IF @CNT <= @DCT5 and @CNT > @DCT4 BEGIN SET @Star = 5 END
END END
-- Thief
ELSE IF @JT = 1
BEGIN
DECLARE @DCF1 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 1)
, @DCF2 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 2)
, @DCF3 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 3)
, @DCF4 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 4)
, @DCF5 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 5)
BEGIN
IF @CNT <= @DCF1 BEGIN SET @Star = 1 END
ELSE IF @CNT <= @DCF2 and @CNT > @DCF1 BEGIN SET @Star = 2 END
ELSE IF @CNT <= @DCF3 and @CNT > @DCF2 BEGIN SET @Star = 3 END
ELSE IF @CNT <= @DCF4 and @CNT > @DCF3 BEGIN SET @Star = 4 END
ELSE IF @CNT <= @DCF5 and @CNT > @DCF4 BEGIN SET @Star = 5 END
END END
-- Hunter
ELSE IF @JT = 1
BEGIN
DECLARE @DCH1 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 1)
, @DCH2 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 2)
, @DCH3 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 3)
, @DCH4 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 4)
, @DCH5 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 5)
BEGIN
IF @CNT <= @DCH1 BEGIN SET @Star = 1 END
ELSE IF @CNT <= @DCH2 and @CNT > @DCH1 BEGIN SET @Star = 2 END
ELSE IF @CNT <= @DCH3 and @CNT > @DCH2 BEGIN SET @Star = 3 END
ELSE IF @CNT <= @DCH4 and @CNT > @DCH3 BEGIN SET @Star = 4 END
ELSE IF @CNT <= @DCH5 and @CNT > @DCH4 BEGIN SET @Star = 5 END
END END
SELECT @RL = ReqLevel,@DCT = DefaultContributionTrader,@DCF=DefaultContributionThief,@DCH=DefaultContributionHunter
,@CCT=CopperCoinTrader,@CCF=CopperCoinThief,@CCH=CopperCoinHunter,@ICT=IronCoinTrader,@ICF=IronCoinThief,@ICH=IronCoinHunter
,@SCT=SilverCoinTrader,@SCF=SilverCoinThief,@SCH=SilverCoinHunter,@GCT=GoldCoinTrader,@GCF=GoldCoinThief
,@GCH=GoldCoinHunter,@ACT=ArenaCoinTrader,@ACF=ArenaCoinThief,@ACH=ArenaCoinHunter,@SKT=SilkTrader,@SKF=SilkThief
,@SKH=SilkHunter,@SGT=SilkGiftTrader,@SGF=SilkGiftThief,@SGH=SilkGiftHunter,@SPT=SilkPointTrader,@SPF=SilkPointThief
,@SPH=SilkPointHunter,@GT=GoldTrader,@GF=GoldThief,@GH=GoldHunter,@GLT=GlobalTrader,@GLF=GlobalThief
,@GLH=GlobalHunter,@RET=ReverseTrader,@REF=ReverseThief,@REH=ReverseHunter,@RST=ResurrectionTrader
,@RSF=ResurrectionThief,@RSH=ResurrectionHunter,@HNT=HonorPointTrader,@HNF=HonorPointThief,@HNH=HonorPointHunter
FROM _JayTradingConfig WHERE Star = @Star
/* Rewarding */
-- Trader
IF @JT = 1 AND @CL = @RL
BEGIN
IF @CCT IS NOT NULL OR @CCT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_01',@CCT,0 END
IF @ICT IS NOT NULL OR @ICT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_02',@ICT,0 END
IF @SCT IS NOT NULL OR @SCT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_03',@SCT,0 END
IF @GCT IS NOT NULL OR @GCT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_04',@GCT,0 END
IF @ACT IS NOT NULL OR @ACT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_ARENA_COIN',@ACT,0 END
IF @SKT IS NOT NULL OR @SKT != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_own = silk_own + @SKT WHERE JID = @JID END
IF @SGT IS NOT NULL OR @SGT != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_gift = silk_gift + @SGT WHERE JID = @JID END
IF @SPT IS NOT NULL OR @SPT != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_point = silk_point + @SPT WHERE JID = @JID END
IF @GT IS NOT NULL OR @GT != 0 BEGIN UPDATE SRO_VT_SHARD.._Char SET RemainGold = RemainGold + @GT END
IF @GLT IS NOT NULL OR @GLT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_GLOBAL_CHATTING',@GLT,0 END
IF @RET IS NOT NULL OR @RET != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_REVERSE_RETURN_SCROLL',@RET,0 END
IF @RST IS NOT NULL OR @RST != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_RESURRECTION_100P_SCROLL',@RST,0 END
IF @HNT IS NOT NULL OR @HNT != 0 BEGIN
IF @CampID IS NULL or @CampID = 0
BEGIN EXEC SRO_VT_SHARD.._TRAINING_CAMP_CREATE @CharID END
ELSE IF @CampID IS NOT NULL or @CampID != 0 BEGIN
Update SRO_VT_SHARD.._TrainingCamp SET GraduateCount = GraduateCount +1 , EvaluationPoint = EvaluationPoint +1 WHERE ID = @CampID END END
END
--Thief
IF @JT = 2 AND @CL = @RL
BEGIN
IF @CCF IS NOT NULL OR @CCF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_01',@CCF,0 END
IF @ICF IS NOT NULL OR @ICF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_02',@ICF,0 END
IF @SCF IS NOT NULL OR @SCF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_03',@SCF,0 END
IF @GCF IS NOT NULL OR @GCF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_04',@GCF,0 END
IF @ACF IS NOT NULL OR @ACF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_ARENA_COIN',@ACF,0 END
IF @SKF IS NOT NULL OR @SKF != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_own = silk_own + @SKF WHERE JID = @JID END
IF @SGF IS NOT NULL OR @SGF != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_gift = silk_gift + @SGF WHERE JID = @JID END
IF @SPF IS NOT NULL OR @SPF != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_point = silk_point + @SPF WHERE JID = @JID END
IF @GF IS NOT NULL OR @GF != 0 BEGIN UPDATE SRO_VT_SHARD.._Char SET RemainGold = RemainGold + @GF END
IF @GLF IS NOT NULL OR @GLF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_GLOBAL_CHATTING',@GLF,0 END
IF @REF IS NOT NULL OR @REF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_REVERSE_RETURN_SCROLL',@REF,0 END
IF @RSF IS NOT NULL OR @RSF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_RESURRECTION_100P_SCROLL',@RSF,0 END
IF @HNF IS NOT NULL OR @HNF != 0 BEGIN IF @CampID IS NULL or @CampID = 0 BEGIN EXEC SRO_VT_SHARD.._TRAINING_CAMP_CREATE @CharID END
ELSE IF @CampID IS NOT NULL or @CampID != 0 BEGIN
Update SRO_VT_SHARD.._TrainingCamp SET GraduateCount = GraduateCount +1 , EvaluationPoint = EvaluationPoint +1 WHERE ID = @CampID END END
END
--Hunter
IF @JT = 3 AND @CL = @RL
BEGIN
IF @CCH IS NOT NULL OR @CCH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_01',@CCH,0 END
IF @ICH IS NOT NULL OR @ICH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_02',@ICH,0 END
IF @SCH IS NOT NULL OR @SCH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_03',@SCH,0 END
IF @GCH IS NOT NULL OR @GCH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_04',@GCH,0 END
IF @ACH IS NOT NULL OR @ACH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_ARENA_COIN',@ACH,0 END
IF @SKH IS NOT NULL OR @SKH != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_own = silk_own + @SKH WHERE JID = @JID END
IF @SGH IS NOT NULL OR @SGH != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_gift = silk_gift + @SGH WHERE JID = @JID END
IF @SPH IS NOT NULL OR @SPH != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_point = silk_point + @SPH WHERE JID = @JID END
IF @GH IS NOT NULL OR @GH != 0 BEGIN UPDATE SRO_VT_SHARD.._Char SET RemainGold = RemainGold + @GH END
IF @GLH IS NOT NULL OR @GLH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_GLOBAL_CHATTING',@GLH,0 END
IF @REH IS NOT NULL OR @REH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_REVERSE_RETURN_SCROLL',@REH,0 END
IF @RSH IS NOT NULL OR @RSH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_RESURRECTION_100P_SCROLL',@RSH,0 END
IF @HNH IS NOT NULL OR @HNH != 0 BEGIN
IF @CampID IS NULL or @CampID = 0 BEGIN EXEC SRO_VT_SHARD.._TRAINING_CAMP_CREATE @CharID END
ELSE IF @CampID IS NOT NULL or @CampID != 0 BEGIN
Update SRO_VT_SHARD.._TrainingCamp SET GraduateCount = GraduateCount +1 , EvaluationPoint = EvaluationPoint +1 WHERE ID = @CampID END END
END
UPDATE SRO_VT_SHARD.._CharTriJob SET Contribution = 0 WHERE CHarID = @CharID
END
-- _AddLogChar --
كود بلغة HTML:
USE [SRO_VT_LOG]
GO
/****** Object: StoredProcedure [dbo].[_AddLogChar] Script Date: 5/19/2021 8:20:13 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[_AddLogChar]
@CharID int,
@EventID tinyint,
@Data1 int,
@Data2 int,
@strPos varchar(64),
@Desc varchar(128)
as
declare @len_pos int
declare @len_desc int
set @len_pos = len(@strPos)
set @len_desc = len(@Desc)
if (@len_pos > 0 and @len_desc > 0)
begin
return -1
end
else if (@len_pos > 0 and @len_desc = 0)
begin
return -2
end
else if (@len_pos = 0 and @len_desc > 0)
begin
return -3
end
else
begin
return -4
end
-- Trade Coin
IF @EventID = 6
BEGIN
EXEC _JayTradingReward @CharID
END
--_AddLogItem --
كود بلغة HTML:
USE [SRO_VT_LOG]
GO
/****** Object: StoredProcedure [dbo].[_AddLogItem] Script Date: 5/19/2021 8:20:25 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-------------------------------------------------------------------------------------------------------------------
-- Step 2
-- ±âأپ¸ ¾أ†أ€أŒأ…أ› ·أژ±× أ€أ”·أ‚ Stored procedure ¼أ¶أپ¤
-- DataBase : Shard Log
ALTER procedure [dbo].[_AddLogItem]
@CharID int,
@ItemRefID int,
@ItemSerial bigint,
@dwData int,
@TargetStorage tinyint,
@Operation tinyint,
@Slot_From tinyint,
@Slot_To tinyint,
@EventPos varchar(64),
@strDesc varchar(128),
@Gold bigint -- #ifdef EXTEND_GOLD_TYPE »ؤںأ€أ”
as
declare @len_pos int
declare @len_desc int
set @len_pos = len(@EventPos)
set @len_desc = len(@strDesc)
if (@len_pos > 0 and @len_desc > 0)
begin
return -1
end
else if (@len_pos > 0 and @len_desc = 0)
begin
return -1
end
else if (@len_pos = 0 and @len_desc > 0)
begin
return -1
end
else if (@len_pos = 0 and @len_desc = 0)
begin
return -1
end
-- أ€¯·أ، ¾أ†أ€أŒأ…أ› ±¸أ€أ”أ€أŒ¸é!
-- #define LOG_ITEMEVENT_BUY_CASHITEM (BYTE)35
if (@Operation = 35)
begin
return -1
end
-- Thief anti cheat
IF (@Operation = 41)
BEGIN
IF (@ItemRefID = 2128) -- Bandit den return scroll (ITEM_ETC_SCROLL_RETURN_THIEFDEN_01), will work only when MaxStack is 1
BEGIN
/*
* Get latest region of character
*/
DECLARE @IsBattleField BIT
SELECT @IsBattleField = IsBattleField
FROM [SRO_VT_SHARD].[dbo].[_Char]
INNER JOIN [SRO_VT_SHARD].[dbo].[_RefRegion]
ON [SRO_VT_SHARD].[dbo].[_Char].LatestRegion = [SRO_VT_SHARD].[dbo].[_RefRegion].wRegionID
WHERE [SRO_VT_SHARD].[dbo].[_Char].CharID = @CharID
/*
* Scroll is used inside town
*/
IF (@IsBattleField = 0)
BEGIN
DECLARE @COSID BIGINT
DECLARE @ReFCharID INT
DECLARE @TypeID4 INT
/*
* Get any summoned COS by current character
*
* It's actually fine not to use CURSOR, so far I noticed that any summoned COS
* won't set "OwnerCharID", except for transport COS.
* But just to be sure, I put CURSOR in use.
*/
SET NOCOUNT ON;
DECLARE CurCOS CURSOR FOR SELECT ID, RefCharID FROM [SRO_VT_SHARD].[dbo].[_CharCOS] WHERE OwnerCharID = @CharID ORDER BY ID ASC;
OPEN CurCOS;
FETCH NEXT FROM CurCOS INTO @COSID, @ReFCharID;
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @TypeID4 = TypeID4 FROM [SRO_VT_SHARD].[dbo].[_RefObjCommon] WHERE ID = @ReFCharID
/*
* If current COS is a transport COS, erase all items
* TypeID4 = 2 = Transport COS
*/
IF (@TypeID4 = 2)
BEGIN
UPDATE [SRO_VT_SHARD].[dbo].[_InvCOS] SET ItemID = 0 WHERE COSID = @COSID
END
FETCH NEXT FROM CurCOS INTO @COSID, @ReFCharID;
END;
CLOSE CurCOS;
DEALLOCATE CurCOS;
END
END
END
في عندي ف ال Procedure جايب ب المنظر دا invalid column name و دا اللي اعتقد مسبب مشكله
التعديل الأخير تم بواسطة DenDaryYy ; 19-05-2021 الساعة 09:29 AM
المشاركة الأصلية كتبت بواسطة DenDaryYy
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
طيب انا في الوقت الحالي عملت كل ال contributions
و برضو مش بيجي اي reward
و دا باقي ال Query's اللي عملتها و معموله ب المنظر دا
-- _JayTradingReward --
كود بلغة HTML:
USE [SRO_VT_LOG]
GO
/****** Object: StoredProcedure [dbo].[_JayTradingReward] Script Date: 5/19/2021 8:18:58 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Jayden
-- Create date: 10-10-2016
-- Description: Giving reward after trade
-- =============================================
ALTER PROCEDURE [dbo].[_JayTradingReward]
@CharID INT
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
--DECLARES
DECLARE @CL INT, @JID int,@JT TINYINT,@CN varchar(128),@RL int,@CNT real,@DCT real,@DCF real,@DCH real,@CCT int,@CCF int,@CCH int,@ICT int,@ICF int,
@ICH int,@SCT int,@SCF int,@SCH int,@GCT int,@GCF int,@GCH int,@ACT int,@ACF int,@ACH int,@SKT int,@SKF int,@SKH int,@SGT int,@SGF int,
@SGH int,@SPT int,@SPF int,@SPH int,@GT int,@GF int,@GH int,@GLT int,@GLF int,@GLH int,@RET int,@REF int,@REH int,@RST int,@RSF int,@RSH int,@HNT int,@HNF int,@HNH int
DECLARE @CampID int = (SELECT CampID from SRO_VT_SHARD.._TrainingCampMember WHERE CharID = @CharID)
SELECT @CN = Charname16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID
SELECT @CL = C.CurLevel,@JID = U.UserJID,@JT = J.JobType,@CNT = J.Contribution
FROM SRO_VT_SHARD.._Char C INNER JOIN SRO_VT_SHARD.._CharTrijob J ON J.CharID = C.CharID
INNER JOIN SRO_VT_SHARD.._User U ON U.CharID = C.CharID WHERE C.CharID = @CharID
/*Not any shit*/
IF @JT = 0 BEGIN RETURN END ELSE
DECLARE @Star int
/* Calculating Shit */
--Trader
IF @JT = 1
BEGIN
DECLARE @DCT1 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 1)
, @DCT2 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 2)
, @DCT3 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 3)
, @DCT4 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 4)
, @DCT5 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 5)
BEGIN
IF @CNT <= @DCT1 BEGIN SET @Star = 1 END
ELSE IF @CNT <= @DCT2 and @CNT > @DCT1 BEGIN SET @Star = 2 END
ELSE IF @CNT <= @DCT3 and @CNT > @DCT2 BEGIN SET @Star = 3 END
ELSE IF @CNT <= @DCT4 and @CNT > @DCT3 BEGIN SET @Star = 4 END
ELSE IF @CNT <= @DCT5 and @CNT > @DCT4 BEGIN SET @Star = 5 END
END END
-- Thief
ELSE IF @JT = 1
BEGIN
DECLARE @DCF1 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 1)
, @DCF2 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 2)
, @DCF3 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 3)
, @DCF4 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 4)
, @DCF5 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 5)
BEGIN
IF @CNT <= @DCF1 BEGIN SET @Star = 1 END
ELSE IF @CNT <= @DCF2 and @CNT > @DCF1 BEGIN SET @Star = 2 END
ELSE IF @CNT <= @DCF3 and @CNT > @DCF2 BEGIN SET @Star = 3 END
ELSE IF @CNT <= @DCF4 and @CNT > @DCF3 BEGIN SET @Star = 4 END
ELSE IF @CNT <= @DCF5 and @CNT > @DCF4 BEGIN SET @Star = 5 END
END END
-- Hunter
ELSE IF @JT = 1
BEGIN
DECLARE @DCH1 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 1)
, @DCH2 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 2)
, @DCH3 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 3)
, @DCH4 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 4)
, @DCH5 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 5)
BEGIN
IF @CNT <= @DCH1 BEGIN SET @Star = 1 END
ELSE IF @CNT <= @DCH2 and @CNT > @DCH1 BEGIN SET @Star = 2 END
ELSE IF @CNT <= @DCH3 and @CNT > @DCH2 BEGIN SET @Star = 3 END
ELSE IF @CNT <= @DCH4 and @CNT > @DCH3 BEGIN SET @Star = 4 END
ELSE IF @CNT <= @DCH5 and @CNT > @DCH4 BEGIN SET @Star = 5 END
END END
SELECT @RL = ReqLevel,@DCT = DefaultContributionTrader,@DCF=DefaultContributionThief,@DCH=DefaultContributionHunter
,@CCT=CopperCoinTrader,@CCF=CopperCoinThief,@CCH=CopperCoinHunter,@ICT=IronCoinTrader,@ICF=IronCoinThief,@ICH=IronCoinHunter
,@SCT=SilverCoinTrader,@SCF=SilverCoinThief,@SCH=SilverCoinHunter,@GCT=GoldCoinTrader,@GCF=GoldCoinThief
,@GCH=GoldCoinHunter,@ACT=ArenaCoinTrader,@ACF=ArenaCoinThief,@ACH=ArenaCoinHunter,@SKT=SilkTrader,@SKF=SilkThief
,@SKH=SilkHunter,@SGT=SilkGiftTrader,@SGF=SilkGiftThief,@SGH=SilkGiftHunter,@SPT=SilkPointTrader,@SPF=SilkPointThief
,@SPH=SilkPointHunter,@GT=GoldTrader,@GF=GoldThief,@GH=GoldHunter,@GLT=GlobalTrader,@GLF=GlobalThief
,@GLH=GlobalHunter,@RET=ReverseTrader,@REF=ReverseThief,@REH=ReverseHunter,@RST=ResurrectionTrader
,@RSF=ResurrectionThief,@RSH=ResurrectionHunter,@HNT=HonorPointTrader,@HNF=HonorPointThief,@HNH=HonorPointHunter
FROM _JayTradingConfig WHERE Star = @Star
/* Rewarding */
-- Trader
IF @JT = 1 AND @CL = @RL
BEGIN
IF @CCT IS NOT NULL OR @CCT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_01',@CCT,0 END
IF @ICT IS NOT NULL OR @ICT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_02',@ICT,0 END
IF @SCT IS NOT NULL OR @SCT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_03',@SCT,0 END
IF @GCT IS NOT NULL OR @GCT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_04',@GCT,0 END
IF @ACT IS NOT NULL OR @ACT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_ARENA_COIN',@ACT,0 END
IF @SKT IS NOT NULL OR @SKT != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_own = silk_own + @SKT WHERE JID = @JID END
IF @SGT IS NOT NULL OR @SGT != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_gift = silk_gift + @SGT WHERE JID = @JID END
IF @SPT IS NOT NULL OR @SPT != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_point = silk_point + @SPT WHERE JID = @JID END
IF @GT IS NOT NULL OR @GT != 0 BEGIN UPDATE SRO_VT_SHARD.._Char SET RemainGold = RemainGold + @GT END
IF @GLT IS NOT NULL OR @GLT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_GLOBAL_CHATTING',@GLT,0 END
IF @RET IS NOT NULL OR @RET != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_REVERSE_RETURN_SCROLL',@RET,0 END
IF @RST IS NOT NULL OR @RST != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_RESURRECTION_100P_SCROLL',@RST,0 END
IF @HNT IS NOT NULL OR @HNT != 0 BEGIN
IF @CampID IS NULL or @CampID = 0
BEGIN EXEC SRO_VT_SHARD.._TRAINING_CAMP_CREATE @CharID END
ELSE IF @CampID IS NOT NULL or @CampID != 0 BEGIN
Update SRO_VT_SHARD.._TrainingCamp SET GraduateCount = GraduateCount +1 , EvaluationPoint = EvaluationPoint +1 WHERE ID = @CampID END END
END
--Thief
IF @JT = 2 AND @CL = @RL
BEGIN
IF @CCF IS NOT NULL OR @CCF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_01',@CCF,0 END
IF @ICF IS NOT NULL OR @ICF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_02',@ICF,0 END
IF @SCF IS NOT NULL OR @SCF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_03',@SCF,0 END
IF @GCF IS NOT NULL OR @GCF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_04',@GCF,0 END
IF @ACF IS NOT NULL OR @ACF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_ARENA_COIN',@ACF,0 END
IF @SKF IS NOT NULL OR @SKF != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_own = silk_own + @SKF WHERE JID = @JID END
IF @SGF IS NOT NULL OR @SGF != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_gift = silk_gift + @SGF WHERE JID = @JID END
IF @SPF IS NOT NULL OR @SPF != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_point = silk_point + @SPF WHERE JID = @JID END
IF @GF IS NOT NULL OR @GF != 0 BEGIN UPDATE SRO_VT_SHARD.._Char SET RemainGold = RemainGold + @GF END
IF @GLF IS NOT NULL OR @GLF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_GLOBAL_CHATTING',@GLF,0 END
IF @REF IS NOT NULL OR @REF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_REVERSE_RETURN_SCROLL',@REF,0 END
IF @RSF IS NOT NULL OR @RSF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_RESURRECTION_100P_SCROLL',@RSF,0 END
IF @HNF IS NOT NULL OR @HNF != 0 BEGIN IF @CampID IS NULL or @CampID = 0 BEGIN EXEC SRO_VT_SHARD.._TRAINING_CAMP_CREATE @CharID END
ELSE IF @CampID IS NOT NULL or @CampID != 0 BEGIN
Update SRO_VT_SHARD.._TrainingCamp SET GraduateCount = GraduateCount +1 , EvaluationPoint = EvaluationPoint +1 WHERE ID = @CampID END END
END
--Hunter
IF @JT = 3 AND @CL = @RL
BEGIN
IF @CCH IS NOT NULL OR @CCH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_01',@CCH,0 END
IF @ICH IS NOT NULL OR @ICH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_02',@ICH,0 END
IF @SCH IS NOT NULL OR @SCH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_03',@SCH,0 END
IF @GCH IS NOT NULL OR @GCH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_04',@GCH,0 END
IF @ACH IS NOT NULL OR @ACH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_ARENA_COIN',@ACH,0 END
IF @SKH IS NOT NULL OR @SKH != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_own = silk_own + @SKH WHERE JID = @JID END
IF @SGH IS NOT NULL OR @SGH != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_gift = silk_gift + @SGH WHERE JID = @JID END
IF @SPH IS NOT NULL OR @SPH != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_point = silk_point + @SPH WHERE JID = @JID END
IF @GH IS NOT NULL OR @GH != 0 BEGIN UPDATE SRO_VT_SHARD.._Char SET RemainGold = RemainGold + @GH END
IF @GLH IS NOT NULL OR @GLH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_GLOBAL_CHATTING',@GLH,0 END
IF @REH IS NOT NULL OR @REH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_REVERSE_RETURN_SCROLL',@REH,0 END
IF @RSH IS NOT NULL OR @RSH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_RESURRECTION_100P_SCROLL',@RSH,0 END
IF @HNH IS NOT NULL OR @HNH != 0 BEGIN
IF @CampID IS NULL or @CampID = 0 BEGIN EXEC SRO_VT_SHARD.._TRAINING_CAMP_CREATE @CharID END
ELSE IF @CampID IS NOT NULL or @CampID != 0 BEGIN
Update SRO_VT_SHARD.._TrainingCamp SET GraduateCount = GraduateCount +1 , EvaluationPoint = EvaluationPoint +1 WHERE ID = @CampID END END
END
UPDATE SRO_VT_SHARD.._CharTriJob SET Contribution = 0 WHERE CHarID = @CharID
END
-- _AddLogChar --
كود بلغة HTML:
USE [SRO_VT_LOG]
GO
/****** Object: StoredProcedure [dbo].[_AddLogChar] Script Date: 5/19/2021 8:20:13 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[_AddLogChar]
@CharID int,
@EventID tinyint,
@Data1 int,
@Data2 int,
@strPos varchar(64),
@Desc varchar(128)
as
declare @len_pos int
declare @len_desc int
set @len_pos = len(@strPos)
set @len_desc = len(@Desc)
if (@len_pos > 0 and @len_desc > 0)
begin
return -1
end
else if (@len_pos > 0 and @len_desc = 0)
begin
return -2
end
else if (@len_pos = 0 and @len_desc > 0)
begin
return -3
end
else
begin
return -4
end
-- Trade Coin
IF @EventID = 6
BEGIN
EXEC _JayTradingReward @CharID
END
--_AddLogItem --
كود بلغة HTML:
USE [SRO_VT_LOG]
GO
/****** Object: StoredProcedure [dbo].[_AddLogItem] Script Date: 5/19/2021 8:20:25 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-------------------------------------------------------------------------------------------------------------------
-- Step 2
-- ±âأپ¸ ¾أ†أ€أŒأ…أ› ·أژ±× أ€أ”·أ‚ Stored procedure ¼أ¶أپ¤
-- DataBase : Shard Log
ALTER procedure [dbo].[_AddLogItem]
@CharID int,
@ItemRefID int,
@ItemSerial bigint,
@dwData int,
@TargetStorage tinyint,
@Operation tinyint,
@Slot_From tinyint,
@Slot_To tinyint,
@EventPos varchar(64),
@strDesc varchar(128),
@Gold bigint -- #ifdef EXTEND_GOLD_TYPE »ؤںأ€أ”
as
declare @len_pos int
declare @len_desc int
set @len_pos = len(@EventPos)
set @len_desc = len(@strDesc)
if (@len_pos > 0 and @len_desc > 0)
begin
return -1
end
else if (@len_pos > 0 and @len_desc = 0)
begin
return -1
end
else if (@len_pos = 0 and @len_desc > 0)
begin
return -1
end
else if (@len_pos = 0 and @len_desc = 0)
begin
return -1
end
-- أ€¯·أ، ¾أ†أ€أŒأ…أ› ±¸أ€أ”أ€أŒ¸é!
-- #define LOG_ITEMEVENT_BUY_CASHITEM (BYTE)35
if (@Operation = 35)
begin
return -1
end
-- Thief anti cheat
IF (@Operation = 41)
BEGIN
IF (@ItemRefID = 2128) -- Bandit den return scroll (ITEM_ETC_SCROLL_RETURN_THIEFDEN_01), will work only when MaxStack is 1
BEGIN
/*
* Get latest region of character
*/
DECLARE @IsBattleField BIT
SELECT @IsBattleField = IsBattleField
FROM [SRO_VT_SHARD].[dbo].[_Char]
INNER JOIN [SRO_VT_SHARD].[dbo].[_RefRegion]
ON [SRO_VT_SHARD].[dbo].[_Char].LatestRegion = [SRO_VT_SHARD].[dbo].[_RefRegion].wRegionID
WHERE [SRO_VT_SHARD].[dbo].[_Char].CharID = @CharID
/*
* Scroll is used inside town
*/
IF (@IsBattleField = 0)
BEGIN
DECLARE @COSID BIGINT
DECLARE @ReFCharID INT
DECLARE @TypeID4 INT
/*
* Get any summoned COS by current character
*
* It's actually fine not to use CURSOR, so far I noticed that any summoned COS
* won't set "OwnerCharID", except for transport COS.
* But just to be sure, I put CURSOR in use.
*/
SET NOCOUNT ON;
DECLARE CurCOS CURSOR FOR SELECT ID, RefCharID FROM [SRO_VT_SHARD].[dbo].[_CharCOS] WHERE OwnerCharID = @CharID ORDER BY ID ASC;
OPEN CurCOS;
FETCH NEXT FROM CurCOS INTO @COSID, @ReFCharID;
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @TypeID4 = TypeID4 FROM [SRO_VT_SHARD].[dbo].[_RefObjCommon] WHERE ID = @ReFCharID
/*
* If current COS is a transport COS, erase all items
* TypeID4 = 2 = Transport COS
*/
IF (@TypeID4 = 2)
BEGIN
UPDATE [SRO_VT_SHARD].[dbo].[_InvCOS] SET ItemID = 0 WHERE COSID = @COSID
END
FETCH NEXT FROM CurCOS INTO @COSID, @ReFCharID;
END;
CLOSE CurCOS;
DEALLOCATE CurCOS;
END
END
END
في عندي ف ال Procedure جايب ب المنظر دا invalid column name و دا اللي اعتقد مسبب مشكله
خد بالك من اسم الداتا علشان معموله SRO_VT_LOG
وفي كويري انك تعمل التابل هو ده العملك المشكله
كود PHP:
USE SRO_VT_SHARDLOG
GO
/****** Object: Table [dbo].[_JayTradingConfig] Script Date: 10/10/2016 7:36:47 AM ******/
SET ANSI_NULLS ON
GO
USE [SRO_VT_LOG]
GO
/****** Object: StoredProcedure [dbo].[_JayTradingReward] Script Date: 5/19/2021 8:18:58 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Jayden
-- Create date: 10-10-2016
-- Description: Giving reward after trade
-- =============================================
ALTER PROCEDURE [dbo].[_JayTradingReward]
@CharID INT
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
--DECLARES
DECLARE @CL INT, @JID int,@JT TINYINT,@CN varchar(128),@RL int,@CNT real,@DCT real,@DCF real,@DCH real,@CCT int,@CCF int,@CCH int,@ICT int,@ICF int,
@ICH int,@SCT int,@SCF int,@SCH int,@GCT int,@GCF int,@GCH int,@ACT int,@ACF int,@ACH int,@SKT int,@SKF int,@SKH int,@SGT int,@SGF int,
@SGH int,@SPT int,@SPF int,@SPH int,@GT int,@GF int,@GH int,@GLT int,@GLF int,@GLH int,@RET int,@REF int,@REH int,@RST int,@RSF int,@RSH int,@HNT int,@HNF int,@HNH int
DECLARE @CampID int = (SELECT CampID from SRO_VT_SHARD.._TrainingCampMember WHERE CharID = @CharID)
SELECT @CN = Charname16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID
SELECT @CL = C.CurLevel,@JID = U.UserJID,@JT = J.JobType,@CNT = J.Contribution
FROM SRO_VT_SHARD.._Char C INNER JOIN SRO_VT_SHARD.._CharTrijob J ON J.CharID = C.CharID
INNER JOIN SRO_VT_SHARD.._User U ON U.CharID = C.CharID WHERE C.CharID = @CharID
/*Not any shit*/
IF @JT = 0 BEGIN RETURN END ELSE
DECLARE @Star int
/* Calculating Shit */
--Trader
IF @JT = 1
BEGIN
DECLARE @DCT1 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 1)
, @DCT2 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 2)
, @DCT3 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 3)
, @DCT4 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 4)
, @DCT5 real = (SELECT DefaultContributionTrader FROM _JayTradingConfig WHERE Star = 5)
BEGIN
IF @CNT <= @DCT1 BEGIN SET @Star = 1 END
ELSE IF @CNT <= @DCT2 and @CNT > @DCT1 BEGIN SET @Star = 2 END
ELSE IF @CNT <= @DCT3 and @CNT > @DCT2 BEGIN SET @Star = 3 END
ELSE IF @CNT <= @DCT4 and @CNT > @DCT3 BEGIN SET @Star = 4 END
ELSE IF @CNT <= @DCT5 and @CNT > @DCT4 BEGIN SET @Star = 5 END
END END
-- Thief
ELSE IF @JT = 1
BEGIN
DECLARE @DCF1 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 1)
, @DCF2 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 2)
, @DCF3 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 3)
, @DCF4 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 4)
, @DCF5 real = (SELECT DefaultContributionThief FROM _JayTradingConfig WHERE Star = 5)
BEGIN
IF @CNT <= @DCF1 BEGIN SET @Star = 1 END
ELSE IF @CNT <= @DCF2 and @CNT > @DCF1 BEGIN SET @Star = 2 END
ELSE IF @CNT <= @DCF3 and @CNT > @DCF2 BEGIN SET @Star = 3 END
ELSE IF @CNT <= @DCF4 and @CNT > @DCF3 BEGIN SET @Star = 4 END
ELSE IF @CNT <= @DCF5 and @CNT > @DCF4 BEGIN SET @Star = 5 END
END END
-- Hunter
ELSE IF @JT = 1
BEGIN
DECLARE @DCH1 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 1)
, @DCH2 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 2)
, @DCH3 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 3)
, @DCH4 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 4)
, @DCH5 real = (SELECT DefaultContributionHunter FROM _JayTradingConfig WHERE Star = 5)
BEGIN
IF @CNT <= @DCH1 BEGIN SET @Star = 1 END
ELSE IF @CNT <= @DCH2 and @CNT > @DCH1 BEGIN SET @Star = 2 END
ELSE IF @CNT <= @DCH3 and @CNT > @DCH2 BEGIN SET @Star = 3 END
ELSE IF @CNT <= @DCH4 and @CNT > @DCH3 BEGIN SET @Star = 4 END
ELSE IF @CNT <= @DCH5 and @CNT > @DCH4 BEGIN SET @Star = 5 END
END END
SELECT @RL = ReqLevel,@DCT = DefaultContributionTrader,@DCF=DefaultContributionThief,@DCH=DefaultContributionHunter
,@CCT=CopperCoinTrader,@CCF=CopperCoinThief,@CCH=CopperCoinHunter,@ICT=IronCoinTrader,@ICF=IronCoinThief,@ICH=IronCoinHunter
,@SCT=SilverCoinTrader,@SCF=SilverCoinThief,@SCH=SilverCoinHunter,@GCT=GoldCoinTrader,@GCF=GoldCoinThief
,@GCH=GoldCoinHunter,@ACT=ArenaCoinTrader,@ACF=ArenaCoinThief,@ACH=ArenaCoinHunter,@SKT=SilkTrader,@SKF=SilkThief
,@SKH=SilkHunter,@SGT=SilkGiftTrader,@SGF=SilkGiftThief,@SGH=SilkGiftHunter,@SPT=SilkPointTrader,@SPF=SilkPointThief
,@SPH=SilkPointHunter,@GT=GoldTrader,@GF=GoldThief,@GH=GoldHunter,@GLT=GlobalTrader,@GLF=GlobalThief
,@GLH=GlobalHunter,@RET=ReverseTrader,@REF=ReverseThief,@REH=ReverseHunter,@RST=ResurrectionTrader
,@RSF=ResurrectionThief,@RSH=ResurrectionHunter,@HNT=HonorPointTrader,@HNF=HonorPointThief,@HNH=HonorPointHunter
FROM _JayTradingConfig WHERE Star = @Star
/* Rewarding */
-- Trader
IF @JT = 1 AND @CL = @RL
BEGIN
IF @CCT IS NOT NULL OR @CCT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_01',@CCT,0 END
IF @ICT IS NOT NULL OR @ICT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_02',@ICT,0 END
IF @SCT IS NOT NULL OR @SCT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_03',@SCT,0 END
IF @GCT IS NOT NULL OR @GCT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_04',@GCT,0 END
IF @ACT IS NOT NULL OR @ACT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_ARENA_COIN',@ACT,0 END
IF @SKT IS NOT NULL OR @SKT != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_own = silk_own + @SKT WHERE JID = @JID END
IF @SGT IS NOT NULL OR @SGT != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_gift = silk_gift + @SGT WHERE JID = @JID END
IF @SPT IS NOT NULL OR @SPT != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_point = silk_point + @SPT WHERE JID = @JID END
IF @GT IS NOT NULL OR @GT != 0 BEGIN UPDATE SRO_VT_SHARD.._Char SET RemainGold = RemainGold + @GT END
IF @GLT IS NOT NULL OR @GLT != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_GLOBAL_CHATTING',@GLT,0 END
IF @RET IS NOT NULL OR @RET != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_REVERSE_RETURN_SCROLL',@RET,0 END
IF @RST IS NOT NULL OR @RST != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_RESURRECTION_100P_SCROLL',@RST,0 END
IF @HNT IS NOT NULL OR @HNT != 0 BEGIN
IF @CampID IS NULL or @CampID = 0
BEGIN EXEC SRO_VT_SHARD.._TRAINING_CAMP_CREATE @CharID END
ELSE IF @CampID IS NOT NULL or @CampID != 0 BEGIN
Update SRO_VT_SHARD.._TrainingCamp SET GraduateCount = GraduateCount +1 , EvaluationPoint = EvaluationPoint +1 WHERE ID = @CampID END END
END
--Thief
IF @JT = 2 AND @CL = @RL
BEGIN
IF @CCF IS NOT NULL OR @CCF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_01',@CCF,0 END
IF @ICF IS NOT NULL OR @ICF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_02',@ICF,0 END
IF @SCF IS NOT NULL OR @SCF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_03',@SCF,0 END
IF @GCF IS NOT NULL OR @GCF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_04',@GCF,0 END
IF @ACF IS NOT NULL OR @ACF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_ARENA_COIN',@ACF,0 END
IF @SKF IS NOT NULL OR @SKF != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_own = silk_own + @SKF WHERE JID = @JID END
IF @SGF IS NOT NULL OR @SGF != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_gift = silk_gift + @SGF WHERE JID = @JID END
IF @SPF IS NOT NULL OR @SPF != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_point = silk_point + @SPF WHERE JID = @JID END
IF @GF IS NOT NULL OR @GF != 0 BEGIN UPDATE SRO_VT_SHARD.._Char SET RemainGold = RemainGold + @GF END
IF @GLF IS NOT NULL OR @GLF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_GLOBAL_CHATTING',@GLF,0 END
IF @REF IS NOT NULL OR @REF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_REVERSE_RETURN_SCROLL',@REF,0 END
IF @RSF IS NOT NULL OR @RSF != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_RESURRECTION_100P_SCROLL',@RSF,0 END
IF @HNF IS NOT NULL OR @HNF != 0 BEGIN IF @CampID IS NULL or @CampID = 0 BEGIN EXEC SRO_VT_SHARD.._TRAINING_CAMP_CREATE @CharID END
ELSE IF @CampID IS NOT NULL or @CampID != 0 BEGIN
Update SRO_VT_SHARD.._TrainingCamp SET GraduateCount = GraduateCount +1 , EvaluationPoint = EvaluationPoint +1 WHERE ID = @CampID END END
END
--Hunter
IF @JT = 3 AND @CL = @RL
BEGIN
IF @CCH IS NOT NULL OR @CCH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_01',@CCH,0 END
IF @ICH IS NOT NULL OR @ICH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_02',@ICH,0 END
IF @SCH IS NOT NULL OR @SCH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_03',@SCH,0 END
IF @GCH IS NOT NULL OR @GCH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_SD_TOKEN_04',@GCH,0 END
IF @ACH IS NOT NULL OR @ACH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_ETC_ARENA_COIN',@ACH,0 END
IF @SKH IS NOT NULL OR @SKH != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_own = silk_own + @SKH WHERE JID = @JID END
IF @SGH IS NOT NULL OR @SGH != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_gift = silk_gift + @SGH WHERE JID = @JID END
IF @SPH IS NOT NULL OR @SPH != 0 BEGIN UPDATE SRO_VT_ACCOUNT..SK_Silk SET silk_point = silk_point + @SPH WHERE JID = @JID END
IF @GH IS NOT NULL OR @GH != 0 BEGIN UPDATE SRO_VT_SHARD.._Char SET RemainGold = RemainGold + @GH END
IF @GLH IS NOT NULL OR @GLH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_GLOBAL_CHATTING',@GLH,0 END
IF @REH IS NOT NULL OR @REH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_REVERSE_RETURN_SCROLL',@REH,0 END
IF @RSH IS NOT NULL OR @RSH != 0 BEGIN exec SRO_VT_SHARD.._ADD_ITEM_EXTERN @CN,'ITEM_MALL_RESURRECTION_100P_SCROLL',@RSH,0 END
IF @HNH IS NOT NULL OR @HNH != 0 BEGIN
IF @CampID IS NULL or @CampID = 0 BEGIN EXEC SRO_VT_SHARD.._TRAINING_CAMP_CREATE @CharID END
ELSE IF @CampID IS NOT NULL or @CampID != 0 BEGIN
Update SRO_VT_SHARD.._TrainingCamp SET GraduateCount = GraduateCount +1 , EvaluationPoint = EvaluationPoint +1 WHERE ID = @CampID END END
END
UPDATE SRO_VT_SHARD.._CharTriJob SET Contribution = 0 WHERE CHarID = @CharID
END
التعديل الأخير تم بواسطة Kyuubi ; 19-05-2021 الساعة 09:47 AM