Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Voucher..

Junior Spellweaver
Joined
Jul 23, 2018
Messages
178
Reaction score
38
How to create alternative Voucher? for NPC exchange item and World Drop use.
 
Junior Spellweaver
Joined
Dec 19, 2013
Messages
183
Reaction score
37
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.
 
Upvote 0
Experienced Elementalist
Joined
Feb 17, 2015
Messages
263
Reaction score
119
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
 
Upvote 0
Experienced Elementalist
Joined
Feb 17, 2015
Messages
263
Reaction score
119
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
 
Upvote 0
Junior Spellweaver
Joined
Dec 19, 2013
Messages
183
Reaction score
37
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] @[I][B][URL="https://forum.ragezone.com/members/1335.html"]user[/URL][/B][/I]Num int, @[I][B][URL="https://forum.ragezone.com/members/336895.html"]goods[/URL][/B][/I]Num int)
AS
BEGIN
DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000244514.html"]Premium[/URL][/B][/I]_ITEM_APPLY_OK int
DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000244514.html"]Premium[/URL][/B][/I]_ITEM_STANDBY_OK int
DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000244514.html"]Premium[/URL][/B][/I]_ITEM_ERROR int
DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000244514.html"]Premium[/URL][/B][/I]_CURRENT datetime

SET @[I][B][URL="https://forum.ragezone.com/members/2000244514.html"]Premium[/URL][/B][/I]ITEM_APPLY_OK = 0x11
    SET @[I][B][URL="https://forum.ragezone.com/members/2000244514.html"]Premium[/URL][/B][/I]_ITEM_STANDBY_OK = 0x12
    SET @[I][B][URL="https://forum.ragezone.com/members/2000244514.html"]Premium[/URL][/B][/I]_ITEM_ERROR = 0x13

DECLARE @[I][B][URL="https://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]lt int
    DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000318537.html"]Serv[/URL][/B][/I]iceType int
    DECLARE @[I][B][URL="https://forum.ragezone.com/members/1333447295.html"]Out[/URL][/B][/I]putExpireDate [DateTime]
    DECLARE @[I][B][URL="https://forum.ragezone.com/members/874653.html"]Expire[/URL][/B][/I]Date int    --UTC
    DECLARE @CurrentChar int
    SELECT @[I][B][URL="https://forum.ragezone.com/members/874653.html"]Expire[/URL][/B][/I]Date = (SELECT Top 1 CharacterIdx FROM Server01.dbo.cabal_character_table WHERE CharacterIdx/8 = @[I][B][URL="https://forum.ragezone.com/members/1335.html"]user[/URL][/B][/I]Num AND Login = '1' )

 IF @[I][B][URL="https://forum.ragezone.com/members/336895.html"]goods[/URL][/B][/I]Num = '61'
 BEGIN
  IF EXISTS (SELECT charidx FROM Rewards.dbo.title_check WHERE charidx = @[I][B][URL="https://forum.ragezone.com/members/874653.html"]Expire[/URL][/B][/I]Date)
  BEGIN
   IF (SELECT [lod] FROM Rewards.dbo.title_check WHERE charidx = @[I][B][URL="https://forum.ragezone.com/members/874653.html"]Expire[/URL][/B][/I]Date) IS NULL
   BEGIN
   UPDATE Rewards.dbo.title_check SET [lod] = '1' WHERE charidx = @[I][B][URL="https://forum.ragezone.com/members/874653.html"]Expire[/URL][/B][/I]Date
   END
  ELSE
   BEGIN
   EXEC CabalCash.dbo.up_AddMyCashItemByItem @[I][B][URL="https://forum.ragezone.com/members/1335.html"]user[/URL][/B][/I]Num,'100000000','1','2247','61','31'
   END
  END
  ELSE
  BEGIN
  INSERT INTO Rewards.dbo.title_check (charidx,godmode,lod) VALUES  @[I][B][URL="https://forum.ragezone.com/members/874653.html"]Expire[/URL][/B][/I]Date,'0', '1')
  END
 END
 SELECT @[I][B][URL="https://forum.ragezone.com/members/22433.html"]resu[/URL][/B][/I]lt, @[I][B][URL="https://forum.ragezone.com/members/336895.html"]goods[/URL][/B][/I]Num, @[I][B][URL="https://forum.ragezone.com/members/874653.html"]Expire[/URL][/B][/I]Date
END
 
Last edited:
Upvote 0
Experienced Elementalist
Joined
Feb 17, 2015
Messages
263
Reaction score
119
now it worked :thumbup:

so basically @GoodsNum is the item option...

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

7LV0txt - Voucher.. - RaGEZONE Forums

7674HKO - Voucher.. - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Upvote 0
Junior Spellweaver
Joined
Dec 19, 2013
Messages
183
Reaction score
37
now it worked :thumbup:

so basically @GoodsNum is the item option...

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

7LV0txt - Voucher.. - RaGEZONE Forums

7674HKO - Voucher.. - RaGEZONE Forums

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
 

Attachments

You must be registered for see attachments list
Upvote 0
Back
Top