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 15:42

  • 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   #1
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
[Euphoria Dev Team Release] Level-up Stone

Hello everyone,

As someone seemed interested in a level-up rune/stone in , I decided to do more than just give a simple reply, and make a whole release out of it.

The Level-up rune will be based on the game logs, which will record whenever someone consumes the item.

Here's a table which I decided to bring as an example.

UserIDUserUIDCharIDCharNameActionTypeValue2Text1Text2
ciochris19Turbo112100001Etain Potionuse_item

ActionType = 112 stands for an item disappearing from the inventory, it's Text2 property telling us how exactly the item disappeared, in our case being use_item, which makes you understand that the item was consumed. As you might have already guessed, this log occurred when I consumed an Etain Potion.

I don't know for which reason, but this gets recorded in the logs only if the consumed item is of Type = 100, which means your Level-Up rune must have Type = 100.

Another thing to notice is that the level of a character is a property stored in the server's memory while the account is online, so no matter what you do in the database, the character's level doesn't change as long as it is online.

First of all, we need to create a table which will store the logs for the LevelUp runes.

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
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, 0)
	
END
The last thing to do is add another block of code to the PS_UserData.dbo.usp_Try_GameLogout_R procedure, which is triggered when the account is logged off.

Code:
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 += 1
	WHERE CharID = @CharID
	
	UPDATE PS_GameLog.dbo.LevelUpRuneLog
	SET Done = 1
	WHERE CharID = @CharID
	
END
That's pretty much it. You can of course customize it if you want it to do more stuff, that's all up to you.

Enjoy !
nubness is offline  
Thanks
23 Users
Old 11/13/2013, 07:54   #2
 
elite*gold: 0
Join Date: May 2011
Posts: 8
Received Thanks: 1
will it work in League of shaiya?

<-- i'm just a noob..sorry for this question
nic0y0525 is offline  
Old 11/13/2013, 09:08   #3
 
erickreq's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 98
Received Thanks: 100
thanks for collection
erickreq is offline  
Old 11/13/2013, 14:08   #4
 
elite*gold: 0
Join Date: Jul 2012
Posts: 312
Received Thanks: 286
Quote:
Originally Posted by nic0y0525 View Post
will it work in League of shaiya?

<-- i'm just a noob..sorry for this question
If the adm add this on his server yes it will work
andr3y_you96 is offline  
Old 11/15/2013, 07:13   #5
 
elliuspluss's Avatar
 
elite*gold: 0
Join Date: Jun 2011
Posts: 13
Received Thanks: 0
to paste into the table PS_UserData.dbo.usp_Try_GameLogout_R produces the following error:
Quote:
Mens 137, Level 15, State 1, Procedure usp_Try_GameLogout_R, Line 75
Must declare the scalar variable "@ CharID".
Mens 102, Level 15, State 1, Procedure usp_Try_GameLogout_R, Line 78
Incorrect syntax near '+'.
Mens 137, Level 15, State 2, Procedure usp_Try_GameLogout_R, Line 83
Must declare the scalar variable "@ CharID".
where am I wrong?
elliuspluss is offline  
Old 11/15/2013, 09:15   #6
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
I was hoping for you to at least read the error text and try to understand it.

Add
Code:
DECLARE @CharID INT
before the WHILE loop in usp_Try_GameLogout_R.

And also, for ****'s sake, read the errors, they state it too **** clearly that you had to declare a variable named @CharID, having the INT datatype, because that's what a CharID is in the Chars table.

P.S. SQL Server 2005 is gay, that's the reason for your 2nd error still occurring.
nubness is offline  
Thanks
3 Users
Old 11/15/2013, 13:11   #7
 
elite*gold: 0
Join Date: Mar 2013
Posts: 46
Received Thanks: 4
It wont works for me. I Use SQL 2008 R2 and when i use the Etain potion, and relog (out of game and log in again) Then i look in the dbo.LevelUpRuneLog and then it say me As Done = False, but in the SQL Querys on top of you (nubness) it says when Done = 0 its not be successed and when Done = 1 it works with +1 lvl... But when i want to delete the "False" and write "1" or "0" it cant be accepted from SQL..

Can you help me? Forgot i anything? pls help...
Lordblubb is offline  
Old 11/15/2013, 14:23   #8
 
elite*gold: 0
Join Date: Jul 2012
Posts: 312
Received Thanks: 286
you can change the table here
Code:
[Done] [bit] NOT NULL,
to this
Code:
[Done] [int] NOT NULL,
andr3y_you96 is offline  
Old 11/15/2013, 15:13   #9
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
The value of the bit field is either 0 or 1. The text representations are False for 0 and True for 1, what's so complicated about this ?
nubness is offline  
Thanks
1 User
Old 11/15/2013, 17:54   #10
 
elite*gold: 0
Join Date: Jul 2010
Posts: 523
Received Thanks: 523
This is a little off topic here:
How many of these additions to usp_Insert_Action_Log_E (plus all the needed tables for each), you think we could add, before it start to produce some Load on the server? I mean, a server with ppl heavily farming all day and producing huge Logs. (I've tried blocking the 'mob damage' logs but since they're useful to quickly find GRB Reset, I've enabled them again).
sominus is offline  
Old 11/15/2013, 19:02   #11
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
Any dedicated server will handle the load no matter how many of these IFs you have. Take my advice, use ELSE statements as well.
As an example, if you do like I used to do by filtering all the important logs in separate tables for faster processing in the future:
Code:
IF @ActionType = 103
BEGIN
-- some bullshit here
END
IF @ActionType = 104
BEGIN
-- some other bullshit here
END
IF @ActionType = 107
BEGIN
-- some other bullshit here
END
IF @ActionType = 108
BEGIN
-- some other bullshit here
END
Code:
IF @ActionType = 103
BEGIN
-- some bullshit here
END
ELSE IF @ActionType = 104
BEGIN
-- some other bullshit here
END
ELSE IF @ActionType = 107
BEGIN
-- some other bullshit here
END
ELSE IF @ActionType = 108
BEGIN
-- some other bullshit here
END
The second part, the one containing ELSE statements, will save resources because if the first IF statement returns true, the ELSE statements will be skipped, whereas in the first one, even if the first IF statement returns true, it will still run through the next ones.

Again, modern hosts can support such load without much trouble. Still, personally, if I see a chance to reduce CPU usage even by 0.001%, I won't hesitate to do that, assuming it doesn't cut off performance of course.
nubness is offline  
Thanks
2 Users
Old 11/15/2013, 19:14   #12
 
elite*gold: 0
Join Date: Mar 2013
Posts: 46
Received Thanks: 4
Okay 0 =False and 1=True, but why it dont work, when i drunk ingame the Etain Potion, relog and iam not lvl 2? Ive made all what you tell us whith the scripts.. it wont work..

Help me pls
Lordblubb is offline  
Old 11/15/2013, 19:35   #13
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
Re-read the tutorial and check your database to see if it matches.
nubness is offline  
Old 03/15/2014, 05:47   #14
 
GM.Triest's Avatar
 
elite*gold: 0
Join Date: Feb 2009
Posts: 192
Received Thanks: 151
P.S
To prevent someone from going a higher level than your server is set to, put this somewhere in usp_Try_GameLogout_R


I'll now stop spamming old threads QQ
GM.Triest is offline  
Old 04/08/2014, 09:50   #15
 
elite*gold: 0
Join Date: Mar 2013
Posts: 46
Received Thanks: 4
yeah

Thanks GM.Triest.
But another way to make the Level-Up-Stone more attractiv and prevent that anyone is leveling over the Max. Level cap is to change it in dbo.ups.TryGameLogout_R the old script to this

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 = 90
WHERE CharID = @CharID

UPDATE PS_GameLog.dbo.LevelUpRuneLog
SET Done = 1
WHERE CharID = @CharID

END



*Aswell now you level to level 90 when you use this Level-UP-Stone, which prevent of getting higher as allowed. Everytime u use the Stone you will set up to 90, and not from 1 to 2. I think its much better! But, Nubness, Thanks For your Nice idea with the Level-Up-Stone! Your a Shaiya-Dev-*** i think!!!

Lordblubb is offline  
Thanks
2 Users
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 +1. The time now is 15:45.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.