Release] Advanced Trading Reward]

Dev.Astro

عضو
9 يوليو 2017
21
3
6
Giza

المستوي:

150071547372521.png
[/url][/IMG]

السلام عليكم اعضاء الباشمبرمج انهرده جاي بيسيستم جميل و رائع ة هوا Trading Reward


اولا الموضوع منقول من استاذ
Sherif Jayden

اسبكو معا الشرح

مميزات السيستم

- تقدر تحدد عدد ال Rewards فى كل Star
- تقدر تخلى ال Reward ل Trade 2 Town او 1Town بس
- ال Rewards اللى موجوده هى
* Copper Coins
* Iron Coins
* Silver Coins
* Gold Coins
* Arena Coins
* Gold
* Silk
* Silk Gift
* Silk Points
* Honor Points
* Globals
* Reverse Scrolls
* Resurrection Scrolls


أول حاجة هتعمل Execute لى دى​

PHP:
USE SRO_VT_SHARDLOG 
GO 

/****** Object:  Table [dbo].[_JayTradingConfig]    Script Date: 10/10/2016 7:36:47 AM ******/ 
SET ANSI_NULLS ON 
GO 

SET QUOTED_IDENTIFIER ON 
GO 

CREATE TABLE [dbo].[_JayTradingConfig]( 
    [Star] [int] NULL, 
    [ReqLevel] [int] NULL, 
    [DefaultContributionTrader] [real] NULL, 
    [DefaultContributionThief] [real] NULL, 
    [DefaultContributionHunter] [real] NULL, 
    [CopperCoinTrader] [int] NULL, 
    [CopperCoinThief] [int] NULL, 
    [CopperCoinHunter] [int] NULL, 
    [IronCoinTrader] [int] NULL, 
    [IronCoinThief] [int] NULL, 
    [IronCoinHunter] [int] NULL, 
    [SilverCoinTrader] [int] NULL, 
    [SilverCoinThief] [int] NULL, 
    [SilverCoinHunter] [int] NULL, 
    [GoldCoinTrader] [int] NULL, 
    [GoldCoinThief] [int] NULL, 
    [GoldCoinHunter] [int] NULL, 
    [ArenaCoinTrader] [int] NULL, 
    [ArenaCoinThief] [int] NULL, 
    [ArenaCoinHunter] [int] NULL, 
    [SilkTrader] [int] NULL, 
    [SilkThief] [int] NULL, 
    [SilkHunter] [int] NULL, 
    [SilkGiftTrader] [int] NULL, 
    [SilkGiftThief] [int] NULL, 
    [SilkGiftHunter] [int] NULL, 
    [SilkPointTrader] [int] NULL, 
    [SilkPointThief] [int] NULL, 
    [SilkPointHunter] [int] NULL, 
    [GoldTrader] [int] NULL, 
    [GoldThief] [int] NULL, 
    [GoldHunter] [int] NULL, 
    [GlobalTrader] [int] NULL, 
    [GlobalThief] [int] NULL, 
    [GlobalHunter] [int] NULL, 
    [ReverseTrader] [int] NULL, 
    [ReverseThief] [int] NULL, 
    [ReverseHunter] [int] NULL, 
    [ResurrectionTrader] [int] NULL, 
    [ResurrectionThief] [int] NULL, 
    [ResurrectionHunter] [int] NULL, 
    [HonorPointTrader] [int] NULL, 
    [HonorPointThief] [int] NULL, 
    [HonorPointHunter] [int] NULL 
) ON [PRIMARY] 

GO
هتعملك Table بالشكل ده
[
IMG]
الرابط مخفي تسجيل الدخول او تسجيل !!
[/IMG]
150071590735922.png
[/url][/img][/url][/IMG]
150071590750613.png
[/url][/IMG]
150071590768594.png
[/url][/IMG]

و تعمل Execute لى دى كمان

PHP:
USE SRO_VT_SHARDLOG 
GO 
/****** Object:  StoredProcedure [dbo].[_JayTradingReward]    Script Date: 10/10/2016 1:20:08 AM ******/ 
SET ANSI_NULLS ON 
GO 
SET QUOTED_IDENTIFIER ON 
GO 
-- ============================================= 
-- Author:        Jayden 
-- Create date: 10-10-2016 
-- Description:    Giving reward after trade 
-- ============================================= 
CREATE 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 = 1 WHERE CHarID = @CharID 
            END

ثانى حاجة

هتفتح ال Table اللى عملناها دى
بص على اول عمودين هتلاقيهم فاضين
هتحط فى اول عمود زى مانا عامل فى الصورة كده
وتانى عمود ده تحط ال Level اللى انت عايزه يكون مطلوب عشان السيستم ده يشتغل ( لو واحد اقل من ال Level ده السيستم مش هيتطبق عليه ) انا عامل مثال هنا لفل 110
150071628279721.png
[/url][/CENTER][/IMG]
ثالث حاجة

عايزك تركز معايا هنا اوى
دلوقتى السيستم ده فيه حسبه كده بيحسب على اساسها .. هتقولى بيحسب ايه
بص يا سيىدى دلوقتى الداتابيز مفهاش حاجة تعرفنا ال Trade ده كام Star عشان كده انا عملتلها حسبه
فأنت هتحتاج تعمل حاجة بسيطة عشان السيستم يشتغل
أولا تشوف انت عايز مثلا لو السيستم هيدى 5 Arena Coin للى يعمل Trade من Jangan ل Hotan
يعنى كده 2 Towns
ولا عايز الكلام ده يبقى على 1 Town بس
فلنفترض انت عايز على 1 Town بس فأنت هتدخل الجيم وتجيب Trade 5 Star متنساااااش 5 Star إملاه على الاخر
وتوديه لل Town التانية فلنفترض انت جايبه من Jangan يبىقى توديه Donwhang
هتقولى وانا هعد أمشى لحد هناك ؟!
لا يا كبير هتفتح ال Console وتكتب​
HTML:
[CENTER]/movetonpc NPC_WC_SPECIAL[/CENTER]

هتلاقى نفسك هناك .. تبيع الحاجة اللى معاك وبعدين تستخدم ال Query دى

PHP:
USE SRO_VT_SHARDLOG 
DECLARE --Author : Jayden 
----------------------------------------------------------------------------------- 
        @CN varchar(max) = 'Jayden'      --Write your Character name 
----------------------------------------------------------------------------------- 


/* **** IMPORTANT **** 
NOTE: Make sure of  
-Your Job Type whether it was (Trader or Thief Or Hunter) 
-Your trade is 5 star 
*/ 
---- Don't do anything here ---- 
  DECLARE  @JobType int = (select  JobType FROM SRO_VT_SHARD.._CharTrijob WHERE CharID in 
(select CharID from SRO_VT_SHARD.._Char WHERE Charname16 = @CN))  
DECLARE @Contribution int = (SELECT Contribution FROM SRO_VT_SHARD.._CharTrijob WHERE CharID in 
(select CharID from SRO_VT_SHARD.._Char WHERE Charname16 = @CN)) 
IF @JobType = 1 
BEGIN 
Update _JayTradingConfig SET DefaultContributionTrader = @Contribution WHERE Star = 5 
Update _JayTradingConfig SET DefaultContributionTrader = @Contribution - (@Contribution * 20/100) where Star = 4  
Update _JayTradingConfig SET DefaultContributionTrader = @Contribution - (@Contribution * 40/100) where Star = 3 
Update _JayTradingConfig SET DefaultContributionTrader = @Contribution - (@Contribution * 60/100) where Star = 2  
Update _JayTradingConfig SET DefaultContributionTrader = @Contribution - (@Contribution * 80/100) where Star = 1  
END 
IF @JobType = 2 
BEGIN 
Update _JayTradingConfig SET DefaultContributionThief = @Contribution WHERE Star = 5 
Update _JayTradingConfig SET DefaultContributionThief = @Contribution - (@Contribution * 20/100) where Star = 4  
Update _JayTradingConfig SET DefaultContributionThief = @Contribution - (@Contribution * 40/100) where Star = 3 
Update _JayTradingConfig SET DefaultContributionThief = @Contribution - (@Contribution * 60/100) where Star = 2  
Update _JayTradingConfig SET DefaultContributionThief = @Contribution - (@Contribution * 80/100) where Star = 1  
END 
IF @JobType = 3 
BEGIN 
Update _JayTradingConfig SET DefaultContributionHunter = @Contribution WHERE Star = 5 
Update _JayTradingConfig SET DefaultContributionHunter = @Contribution - (@Contribution * 20/100) where Star = 4  
Update _JayTradingConfig SET DefaultContributionHunter = @Contribution - (@Contribution * 40/100) where Star = 3 
Update _JayTradingConfig SET DefaultContributionHunter = @Contribution - (@Contribution * 60/100) where Star = 2  
Update _JayTradingConfig SET DefaultContributionHunter = @Contribution - (@Contribution * 80/100) where Star = 1  
END

كل اللى عليك فيها انك تكتب اسم ال Character اللى انت سلمت بيها ال Trade
طب ايه ده يا عم ايه ال Query دى انت بتبوظلى الداتابيز ولا ايه
لا يا عم مش ببوظلك الداتابيز ال Query دى كده كتبت الحسبة المطلوبة فى ال Table بتاعتنا
زى كده​

150071642753741.png
[/url][/CENTER][/IMG]
تمام لحد كده
دلوقتى لو لاحظت فى الصورة الحسبة اتحطت لل Trader بس
فأنت هتعمل نفس الكلام بس تفتح Character الجوب بتاعها Thief وواحدة تانية Hunter وتعمل معاهم نفس الكلام بالظبط
وتستخدم برضو نفس ال Query

كده ظبطنا الحسبة وكده السيستم جاهز لإنه يشتغل معاك زى الفل
أخر حاجة هتضيف ديه فى AddLogChar_

PHP:
IF @EventID = 6  
BEGIN 
EXEC _JayTradingReward @CharID 
END

وده سيستم ال Anti Cheat بتاع ال Thief
هتضيف دى فى AddLogitem_

PHP:
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
ملحوظات
- ال Player مش هيجيلو حاجة الا لما يعمل Restart ودى معموله كده عشان لو عملتها مع ال Teleport السيرفر هيبقى فيه لاج كبير وخاصة مع السيرفرات اللى فيها اعداد كبيرة
- الحسبة اللى عملناها فوق مش هتكون مظبوطة اوى لانها حسبة Joymax عاملها Hardcoded فى ال Gameserver فهى بتعملها تقريبية .. فأنت لو عايز الحسبة تبقى تمام بالظبط هتطلع Trade 1 Star وبعدين 2 Star وهكذا وكل ما تطلع Trade تجيب ال Contribution من CharTrijob_
هسهل عليك الدنيا .. استخدم ال Query دى لما تطلع اى Trade من اللى قولنا عليهم دول​
PHP:
[CENTER]USE SRO_VT_SHARD 
SELECT Contribution FROM _CharTrijob WHERE CharID in 
(SELECT CharID FROM _Char WHERE Charname16 = 'Char Name'[/CENTER])
هيطلعلك رقم الرقم ده تحطه فى ال Table بتاعتنا
بس انا عملت الحسبة التقريبية دى عشان الناس اللى مكسلة تعمل اللى قولت عليه ده​

وكده خلاص مبروك عليك :emoji33::emoji19:
 




Dev.Astro

عضو
9 يوليو 2017
21
3
6
Giza

المستوي:

رد: Release] Advanced Trading Reward]

thief - hunter reward مش شغلين وي trade لو عملت 1 star كل ما تقفل اميل و تفتح هيجيلك كوين او سيلك علي ما انت عامل جربته ناس كتير جربته صاحب الموضوع ما بيردش

حضرتك انا قبل ما بنزل الموضوع او بنقلو بجربو و انا جربت النظام وشغال و انتا هتلقيك نسيت حاجه تعملها راجع الخطوات و انشاء الله هتتحلل
 




TheBold

عضو
21 نوفمبر 2017
62
4
5
11
Bolak El Dakrour - Giza

المستوي:

رد: Release] Advanced Trading Reward]

الله ينور و يا رايت ترفع الصور من تاني
و مشكور جداً على توضيحاتك بس فيه سيستم احسن من دة شوفته في منتدى تاني
كان الاولى تجيب التاني لانه اوفر عليك في الشرح .. و تقبل مروري