Newbie Spellweaver
- Joined
- Apr 18, 2011
- Messages
- 74
- Reaction score
- 10
I simply couldn't find a good guide to help me with this so i managed to do it alone and now i want to share it with you.It's my first guide and i hope it's gonna go all right. So let's get started. I will show you how every hour played on mu will automatically be transformed in points for cash shop.
Step 1
First enter Start -> All programs-> Sql server -> enterprise manager ->DATABASE->MuOnline-> Tables
Here look for MEMB_STAT , right click and chose Design Table and create a new column like the following:
Column_name: OnlineHours
Type: int
Allow Nulls: unchecked
Default value: 0
Step 2
Same location in MuOnline enter Stored Procedures and find WZ_DISCONNECT_MEMB. Douable click on it and replace the actual code with this one
Click ok and you're done
Things you should know:
The code is set to give 10 points per hour . If you want to change that do the following:
change hh(hour)
in year-yy, yyyy
quarter-qq, q
monthmm- m
day-dd, d
week-wk, ww
minute-mi, n
second-ss, s
These are the symbols if you want to change them, and to change the number of cash shop points received, change the "10" in the code with the number you want to receive.
Hope I was of help. I only tested it on sql server 2000 windows xp, don't know for others. Sorry for my english and sorry if i did something wrong. GL
EDIT: for values higher than 1 you must change in MEMB_STAT the OnlineHours column to REAL NOT INT
Step 1
First enter Start -> All programs-> Sql server -> enterprise manager ->DATABASE->MuOnline-> Tables
Here look for MEMB_STAT , right click and chose Design Table and create a new column like the following:
Column_name: OnlineHours
Type: int
Allow Nulls: unchecked
Default value: 0
Step 2
Same location in MuOnline enter Stored Procedures and find WZ_DISCONNECT_MEMB. Douable click on it and replace the actual code with this one
Code:
CREATE PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
@memb___id varchar(10)
AS
Begin
set nocount on
Declare @find_id varchar(10)
Declare @ConnectStat tinyint
declare @OnlineHours real
declare @cspoints int
Set @ConnectStat = 0
Set @find_id = 'NOT'
select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
where I.memb___id = @memb___id
if( @find_id <> 'NOT' )
begin
SELECT @cspoints= cs_points FROM MEMB_INFO where memb___id = @memb___id
update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), OnlineHours = @cspoints/[COLOR="Blue"]10[/COLOR]+(DATEDIFF([COLOR="Red"]hh[/COLOR],ConnectTM,getdate()))
where memb___id = @memb___id
SELECT @OnlineHours =OnlineHours FROM MEMB_STAT WHERE memb___id = @memb___id
UPDATE [dbo].[MEMB_INFO]
SET cs_points=(@OnlineHours * [COLOR="Blue"]10[/COLOR])
WHERE memb___id = @memb___id
end
end
GO
Things you should know:
The code is set to give 10 points per hour . If you want to change that do the following:
change hh(hour)
in year-yy, yyyy
quarter-qq, q
monthmm- m
day-dd, d
week-wk, ww
minute-mi, n
second-ss, s
These are the symbols if you want to change them, and to change the number of cash shop points received, change the "10" in the code with the number you want to receive.
Hope I was of help. I only tested it on sql server 2000 windows xp, don't know for others. Sorry for my english and sorry if i did something wrong. GL
EDIT: for values higher than 1 you must change in MEMB_STAT the OnlineHours column to REAL NOT INT
Last edited: