Junior Spellweaver
- Joined
- Jul 23, 2018
- Messages
- 178
- Reaction score
- 38
How to create alternative Voucher? for NPC exchange item and World Drop use.
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!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.
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
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>
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
now it worked
so basically @GoodsNum is the item option...
Do the items below work the same way? I mean, through the database?