Jump to content

Recommended Posts

Posted

Some admins will found this intereseting, since i got tired of txt log searching... i decided to mod db SPs to store owner changes into db... this will probably estress SQL a bit and db size will increase a lot, but if you have a good SQL server you don't need to care about that.

 

First we need to create a new table, in that table we will store all item parameters and 1 new field, that will be the exact date item change owner.

 

This will only track single items (consume_type_normal), because trying to track other kind of items is a bit hard (if not almost imposible) due to item_id changes.

 

Well.. here we go... first step: Creating table.

Code:

 

USE [lin2world]

GO

/****** Object:  Table [dbo].[user_item_log]    Script Date: 08/06/2008 20:52:58 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[user_item_log](

[item_id] [int] NOT NULL,

[char_id] [int] NOT NULL,

[item_type] [int] NOT NULL,

[amount] [int] NOT NULL,

[enchant] [int] NOT NULL,

[eroded] [int] NOT NULL,

[bless] [tinyint] NOT NULL,

[ident] [int] NOT NULL,

[wished] [tinyint] NOT NULL,

[warehouse] [int] NOT NULL,

[date] [datetime] NOT NULL CONSTRAINT [DF_Table_1_create_date]  DEFAULT (getdate())

) ON [PRIMARY]

 

-----------------------------------------------------------------------------------------------

Second step: Modifying lin_UpdateUserItem Store Procedure.

 

Code:

 

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

go

 

 

/****** Object:  Stored Procedure dbo.lin_UpdateUserItem    Script Date: 2003-09-20 ?? 11:51:57 ******/

/********************************************

lin_UpdateUserItem

 

INPUT

@char_id INT,

@item_type INT,

@amount INT,

@enchant INT,

@eroded INT,

@bless INT,

@ident INT,

@wished INT,

@warehouse INT,

@item_id INT

OUTPUT

return

made by

carrot

date

2002-06-09

********************************************/

ALTER PROCEDURE [dbo].[lin_UpdateUserItem]

(

@char_id INT,

@item_type INT,

@amount INT,

@enchant INT,

@eroded INT,

@bless INT,

@ident INT,

@wished INT,

@warehouse INT,

@item_id INT

)

AS

SET NOCOUNT ON

 

-- START FidoW addon item tracker

DECLARE @isOK INT

SELECT @isOK = id FROM itemdata WHERE isQuest = 0 AND consumetype = 'consume_type_normal' AND id = @item_type

 

IF (@isOK IS NOT NULL)

BEGIN

DECLARE @old_char_id int

SELECT @old_char_id = char_id FROM user_item WHERE item_id = @item_id

IF (@old_char_id <> @char_id)

BEGIN

INSERT INTO user_item_log (item_id,char_id,item_type,amount,enchant,eroded,bless,ident,wished,warehouse,date)

VALUES (@item_id,@char_id,@item_type,@amount,@enchant,@eroded,@bless,@ident,@wished,@warehouse,GETDATE())

END

END

-- END FidoW addon item tracker

 

UPDATE user_item  set char_id=@char_id, item_type=@item_type, amount=@amount, enchant=@enchant, eroded=@eroded, bless=@bless, ident=@ident, wished=@wished, warehouse=@warehouse WHERE item_id=@item_id

 

---------------------------------------------------------------------------------------------------

Step three: Update lin_CreateItem Store Proceduce.

 

Code:

 

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

go

 

 

 

/****** Object:  Stored Procedure dbo.lin_CreateItem    Script Date: 2003-09-20 오전 11:51:57 ******/

/********************************************

lin_CreateItem

create item sp

INPUT

@char_id INT,

@item_type INT,

@amount INT,

@enchant INT,

@eroded INT,

@bless TINYINT,

@ident TINYINT,

@ready TINYINT,

@wished TINYINT,

@warehouse INT

OUTPUT

Item_ID, @@IDENTITY

return

made by

carrot

date

2002-01-31

********************************************/

ALTER PROCEDURE [dbo].[lin_CreateItem]

(

@char_id INT,

@item_type INT,

@amount INT,

@enchant INT,

@eroded INT,

@bless TINYINT,

@ident TINYINT,

@wished TINYINT,

@warehouse INT

)

AS

SET NOCOUNT ON

 

insert into user_item

(char_id , item_type , amount , enchant , eroded , bless , ident , wished , warehouse)

values

(@char_id, @item_type , @amount , @enchant , @eroded , @bless , @ident , @wished , @warehouse)

 

SELECT @@IDENTITY

 

-- START FidoW addon item tracker

DECLARE @isOK INT

SELECT @isOK = id FROM itemdata WHERE isQuest = 0 AND consumetype = 'consume_type_normal' AND id = @item_type

 

IF (@isOK IS NOT NULL)

BEGIN

DECLARE @item_id INT

SELECT TOP 1 @item_id = item_id FROM user_item

WHERE char_id = @char_id AND item_type =  @item_type AND amount = @amount AND enchant = @enchant AND eroded = @eroded AND bless = @bless AND ident = @ident AND wished = @wished AND warehouse = @warehouse

ORDER BY item_id DESC

 

INSERT INTO user_item_log (item_id,char_id,item_type,amount,enchant,eroded,bless,ident,wished,warehouse,date)

VALUES (@item_id,@char_id,@item_type,@amount,@enchant,@eroded,@bless,@ident,@wished,@warehouse,GETDATE())

END

-- END FidoW addon item tracker

 

--------------------------------------------------------------------------------------------------

 

This will NOT WORK if you have itemdata table empty or not updated (use CacheD and CachedScript to update that table)

 

 

How to use ? Just execute both querys into sql and its done, and it will start storing it since now.

 

What can we do with this ? We can track all items owner changes, in case some users log into other user account and steal all the items, we can track it easy with our new table, and more important, we dont need to look at logs anymore.

 

I hope someone will find this usefull.

 

 

If we want to initialize user_item_log table with all items already stored.... we can run the next query:

 

Code:

 

INSERT INTO user_item_log

SELECT item_id,char_id,item_type,amount,enchant,eroded,bless,ident,wished,warehouse,'2001-01-01 00:00:00'

FROM user_item

WHERE item_id NOT IN (SELECT DISTINCT item_id FROM user_item_log)

AND item_type IN (SELECT id FROM itemdata WHERE isQuest = 0 AND consumetype = 'consume_type_normal')

 

Of course we dont get the real date, but now we have stored the current owner waiting until the next change.

 

--------------------------------------------------------------------------------------------------

I use search and didnt found anything like this guide

 

Credits for this awesom guide goes to FidoW

 

Hope u like  bb

Posted

reading the first line of the code i see it was for l2 off  :P

 

 

From only this ;D

 

that is the most wierd i found this in a Lineage II Java Develop section haha xD my bad again ( i also give it a fast read to the text =P)

 

any way tell me your opinion :/ w00t!

 

[EDIT] ty k4rma for moving it ^^

  • 9 months later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Lineage2 Freya High Five @ Reshade with fog and rain etc @ Gracia final epilogue atmosphere   this reshade will eat lots of GPU power 50% or more of an RTX 3060 so be carefull depending on what effects are activated and their settings will eat even more GPU recomended 60hz monitor settings and via nvidia panel in Lineage2 game profile vsync settings to on effects are set up till film deck and the rest are not used but still working again this can eat alot of GPU Don't overheat GPU this is for freya high five but might work on others too copy in the  System  folder the folder  reshade-shaders  and the files  d3d9.dll  ReShade.ini  ReShadePreset.ini  ReShade.log  CccDddCcc.ini insert opens the menu and delete is on and of some settings need  ctrl + left click  to be changed   making another profile will reset the not activated effects to their default values so just copy the profile  CccDddCcc  and rename if needed also something needs to be closed from settings in game menu, the blur at distance and advanced shaders but keeping the advanced water effects all reflections   for those that don't like the h5 look of the sky and the red fog and rain and ambien red at night on all maps well if we want the cool gracia final epilogue back then we need to do this rename the  Maps  folder to Mapsretail or whatever copy the  Maps  folder from gracia final epilogue to h5 also we need the  L2_Skies.utx  from gracia final epilogue  Textures  folder to be replaced and also we need to do the same to the files  timeenv0.int  timeenv1.int  timeenv2.int  timeenv3.int  found in  system  folder   another setting that will probably be needed but not really tested out is to open file  option.ini  from  system  folder and add cachesize like this   [FirstRun] FirstRun=2   [Engine.GameEngine] CacheSizeMegs=512   also maybe is good to change those to 4.000000   [ClippingRange] Terrain=4.000000 Actor=4.000000 StaticMesh=4.000000 StaticMeshLod=4.000000 Pawn=4.000000       sorry bad english   https://mega.nz/file/aRNXxDrQ#mbxrNERBtW0XEEezK6w8-86oZWuX1k6NgtR6RZWKRVM   the compression on the video is kinda bad but meh    
    • Thanks, tho if possible let's lock the topic. I decided to finish up myself as I only created this to save up my time, but seems that while waiting for prop dev. finished myself.
    • Plus he have Discord where using Celestine, Nightwolf and others names to ensure that he is legit, what a looser, that's why mxc have bad reputation, coming here is like 50/50 get scammed.
    • Greetings, MaxCheaters community! We are the development team behind projects like AdenLand, Classic GvE, TinyEssence, PvPEssence, and several others. Over the years of managing high-traffic servers, we’ve built our own ecosystem of tools for datapack and client editing, simply because standard software often failed to meet our production needs or was too slow. Today, we are opening access to these professional solutions for our colleagues in the dev scene. You can explore our suite of editors and utilities here: 👉 https://la2.tools/ Why choose our tools? Battle-Tested: This software is used daily to maintain and update our own live projects. Efficiency: Designed to automate routine tasks that usually take hours or even days. Stability: Built to handle complex client/server structures where generic tools often crash. We are ready to provide consultations on integrating these tools into your development workflow to make your process faster and more secure.  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..