- Joined
- Apr 25, 2007
- Messages
- 36
- Reaction score
- 0
Right, well I had a search in the forums and it looks like no one has explained on how to do this so I'll have a go.
You say you want to give every player premium status? With free map codes?
Darn your awesome, but how do you go about doing it?
Triggers I say. Lets, for example, add auto premium to our database.
First, right click the cabal_auth_table and go All Tasks > Manage Triggers.
Triggers react to whatever happens in the table they're assigned to. In this example, whenever someone registers, we want the trigger to fetch their UserNum, and add it into the cabal_charge_auth table.
Here's what I put into my trigger
The "Inserted" table is a virtual table which contains all of the fields and values from the actual "INSERT" command that made SQL Server call the trigger in the first place.
For the Map and Warp codes, I just added them into the cabal_sp_newchar stored procedure in the GameDB
Anyone else got any handy little tips like this?
Edit: Actually, can someone help me out? Trying to add stuff to the MyCashItem table, but it's not appearing ingame? GM tool isn't working either, unless I got something wrong there.
You say you want to give every player premium status? With free map codes?
Darn your awesome, but how do you go about doing it?
Triggers I say. Lets, for example, add auto premium to our database.
First, right click the cabal_auth_table and go All Tasks > Manage Triggers.
Triggers react to whatever happens in the table they're assigned to. In this example, whenever someone registers, we want the trigger to fetch their UserNum, and add it into the cabal_charge_auth table.
Here's what I put into my trigger
Code:
CREATE TRIGGER [Auto-Premium] ON [dbo].[cabal_auth_table]
FOR INSERT
AS
-- First we need to declare what we need
Declare @usrnum char(4)
-- This line grabs what was just inserted into the database, and selects the usernum
Select @usrnum = (Select UserNum From Inserted)
-- Next, all we have to do is use that UserNum and insert it into the cabal_charge_auth table, along with premium info
Insert into dbo.cabal_charge_auth(UserNum,Type,ExpireDate,PayMinutes,ServiceKind) values (@usrnum,'5','10/10/2010 01:00:00','0','1')
For the Map and Warp codes, I just added them into the cabal_sp_newchar stored procedure in the GameDB
Code:
<SNIP>
insert into cabal_quickslot_table (characterIdx, data) select @characteridx, quickSlotData from #TempTable
insert into cabal_questdata_table (characterIdx, data, flags) select @characteridx, questData, questFlagsData from #TempTable
commit tran
----------------------------------------------------------------------------------------------
-- 리턴값 0xA1 ~ 0xA6
drop table #tempTable
select convert(int, @result)
-----------------------------------------------------------------------------------------------
-- Here is where I added the Warp and Map codes, near the bottom of the procedure
update cabal_character_table set WarpBField = '511', MapsBField = '511' where CharacterIdx = @characteridx
end
SET NOCOUNT OFF
end
GO
Anyone else got any handy little tips like this?
Edit: Actually, can someone help me out? Trying to add stuff to the MyCashItem table, but it's not appearing ingame? GM tool isn't working either, unless I got something wrong there.