Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya > Shaiya Private Server > Shaiya PServer Guides & Releases
You last visited: Today at 02:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Euphoria Dev Team Release] Level-up Stone

Discussion on [Euphoria Dev Team Release] Level-up Stone within the Shaiya PServer Guides & Releases forum part of the Shaiya Private Server category.

Reply
 
Old 04/08/2014, 12:00   #16
 
[GM]SkyLine.™'s Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 147
Received Thanks: 174
Completed Script

Code:
USE [PS_GameLog]
GO

/****** Object:  Table [dbo].[LevelUpRuneLog]    Script Date: 11/12/2013 19:23:59 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[LevelUpRuneLog](
	[RowID] [int] IDENTITY(1,1) NOT NULL,
	[UserUID] [int] NOT NULL,
	[CharID] [int] NOT NULL,
	[Done] [bit] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[RowID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
Code:
USE [PS_GameLog]
GO
/****** Object:  StoredProcedure [dbo].[usp_Insert_Action_Log_E]    Script Date: 01/11/2014 10:50:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/****** Object:  Stored Procedure dbo.usp_Insert_Action_Log_E    Script Date: 2008-6-7 18:32:40 ******/

/****** Object:  Stored Procedure dbo.usp_Insert_Action_Log_E    Script Date: 2008/3/15 ?? 05:16:53 ******/



ALTER  Proc [dbo].[usp_Insert_Action_Log_E]

/* 
Created by , 2004-08-17
Modified by , 2004-08-19

??? ?? ?? ??? */


/*

*/

@UserID varchar(18),
@UserUID int,
@CharID int,
@CharName varchar(50),
@CharLevel tinyint,
@CharExp int,
@MapID smallint,
@PosX real,
@PosY real,
@PosZ real,
@ActionTime datetime,
@ActionType tinyint,
@Value1 bigint = null,
@Value2 int = null,
@Value3 int = null,
@Value4 bigint = null,
@Value5 int = null,
@Value6 int = null,
@Value7 int = null,
@Value8 int = null,
@Value9 int = null,
@Value10 int = null,
@Text1 varchar(100) = '',
@Text2 varchar(100) = '',
@Text3 varchar(100) = '',
@Text4 varchar(100) = '',
@Sql nvarchar(4000) = '',
@yyyy varchar(4) = '',
@mm varchar(2) = '',
@dd varchar(2) = '',
@Bucket smallint = -1

AS

IF @ActionType = 112 AND @Text2 = 'use_item' AND @Value2 = item code
BEGIN
	
	INSERT INTO LevelUpRuneLog VALUES (@UserUID, @CharID, 0)
	
END

SET @yyyy = datepart(yyyy, @ActionTime)
SET @mm = datepart(mm, @ActionTime)
SET @dd = datepart(dd, @ActionTime)


IF(LEN(@mm) = 1)
BEGIN
	SET @mm = '0' + @mm
END

IF(LEN(@dd) = 1)
BEGIN
	SET @dd = '0' + @dd
END

SET @Sql = N'
INSERT INTO PS_GameLog.dbo.ActionLog
(UserID, UserUID, CharID, CharName, CharLevel, CharExp, MapID,  PosX, PosY, PosZ, ActionTime, ActionType, 
Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Text1, Text2, Text3, Text4)
VALUES(@UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType, 
@Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4)'

EXEC sp_executesql @Sql, 
N'@UserID varchar(18), @UserUID int, @CharID int, @CharName varchar(50), 
@CharLevel tinyint, @CharExp int, @MapID smallint, @PosX real, @PosY real, @PosZ real, @ActionTime datetime, @ActionType tinyint, 
@Value1 bigint, @Value2 int, @Value3 int, @Value4 bigint, @Value5 int, @Value6 int, @Value7 int, @Value8 int, 
@Value9 int, @Value10 int, @Text1 varchar(100), @Text2 varchar(100), @Text3 varchar(100), @Text4 varchar(100)',
@UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType, 
@Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4
Code:
USE [PS_UserData]
GO
/****** Object:  StoredProcedure [dbo].[usp_Try_GameLogout_R]    Script Date: 01/11/2014 10:51:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/****** Object: Stored Procedure dbo.usp_Try_GameLogout_R Script Date: 2008-6-7 18:34:05 ******/
ALTER Proc [dbo].[usp_Try_GameLogout_R]

/* 
Created by humanws, 2005-10-18
???? ?? ??
*/

@UserUID int,
@SessionID bigint,
@LogoutType smallint = 0,
@ErrType int = 0

AS

SET NOCOUNT ON

DECLARE @CharID INT

WHILE (SELECT COUNT(UserUID) FROM PS_GameLog.dbo.LevelUpRuneLog WHERE UserUID = @UserUID AND Done = 0) > 0
BEGIN
	
	SET @CharID = (SELECT TOP 1 CharID FROM PS_GameLog.dbo.LevelUpRuneLog WHERE UserUID = @UserUID AND Done = 0)
	
	UPDATE PS_GameData.dbo.Chars
	SET Level = level here
	WHERE CharID = @CharID
	
	UPDATE PS_GameLog.dbo.LevelUpRuneLog
	SET Done = level here
	WHERE CharID = @CharID
	
END

DECLARE @LogTime datetime
DECLARE @Sql nvarchar(4000)
DECLARE @yyyy varchar(4)
DECLARE @mm varchar(2)
DECLARE @dd varchar(2)
DECLARE @LogType bit	-- Login:0, Logout:1

SET @LogType = 1
SET @LogTime = GETDATE()
SET @yyyy = DATEPART(yyyy, @LogTime)
SET @mm = DATEPART(mm, @LogTime)
SET @dd = DATEPART(dd, @LogTime)

IF( LEN(@mm) = 1 )
BEGIN
SET @mm = '0' + @mm
END

IF( LEN(@dd) = 1 )
BEGIN
SET @dd = '0' + @dd
END
UPDATE Users_Master SET Leave = 0, LeaveDate = GETDATE() WHERE UserUID = @UserUID

SET @Sql = N'
INSERT INTO PS_GameLog.dbo.UserLog
(SessionID, UserUID, LogType, LogTime, LogoutType, ErrType)
VALUES(@SessionID, @UserUID, @LogType, @LogTime, @LogoutType, @ErrType)'

EXEC sp_executesql @Sql, 
N'@SessionID bigint, @UserUID int, @LogType bit, @LogTime datetime, @LogoutType smallint, @ErrType int',
@SessionID, @UserUID, @LogType, @LogTime, @LogoutType, @ErrType
update PS_userdata.dbo.UserLoginStatus
set loginstatus=0,LogoutTime=@LogTime,LogoutSession=@SessionID,LastPlayTime=datediff(minute,LoginTime,@LogTime)
where useruid=@useruid

DECLARE @LoginTime datetime
DECLARE @LastPlayTime int
DECLARE @OldPoint int
DECLARE @LoginSession bigint
SET @LoginSession=(select LoginSession from PS_userdata.dbo.UserLoginStatus where useruid=@useruid)
SET @LastPlayTime=(select LastPlayTime from PS_userdata.dbo.UserLoginStatus where useruid=@useruid)
SET @LoginTime=(select LoginTime from PS_userdata.dbo.UserLoginStatus where useruid=@useruid)
SET @OldPoint=(select Point from PS_userdata.dbo.Users_Master where useruid=@useruid)
IF (@SessionID=@LoginSession)
BEGIN
Update PS_userdata.dbo.Users_Master
SET point=point +1
WHERE useruid=@useruid
INSERT INTO PS_userdata.dbo.UserOnlineTimeLog(UserUid,OldPoint ,Addpoint,LoginTime,LogoutTime,SessionID)
values(@UserUid,@OldPoint,@LastPlayTime,@LoginTime ,@LogTime,@SessionID)
end
SET NOCOUNT OFF
[GM]SkyLine.™ is offline  
Old 04/08/2014, 12:29   #17
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,451
That's assuming they don't have other edits in the usp_Insert_Action_Log_E and usp_Try_GameLogout_R procedures.
nubness is offline  
Thanks
4 Users
Old 09/08/2016, 20:14   #18
 
sanguto's Avatar
 
elite*gold: 0
Join Date: Jul 2016
Posts: 38
Received Thanks: 47
Thank you nubness
one more question, how to appear up the name of the character when using the item?
sanguto is offline  
Old 09/26/2016, 17:19   #19
 
JujiPoli's Avatar
 
elite*gold: 0
Join Date: Nov 2011
Posts: 340
Received Thanks: 405
Like this:
Quote:
Originally Posted by nubness View Post
Code:
USE [PS_GameLog]
GO

/****** Object:  Table [dbo].[LevelUpRuneLog]    Script Date: 11/12/2013 19:23:59 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[LevelUpRuneLog](
	[RowID] [int] IDENTITY(1,1) NOT NULL,
	[UserUID] [int] NOT NULL,
	[CharID] [int] NOT NULL,
        [Charname] [varchar(25)] NOT NULL,
	[Done] [bit] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[RowID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
Next thing to do is make the usp_Insert_Action_Log_E procedure insert the information in our newly created table. For that, you need to paste the following code snippet in the usp_Insert_Action_Log_E procedure.

Code:
IF @ActionType = 112 AND @Text2 = 'use_item' AND @Value2 = 100001
BEGIN
	
	INSERT INTO LevelUpRuneLog VALUES (@UserUID, @CharID, @Charname, 0)
	
END
JujiPoli is offline  
Thanks
1 User
Old 10/07/2017, 03:06   #20
 
GkRock's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 60
Received Thanks: 15
it is possible to create
3 different stones
one that levels to 15
and another to 30
and another to 60


without the need to use several times the same stone to go up from level to level
GkRock is offline  
Old 10/07/2017, 04:48   #21
 
Velocity.'s Avatar
 
elite*gold: 0
Join Date: Jul 2016
Posts: 237
Received Thanks: 323
Quote:
Originally Posted by GkRock View Post
it is possible to create
3 different stones
one that levels to 15
and another to 30
and another to 60


without the need to use several times the same stone to go up from level to level
it is possible. I know this infact because i have done it.
You can create 3 different stones.
Velocity. is offline  
Old 10/07/2017, 04:56   #22
 
GkRock's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 60
Received Thanks: 15
Quote:
Originally Posted by Velocity. View Post
it is possible. I know this infact because i have done it.
You can create 3 different stones.

could you show me how you did it
yes so kind
Thank you
GkRock is offline  
Old 10/07/2017, 05:48   #23
 
Velocity.'s Avatar
 
elite*gold: 0
Join Date: Jul 2016
Posts: 237
Received Thanks: 323
Quote:
Originally Posted by GkRock View Post
could you show me how you did it
yes so kind
Thank you
i don't know what you're struggling with. this script shows you how to make 1 stone so repeat the process with 3 of them. it doesn't take Einstein to do this.
Velocity. is offline  
Old 10/07/2017, 16:16   #24
 
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
Quote:
Originally Posted by GkRock View Post
could you show me how you did it
yes so kind
Thank you
IF @Type = 112 AND @ = 'use_item' AND @ = 100001 --60 ll rune
BEGIN

INSERT INTO LevelUpRuneLog VALUES (@UserUID, @D, @, 60) --last value is lvl
update PS_GameData.dbo.chars
Set Level='60'
where CharID @D
END

Like this
SnickQ is offline  
Thanks
1 User
Old 10/07/2017, 22:58   #25
 
GkRock's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 60
Received Thanks: 15
Quote:
Originally Posted by doteroargentino View Post
This is misleading, you would be trying to add one more data column to a table that doesn't has space for it.

In order to do this you would have to modify your table like this:

Then modify the usp_Insert_Action_Log_E procedure a and add a switch case for the @ according to each ItemID (one for each rune). PD: I'm not adding this to the script, I'm only showing you where it should go.

PD: if you guys don't know what a CASE (or switch) statement is, it's basically writing and IF followed by many ELSE IF's but simplified.

Finally your usp_Try_GameLogout_R should look like this:
Excellent
I was waiting for a line of code
thank you very much
what is complicating me is to use the variable CASE
sorry to bother
GkRock is offline  
Old 10/08/2017, 01:10   #26
 
GkRock's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 60
Received Thanks: 15
Quote:
Originally Posted by doteroargentino View Post
It will be easier for you if you just use an IF and ELSE IF's like this:


I already modified it in my previous post so it's all together.
works perfectly
thank you very much
PS: that's the only way to go up to 60
to prevent someone from going to a higher level of the server

I have tried it

UPDATE PS_GameData.dbo.Chars
SET Level = 60
WHERE Level = 60

but it does not work
GkRock is offline  
Old 10/09/2017, 07:26   #27
 
GkRock's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 60
Received Thanks: 15
Quote:
Originally Posted by doteroargentino View Post
Oh there's a mistake on the script, make sure you remove the '+' on your usp_Try_GameLogout_R procedure after 'SET Level..':

There's a small mistake in your script, if you want 60 to be the maximum level you should write this:
UPDATE PS_GameData.dbo.Chars
SET Level = 60
WHERE Level > 60

I recommend you to limit the level cap to 60 directly in your ps_game not in this way.
I have two drawbacks
avoid changing the level if the character has an item equipped
(try the following scripts but it did not work)
changing the level of resetting your stat to 0

Is it possible to carry this out?
GkRock is offline  
Old 10/09/2017, 07:51   #28
 
GkRock's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 60
Received Thanks: 15
Quote:
Originally Posted by doteroargentino View Post
"Bag = 0" Doesn't mean they don't have items equipped.. If you want to prevent people of a certain level to use a rune to get to a lower level you just have to modify the usp_Try_GameLogout_R procedure. I think you can figure it out if you go through the code.
what I want to realize is that the rune only takes effect if the character does not have any element equipped

and at the moment of change of level it restarts its stat

GkRock is offline  
Old 05/08/2021, 20:35   #29
 
elite*gold: 0
Join Date: Apr 2019
Posts: 7
Received Thanks: 0
Only Levels will change but the stats and skillpoints it's not.
itsarielbatoon is offline  
Old 05/09/2021, 09:25   #30
 
Elessar2's Avatar
 
elite*gold: 2
Join Date: Aug 2020
Posts: 46
Received Thanks: 79
Quote:
Originally Posted by itsarielbatoon View Post
Only Levels will change but the stats and skillpoints it's not.
DECLARE @D INT

WHILE (SELECT COUNT(UserUID) FROM PS_GameLog.dbo.LevelUpRuneLog WHERE UserUID = @ID AND Done = 0) > 0
BEGIN

SET @D = (SELECT TOP 1 CharID FROM PS_GameLog.dbo.LevelUpRuneLog WHERE UserUID = @ID AND Done = 0)

UPDATE PS_GameData.dbo.Chars
SET Level += 1,StatPoint+=1,SkillPoint+=1
WHERE CharID = @D

UPDATE PS_GameLog.dbo.LevelUpRuneLog
SET Done = level here
WHERE CharID = @D

END
Elessar2 is offline  
Reply


Similar Threads Similar Threads
[Euphoria Dev Team Release] Starter Gears
02/02/2023 - Shaiya PServer Guides & Releases - 38 Replies
Hello community, I recently saw users asking for a way to let their characters start equipped, since this is not possible by using the existing BaseItemsDefs table. Today I am releasing a way of doing it, which can also replace the BaseItemsDefs table but having more possibilities to realize your ideas. If you are interested in this you might thought about a way of doing this before. The only problem I can imagine you could have had is the ItemUID. Since we want to insert one, or even...
[Euphoria Dev Team Release] Starter Skills
01/21/2020 - Shaiya PServer Guides & Releases - 13 Replies
Hello everybody, this release was created due to me being lazy during other development. I was testing something about skills on my local server and I had to upgrade the skills from 1 up to 9 each time. After some time I thought about avoiding this by adding some lines to the famous usp_Create_Char_R procedure. This release is only important for servers that have the instant leveling feature, and most of all, free or extremely easy servers. Let's say you create a character whose starting...
[Euphoria Dev Team Release] Shaiya Update Downloader
04/16/2017 - Shaiya PServer Guides & Releases - 44 Replies
Hey guys, During the last couple of days, upon somebody's request, I've been working on a program that's meant to help private server developers by saving their time. Shaiya Update Downloader is a program where the user can list multiple servers for constant update check, and have them downloaded automatically if the user requires so. This program can also manually download specific updates upon user's request. Below you can see a few screenshots which will make you understand this program's...
[Euphoria Dev Team Release] Illegal Linking Detection
02/13/2015 - Shaiya PServer Guides & Releases - 33 Replies
Hello everybody, As we're all well aware of the fact that illegal linking is still possible, I come with a good solution which will help server admins in fighting this issue. It is not the best solution, yet, it is a good one, and it guarantees that the exploiter will get caught, and banned if the admin wants it. First of all, you need a new table in the PS_GameLog database, which will store all the necessary information about all the illegal linking attempts that take place. The table...
[Euphoria Dev Team Release] Illegal Transaction Detection
02/08/2014 - Shaiya PServer Guides & Releases - 8 Replies
Hello everybody, I am sure that not many people know about this, and I'm more than sure that it is not a problem for private servers, but transacting untradeable items isn't normally allowed, which is why items have the tradeable/untradeable property after all. Detecting such transactions is extremely easy, since the logs store all the information about most things that happen in game, instantly. First of all you need to create a new table, which will contain all the details about...



All times are GMT +2. The time now is 02:21.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.