Voucher..

Results 1 to 8 of 8
  1. #1
    Valued Member Aerox009x is offline
    MemberRank
    Jul 2018 Join Date
    116Posts

    Voucher..

    How to create alternative Voucher? for NPC exchange item and World Drop use.


  2. #2
    Account Upgraded | Title Enabled! Tryout is offline
    MemberRank
    Jul 2020 Join Date
    326Posts

    Re: Voucher..

    Cash Shop or TDChien voucher only works

  3. #3
    Proficient Member ShadowGohan is online now
    MemberRank
    Dec 2013 Join Date
    170Posts
    Use the "PRIM" (PRIM (79) in the item template for sweetscape) item type and build your own voucher that way.
    Hint: The attack_rate__opt_1 value is the id that is passed on to the database.
    You'll have to apply a slight edit in the CABAL_SP_USE_PREMIUMITEM procedure within the Account database to make it work.
    Keep track of the db logs and you'll find out what's wrong if having trouble.

    The premium item type allows you to connect whatever within the database with the item, all you have to do is to give it something to do based on the id.

  4. #4
    Proficient Member Crashed is offline
    MemberRank
    Feb 2015 Join Date
    Spain, CordobaLocation
    172Posts
    Quote Originally Posted by ShadowGohan View Post
    Use the "PRIM" (PRIM (79) in the item template for sweetscape) item type and build your own voucher that way.
    Hint: The attack_rate__opt_1 value is the id that is passed on to the database.
    You'll have to apply a slight edit in the CABAL_SP_USE_PREMIUMITEM procedure within the Account database to make it work.
    Keep track of the db logs and you'll find out what's wrong if having trouble.

    The premium item type allows you to connect whatever within the database with the item, all you have to do is to give it something to do based on the id.
    wow this is insane

  5. #5
    Proficient Member Crashed is offline
    MemberRank
    Feb 2015 Join Date
    Spain, CordobaLocation
    172Posts
    but apparently the ID is not sent to the bank... the second parameter of the CABAL_SP_USE_PREMIUMITEM always returns 0

    i tested the attack_rate__opt_1 and also all other fields there, and none seem to be sent to the database

  6. #6
    Proficient Member ShadowGohan is online now
    MemberRank
    Dec 2013 Join Date
    170Posts
    Quote Originally Posted by Crashed View Post
    but apparently the ID is not sent to the bank... the second parameter of the CABAL_SP_USE_PREMIUMITEM always returns 0

    i tested the attack_rate__opt_1 and also all other fields there, and none seem to be sent to the database





    Adjust the option ID of the item to 61 - that attack rate bit was a mistake on my end.

    I do still have the attack_rate__opt_1 at 61 in the client, that may have been related to the description or something, its been quite a while so it could be whatever at this point I guess.

    My item.scp line:
    2247 @IDT_PRIM 0 2 2 <null> <null> <null> <null> <null> <null> 1 <null> <null> 190 <null> <null> <null> <null> <null> <null> <null> 1 0 -19 0 0 1 0 0 1 0 0 <null>

    My CABAL_SP_USE_PREMIUMITEM procedure is as shown in the quote below.

    Few notes: I do not pass on @Premium_CURRENT to @ExpireDate nor is @ExpireDate a date to begin with in my case.
    You can compare this with your procedure and you should see what was changed rather quickly.

    In my case I pass on the CharacterIdx in order to look through a table I made for a title check as this particular item is meant to grant a title.
    If said title was already given to the player - it will send back the item to that same player instead.
    I tried to only include the mandatory bits here to give some basic understanding of what it (can) look like.



    Code:
    USE [Account]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER procedure [dbo].[CABAL_SP_USE_PREMIUMITEM] @userNum int, @goodsNum int)
    AS
    BEGIN
    DECLARE @Premium_ITEM_APPLY_OK int
    DECLARE @Premium_ITEM_STANDBY_OK int
    DECLARE @Premium_ITEM_ERROR int
    DECLARE @Premium_CURRENT datetime
    
    SET @PremiumITEM_APPLY_OK = 0x11
        SET @Premium_ITEM_STANDBY_OK = 0x12
        SET @Premium_ITEM_ERROR = 0x13
    
    DECLARE @result int
        DECLARE @ServiceType int
        DECLARE @OutputExpireDate [DateTime]
        DECLARE @ExpireDate int    --UTC
        DECLARE @CurrentChar int
        SELECT @ExpireDate = (SELECT Top 1 CharacterIdx FROM Server01.dbo.cabal_character_table WHERE CharacterIdx/8 = @userNum AND Login = '1' )
    
     IF @goodsNum = '61'
     BEGIN
      IF EXISTS (SELECT charidx FROM Rewards.dbo.title_check WHERE charidx = @ExpireDate)
      BEGIN
       IF (SELECT [lod] FROM Rewards.dbo.title_check WHERE charidx = @ExpireDate) IS NULL
       BEGIN
       UPDATE Rewards.dbo.title_check SET [lod] = '1' WHERE charidx = @ExpireDate
       END
      ELSE
       BEGIN
       EXEC CabalCash.dbo.up_AddMyCashItemByItem @userNum,'100000000','1','2247','61','31'
       END
      END
      ELSE
      BEGIN
      INSERT INTO Rewards.dbo.title_check (charidx,godmode,lod) VALUES  @ExpireDate,'0', '1')
      END
     END
     SELECT @result, @goodsNum, @ExpireDate
    END
    Last edited by ShadowGohan; 1 Week Ago at 12:08 PM.

  7. #7
    Proficient Member Crashed is offline
    MemberRank
    Feb 2015 Join Date
    Spain, CordobaLocation
    172Posts
    now it worked

    so basically @GoodsNum is the item option...

    Do the items below work the same way? I mean, through the database?



  8. #8
    Proficient Member ShadowGohan is online now
    MemberRank
    Dec 2013 Join Date
    170Posts
    Quote Originally Posted by Crashed View Post
    now it worked

    so basically @GoodsNum is the item option...

    Do the items below work the same way? I mean, through the database?


    Fairly sure the hanger items etc are just changeshape based, coating kits i'm not sure - honestly never bothered but i don't think any of them work the same, I'd suggest to just check the Item Type from those items in the item file, fairly sure that PRIM is the only one directed to that procedure



Advertisement