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!

Goblin Points Fix

Newbie Spellweaver
Joined
May 22, 2010
Messages
77
Reaction score
3
I do not know if there is another like mine problem with "goblin points", that they are not automatically adding, but here's what I came up with with MSSQL 2000.
1. Open MuOnline and fiend in Stored Procedurs -> WZ_DISCONNECT_MEMB
Double click and change all with this,

Code:
CREATE PROCEDURE WZ_DISCONNECT_MEMB

@uid varchar(20)
AS
Begin

BEGIN TRANSACTION

SET NOCOUNT ON
declare [USER=27501]OnLine[/USER]Hours real
IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )
Begin
SELECT  [USER=27501]OnLine[/USER]Hours =OnlineHours FROM MEMB_STAT WHERE memb___id = @uid

UPDATE MEMB_STAT
SET DisConnectTM = getdate(), ConnectStat =0, OnlineHours = OnlineHours+(DATEDIFF(mi,ConnectTM,getdate())) WHERE memb___id = @uid

UPDATE MEMB_INFO
SET GoblinCoin = GoblinCoin+ [USER=27501]OnLine[/USER]Hours*0.1) WHERE memb___id = @uid
End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,DisConnectTM,connectstat) valueS (
@uid,
(getdate()),
0
)
End


IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION

SET NOCOUNT OFF
End
GO

Thanks to:

4FUNer
sqrobert
 
Newbie Spellweaver
Joined
May 22, 2010
Messages
77
Reaction score
3
FiXed The bug with OnlineHours.
Code:
USE [MuOnline]
GO
/****** Object:  StoredProcedure [dbo].[WZ_DISCONNECT_MEMB]    Script Date: 03/01/2014 19:34:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]

@uid varchar(20)
AS
Begin

BEGIN TRANSACTION

SET NOCOUNT ON
declare  [USER=27501]OnLine[/USER]Hours real
declare @GP real
IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )
Begin
SELECT   [USER=27501]OnLine[/USER]Hours =OnlineHours FROM MEMB_STAT WHERE memb___id = @uid
SELECT @GP=GoblinCoin FROM MEMB_INFO WHERE memb___id=@uid

UPDATE MEMB_STAT
SET DisConnectTM = getdate(), ConnectStat =0, OnlineHours = OnlineHours+(DATEDIFF(mi,ConnectTM,getdate())) WHERE memb___id = @uid

UPDATE MEMB_INFO
SET GoblinCoin =@GP  [USER=27501]OnLine[/USER]Hours*[COLOR="#FF0000"]12[/COLOR] WHERE memb___id = @uid

UPDATE MEMB_STAT
SET OnlineHours = 0 WHERE memb___id = @uid

End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,DisConnectTM,connectstat) valueS (
@uid,
(getdate()),
0
)
End


IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION

SET NOCOUNT OFF
End

Edit 12 to change the multiplier. Now for 1 hour will give you 12 Gp
 
Experienced Elementalist
Joined
Sep 20, 2011
Messages
227
Reaction score
9
Incorrect syntax near ')'. error-.-



FiXed The bug with OnlineHours.
Code:
USE [MuOnline]
GO
/****** Object:  StoredProcedure [dbo].[WZ_DISCONNECT_MEMB]    Script Date: 03/01/2014 19:34:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]

@uid varchar(20)
AS
Begin

BEGIN TRANSACTION

SET NOCOUNT ON
declare  [USER=27501]OnLine[/USER]Hours real
declare @GP real
IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )
Begin
SELECT   [USER=27501]OnLine[/USER]Hours =OnlineHours FROM MEMB_STAT WHERE memb___id = @uid
SELECT @GP=GoblinCoin FROM MEMB_INFO WHERE memb___id=@uid

UPDATE MEMB_STAT
SET DisConnectTM = getdate(), ConnectStat =0, OnlineHours = OnlineHours+(DATEDIFF(mi,ConnectTM,getdate())) WHERE memb___id = @uid

UPDATE MEMB_INFO
SET GoblinCoin =@GP  [USER=27501]OnLine[/USER]Hours*[COLOR="#FF0000"]12[/COLOR] WHERE memb___id = @uid

UPDATE MEMB_STAT
SET OnlineHours = 0 WHERE memb___id = @uid

End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,DisConnectTM,connectstat) valueS (
@uid,
(getdate()),
0
)
End


IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION

SET NOCOUNT OFF
End

Edit 12 to change the multiplier. Now for 1 hour will give you 12 Gp

pls help

Incorrect syntax near ')'. error-.- in query
 
Newbie Spellweaver
Joined
Jul 30, 2008
Messages
8
Reaction score
1
USE [MuOnline]
GO
/****** Object: StoredProcedure [dbo].[WZ_DISCONNECT_MEMB] Script Date: 03/01/2014 19:34:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]

@uid varchar(20)
AS
Begin

BEGIN TRANSACTION

SET NOCOUNT ON
declare @OnLineHours real
declare @GP real
IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
WHERE memb___id = @uid )
Begin
SELECT @OnLineHours =OnlineHours FROM MEMB_STAT WHERE memb___id = @uid
SELECT @GP=GoblinCoin FROM MEMB_INFO WHERE memb___id=@uid

UPDATE MEMB_STAT
SET DisConnectTM = getdate(), ConnectStat =0, OnlineHours = OnlineHours+(DATEDIFF(mi,ConnectTM,getdate())) WHERE memb___id = @uid

UPDATE MEMB_INFO
SET GoblinCoin =@GP + @OnLineHours * 12 WHERE memb___id = @uid

UPDATE MEMB_STAT
SET OnlineHours = 0 WHERE memb___id = @uid

End
ELSE
Begin
INSERT INTO MEMB_STAT ( memb___id,DisConnectTM,connectstat) valueS (
@uid,
(getdate()),
0
)
End


IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION

SET NOCOUNT OFF
End

Fix syntax error :).
 
Back
Top