Ecoin on DG

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Account Upgraded | Title Enabled! RGaming is offline
    True MemberRank
    Jul 2009 Join Date
    PronteraLocation
    468Posts

    Ecoin on DG

    Ecoin on DG
    anyone can help me how to add ecoins automatically add to thier account after finishing the dungeon


  2. #2
    Member Ocid Borlan is offline
    MemberRank
    Feb 2014 Join Date
    37Posts

    Re: Ecoin on DG

    cabal_sp_DungeonRanking
    Add
    IF (@DungeonIdx = ?) -- If you want to add only one dungeon
    BEGIN
    Update DB..dbo.CashAccount set Cash = Cash + ? where UserNum = charidx/8
    END

    good luck

  3. #3
    Account Upgraded | Title Enabled! RGaming is offline
    True MemberRank
    Jul 2009 Join Date
    PronteraLocation
    468Posts

    Re: Ecoin on DG

    ill check it thank you

    - - - Updated - - -

    Quote Originally Posted by Ocid Borlan View Post
    cabal_sp_DungeonRanking
    Add
    IF (@DungeonIdx = ?) -- If you want to add only one dungeon
    BEGIN
    Update DB..dbo.CashAccount set Cash = Cash + ? where UserNum = charidx/8
    END

    good luck
    how about if i want to add it in all dungeon

  4. #4
    Member Ocid Borlan is offline
    MemberRank
    Feb 2014 Join Date
    37Posts

    Re: Ecoin on DG

    Quote Originally Posted by RGaming View Post
    ill check it thank you

    - - - Updated - - -



    how about if i want to add it in all dungeon
    IF (@DungeonIdx = ?) < DELETE
    BEGIN < DELETE
    Update DB..dbo.CashAccount set Cash = Cash + ? where UserNum = charidx/8
    END < DELETE

  5. #5
    Account Upgraded | Title Enabled! RGaming is offline
    True MemberRank
    Jul 2009 Join Date
    PronteraLocation
    468Posts

    Re: Ecoin on DG

    is this the right sP ? cabal_sp_DungeonRankingSingle_Get?

  6. #6
    Account Upgraded | Title Enabled! RGaming is offline
    True MemberRank
    Jul 2009 Join Date
    PronteraLocation
    468Posts

    Re: Ecoin on DG

    up any can tell where i can find the store procedure for this

  7. #7
    Member Ocid Borlan is offline
    MemberRank
    Feb 2014 Join Date
    37Posts

    Re: Ecoin on DG

    Quote Originally Posted by RGaming View Post
    up any can tell where i can find the store procedure for this
    cabal_sp_DungeonRanking_Single_Clear_Set

  8. #8
    Account Upgraded | Title Enabled! RGaming is offline
    True MemberRank
    Jul 2009 Join Date
    PronteraLocation
    468Posts

    Re: Ecoin on DG

    Quote Originally Posted by Ocid Borlan View Post
    cabal_sp_DungeonRanking_Single_Clear_Set

    thank you ill check it now

    - - - Updated - - -

    hello ive tried to add it show this error

    Invalid column name 'charidx'.

  9. #9
    Hardcore Member HariSeldon is offline
    MemberRank
    Oct 2019 Join Date
    142Posts

    Re: Ecoin on DG

    For cabal_sp_DungeonRanking_Single_Clear_Set
    Code:
    Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @CharIdx/8
    There will be something like this for the party:
    cabal_sp_DungeonRanking_Party_Clear_Set

    Code:
            DECLARE @CNT int, @memId int
            SET @CNT = 1
    
            WHILE @CNT < DATALENGTH ( @memberData )
            BEGIN
                    SET @memId = dbo.BinToInt(SUBSTRING ( @memberData,@CNT,4 ))
                    Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @memId/8
                    SET @CNT= @CNT+27
            END
    Last edited by HariSeldon; 11-10-19 at 05:09 PM.

  10. #10
    Account Upgraded | Title Enabled! RGaming is offline
    True MemberRank
    Jul 2009 Join Date
    PronteraLocation
    468Posts

    Re: Ecoin on DG

    hello sir already tried your code and it work but only one time after you finish the dungeon you cannot get ecoin anymore

  11. #11
    Ultimate Member Tryout is offline
    MemberRank
    Jul 2020 Join Date
    152Posts

    Re: Ecoin on DG

    Quote Originally Posted by HariSeldon View Post
    For cabal_sp_DungeonRanking_Single_Clear_Set
    Code:
    Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @CharIdx/8
    There will be something like this for the party:
    cabal_sp_DungeonRanking_Party_Clear_Set

    Code:
            DECLARE @CNT int, @memId int
            SET @CNT = 1
    
            WHILE @CNT < DATALENGTH ( @memberData )
            BEGIN
                    SET @memId = dbo.BinToInt(SUBSTRING ( @memberData,@CNT,4 ))
                    Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @memId/8
                    SET @CNT= @CNT+27
            END
    How about query for the party with specific dungeon (If I only want to do it with one dungeon)?

    - - - Updated - - -

    Is this correct?

    Code:
    DECLARE @CNT int, @memId int
            SET @CNT = 1
    
            WHILE @CNT < DATALENGTH ( @memberData )
            IF (@DungeonIdx = ?)
    BEGIN
                 SET @memId = dbo.BinToInt(SUBSTRING ( @memberData,@CNT,4 ))
                 Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @memId/8
                 SET @CNT= @CNT+27
            END

  12. #12
    Hardcore Member HariSeldon is offline
    MemberRank
    Oct 2019 Join Date
    142Posts

    Re: Ecoin on DG

    Quote Originally Posted by Tryout View Post
    How about query for the party with specific dungeon (If I only want to do it with one dungeon)?

    - - - Updated - - -

    Is this correct?

    Code:
    DECLARE @CNT int, @memId int
            SET @CNT = 1
    
            WHILE @CNT < DATALENGTH ( @memberData )
            IF  @dungeonIdx = ?)
    BEGIN
                 SET @memId = dbo.BinToInt(SUBSTRING ( @memberData,@CNT,4 ))
                 Update CabalCash.dbo.CashAccount set Cash = Cash + ? where UserNum = @memId/8
                 SET @CNT= @CNT+27
            END
    Code:
    DECLARE @CNT int, @memId int, @reward int
    SET @reward = 
        CASE
            WHEN @dungeonIdx = 4252 THEN 100 --100 eCoins for DungeonIdx=4252
            WHEN @dungeonIdx = 4253 THEN 200 --200 eCoins for DungeonIdx=4253
            WHEN @dungeonIdx = 4254 THEN 300 --300 eCoins for DungeonIdx=4254
            ELSE 0 --Default - 0 eCoins
        END
    IF (@reward>0)
    BEGIN
        SET @CNT = 1
        WHILE @CNT < DATALENGTH ( @memberData )
        BEGIN
            SET @memId = dbo.BinToInt(SUBSTRING ( @memberData,@CNT,4 ))
            Update CabalCash.dbo.CashAccount set Cash = Cash + @reward where UserNum = @memId/8
            SET @CNT= @CNT+27
        END
    END

  13. #13
    Ultimate Member Tryout is offline
    MemberRank
    Jul 2020 Join Date
    152Posts

    Re: Ecoin on DG

    ELSE 0 --Default - 0 eCoins <<<< what is this for? if dungeon is not finished doesn't give ecoin or do I need to remove this so the function above will work?

  14. #14
    Hardcore Member HariSeldon is offline
    MemberRank
    Oct 2019 Join Date
    142Posts

    Re: Ecoin on DG

    Quote Originally Posted by Tryout View Post
    ELSE 0 --Default - 0 eCoins <<<< what is this for? if dungeon is not finished doesn't give ecoin or do I need to remove this so the function above will work?
    If a dungeon is not on your list, no reward will be issued. For example, you want to reward for finishing B3F, but do not want to reward for finishing SoD. If the SoD ID is not in the list, the default setting (0 eCoins) will work.

  15. #15
    Registered ronsamrn is offline
    MemberRank
    Sep 2020 Join Date
    /etcLocation
    18Posts

    Re: Ecoin on DG

    Other method would be creating a table for Dungeon with corresponding ecoin reward and use select statement. its easier to update table values when you decided to change ecoin rewards for each dungeon.

    Code:
    USE [Server01]
    GO
    
    /****** Object:  Table [dbo].[cabal_DungeonEcoin_Table]    Script Date: 10/11/2020 8:13:22 PM ******/
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE TABLE [dbo].[cabal_DungeonEcoin_Table](
    	[DungeonIdx] [int] NOT NULL,
    	[ecoin] [int] NOT NULL,
     CONSTRAINT [PK_cabal_DungeonEcoin_Table] PRIMARY KEY CLUSTERED 
    (
    	[DungeonIdx] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
    ) ON [PRIMARY]
    GO


    Code:
    DECLARE @ecoin int    
            
        SELECT @ecoin = ecoin
        FROM cabal_DungeonEcoin_Table
        WHERE DungeonIdx = @dungeonIdx
            
        SET @CNT = 1
        WHILE @CNT < DATALENGTH ( @memberData )
            BEGIN
                SET @memId = dbo.BinToInt(SUBSTRING ( @memberData,@CNT,4 ))
                UPDATE CabalCash.dbo.CashAccount set Cash = Cash + @ecoin where UserNum = @memId/8
                SET @CNT= @CNT+27
            END
    Last edited by ronsamrn; 4 Weeks Ago at 03:52 AM.



Page 1 of 2 12 LastLast

Advertisement