Hello everyone,
As someone seemed interested in a level-up rune/stone in [Only registered and activated users can see links. Click Here To Register...], 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.
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.
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.
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.
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 !
As someone seemed interested in a level-up rune/stone in [Only registered and activated users can see links. Click Here To Register...], 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.
| UserID | UserUID | CharID | CharName | ActionType | Value2 | Text1 | Text2 |
| ciochris | 1 | 9 | Turbo | 112 | 100001 | Etain Potion | use_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
Code:
IF @ActionType = 112 AND @Text2 = 'use_item' AND @Value2 = 100001 BEGIN INSERT INTO LevelUpRuneLog VALUES (@UserUID, @CharID, 0) END
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
Enjoy !