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

    • 🔥 Grand Opening: 29 May 2026 – 19:00 Germany Time Website: https://l2-lorena.com/ Discord: https://discord.gg/TYZ88Tgx4b ━━━━━━━━━━━━━━━━━━━━━━ General Information • Chronicle: Interlude • Server Type: PvP Rates • EXP/SP: x5000 • Adena: x500 • Drop: x500 Premium Account • 2x EXP / Drop / Adena ━━━━━━━━━━━━━━━━━━━━━━ Starting Setup • Starting Town: Aden • Starting Level: 76 • Starting Gear: S-Grade ━━━━━━━━━━━━━━━━━━━━━━ Enchant System • Safe Enchant: +4 • Normal Scroll: 50% • Blessed Scroll: 70% • Crystal Scroll: 100% ━━━━━━━━━━━━━━━━━━━━━━ Subclass System • All classes available • Dominator subclass enabled • Dominator subclass cost: 20 Donate Coins ━━━━━━━━━━━━━━━━━━━━━━ Items Balance • Custom items • Elegia Armor added as Custom Set • Rare S-Grade items with boosted stats • Balanced PvP gameplay ━━━━━━━━━━━━━━━━━━━━━━ Siege & PvP Rewards • Aden Castle special reward: 200 Donate Coins • Competitive PvP and siege-focused gameplay ━━━━━━━━━━━━━━━━━━━━━━ Epic Bosses • All Epic Bosses available up to Valakas ━━━━━━━━━━━━━━━━━━━━━━ Augmentation Rates • Top LS: 100% skill chance • High LS: 7% skill chance • Mid LS: 3% skill chance ━━━━━━━━━━━━━━━━━━━━━━ Perfect For Players Who Want ✔ Fast progression ✔ Clean Interlude gameplay without custom chaos ✔ Active PvP action ✔ Competitive sieges ✔ Long-term fun
    • I think u need https://adrenalinebot.com/en/script/anti-captcha/ But contact tech support to be sure it works on ur server
    • Hello everyone, Are you looking for a server where you can have fun with friends and relive the good old days of Lineage II? Join us for an enjoyable adventure, exciting battles, and a nostalgic old-school experience together with the community. Introducing a Gold-style fast progression gameplay experience — no more spending months in the same zone farming endlessly. Enjoy faster progress, more action, and a more rewarding adventure from the very beginning. For more information and updates, visit our Facebook page and join the community! Download patch:https://mega.nz/file/hEUAFIAY#8F5BMBRV_v-O1gjDTLsCkmFiWFMvT3hzVYSMdswm2rs
    • ⚡ PRIVATE L2 SOURCE CODE & CONTRACT BUILDS Essence / Classic / High Five / Main GOD Private enterprise-level Lineage 2 development for serious projects ENGLISH For many years our studio was known mostly for public Lineage 2 builds and public development services. However, for many years now our main focus has been private development for serious projects and investors. Over time we moved away from mass-market development and focused on quality, stability, deep detailing and long-term project support. This approach allowed us to create products of a completely different level designed for large live-projects and long-term operation. Today, in addition to our old public builds, we also offer private enterprise-level solutions developed by a full professional team with many years of Lineage 2 experience. We work only with serious teams, investors and projects that understand the value of quality private development. ◆ L2 Essence — Private Builds & Source Code Latest protocols: 557–559+ Available only on a long-term contract basis. Includes: • 100% official content implementation • Custom interface systems • Active protocol updates while the contract is active • Full access to the project source code • Full technical support for the project • Bug fixing and feature development • Help with launch and long-term server development • A full professional development team working on your project • Java developers, datapack developers and project management • Many years of experience with large live projects • Long-term private cooperation and support Contract terms: Start: 10,000 USD Monthly contract: 3,000 USD / month Older Essence source code available for direct purchase: • Protocols 507–520 — 10,000 USD • Protocols 474–502 — 7,000 USD • Protocols 447–464 Seven Signs — 5,000 USD • Protocol 388 Crusade — 2,500 USD Full details: https://mmore.dev/en/essense2.html ◆ L2 Classic — Private Builds & Source Code Latest protocols: 557–559+ Available only on a long-term contract basis. Includes: • 100% official content implementation • Custom interface systems • Active protocol updates while the contract is active • Full access to the project source code • Full technical support for the project • Bug fixing and feature development • Help with launch and long-term server development • A full professional development team working on your project • Java developers, datapack developers and project management • Many years of experience with large live projects • Long-term private cooperation and support Contract terms: Start: 10,000 USD Monthly contract: 3,000 USD / month Classic source code available for direct purchase: • Classic 542 protocol — 15,000 USD • Classic 520 protocol — 12,000 USD • Classic 507 protocol — 10,000 USD • Classic 286 protocol — 8,000 USD Negotiable. Contract support is available. Full details: https://mmore.dev/en/classic2.html ◆ High Five — Private Build Private High Five build with years of live-server experience. Includes: • 100% official content • Full access to the project source code • Full technical support for the project • Bug fixing and feature development • Help with launch and long-term server development • A full professional development team working on your project • Java developers, datapack developers and project management • Many years of experience with large live projects • Long-term private cooperation and support Contract terms: Start: 3,000 USD Monthly contract: 3,000 USD / month Full details: https://mmore.dev/en/hf2.html ◆ Main / GOD — In Development Development of the Main / GOD branch, protocol 559+, has started. Pre-orders and sponsorship discussions are open. We accept only a limited number of projects from different regions with maximum regional exclusivity for each partner. IMPORTANT The latest Essence and Classic protocols are available only through long-term private contracts. Direct source code sales are available only for older protocols. If you need the newest protocols, active development, updates and support — contract work is the correct option. РУССКИЙ Ранее наша студия в основном занималась публичными сборками Lineage 2 и массовыми услугами разработки. Однако уже много лет основное направление нашей работы — приватная разработка для серьёзных проектов и инвесторов. Со временем мы ушли от работы на массовость и сосредоточились на качестве, стабильности, глубокой детализации и долгосрочном развитии проектов. Именно такой подход позволил нам создать продукты совершенно другого уровня, рассчитанные на крупные live-проекты и долгосрочную эксплуатацию. Сегодня помимо наших старых публичных сборок мы также предлагаем приватные enterprise-level решения, над которыми работает полноценная команда профессиональных разработчиков с многолетним опытом работы в сфере Lineage 2. Мы работаем только с серьёзными командами, инвесторами и проектами, которые понимают ценность качественной приватной разработки. ◆ L2 Essence — приватные сборки и исходники Актуальные протоколы: 557–559+ Доступны только на контрактной основе. Входит: • 100% реализация официального контента • Кастомные интерфейсные системы • Обновления протоколов на время действия контракта • Полный доступ к исходному коду проекта • Полная техническая поддержка проекта • Исправление ошибок и доработка функционала • Помощь с запуском и развитием сервера • Работа целой команды профессионалов над вашим проектом • Java-разработчики, datapack-разработчики и project management • Многолетний опыт работы с крупными live-проектами • Долгосрочная приватная работа и сопровождение проекта Условия контракта: Стартовый взнос: 10,000 USD Ежемесячно: 3,000 USD / месяц Старые протоколы Essence для прямой покупки исходников: • Протоколы 507–520 — 10,000 USD • Протоколы 474–502 — 7,000 USD • Протоколы 447–464 Seven Signs — 5,000 USD • Протокол 388 Crusade — 2,500 USD Подробнее: https://mmore.dev/essense2.html ◆ L2 Classic — приватные сборки и исходники Актуальные протоколы: 557–559+ Доступны только на контрактной основе. Входит: • 100% реализация официального контента • Кастомные интерфейсные системы • Обновления протоколов на время действия контракта • Полный доступ к исходному коду проекта • Полная техническая поддержка проекта • Исправление ошибок и доработка функционала • Помощь с запуском и развитием сервера • Работа целой команды профессионалов над вашим проектом • Java-разработчики, datapack-разработчики и project management • Многолетний опыт работы с крупными live-проектами • Долгосрочная приватная работа и сопровождение проекта Условия контракта: Стартовый взнос: 10,000 USD Ежемесячно: 3,000 USD / месяц Исходники Classic для прямой покупки: • Classic 542 protocol — 15,000 USD • Classic 520 protocol — 12,000 USD • Classic 507 protocol — 10,000 USD • Classic 286 protocol — 8,000 USD Торг возможен. Контрактная поддержка доступна. Подробнее: https://mmore.dev/classic2.html ◆ High Five — приватная сборка Приватная High Five сборка с многолетним опытом работы на живых проектах. Входит: • 100% официальный контент • Полный доступ к исходному коду проекта • Полная техническая поддержка проекта • Исправление ошибок и доработка функционала • Помощь с запуском и развитием сервера • Работа целой команды профессионалов над вашим проектом • Java-разработчики, datapack-разработчики и project management • Многолетний опыт работы с крупными live-проектами • Долгосрочная приватная работа и сопровождение проекта Условия контракта: Стартовый взнос: 3,000 USD Ежемесячно: 3,000 USD / месяц Подробнее: https://mmore.dev/hf2.html ◆ Main / GOD — в разработке Мы начали разработку ветки Main / GOD, протокол 559+. Открыты предварительные обсуждения, предзаказы и спонсорские контракты. Принимается ограниченное количество проектов из разных регионов мира с максимальной региональной эксклюзивностью для каждого партнёра. ВАЖНО Самые актуальные протоколы Essence и Classic доступны только на долгосрочном контракте. Прямая продажа исходного кода доступна только для более старых протоколов. Если вам нужны самые свежие версии, развитие, обновления и поддержка — выбирайте контрактную работу с нашей командой. CONTACTS / КОНТАКТЫ Telegram:  @L2scripts Microsoft Teams:   l2-scripts.com@outlook.com      Old Skype account: Urchika E-mail:    L2scripts.com@gmail.com IMPORTANT All discussions, project details, examples, testing access, source code demonstrations, technical discussions and cooperation terms are discussed strictly in Telegram only. We do not discuss private development publicly on the forum. Telegram is the main and preferred communication platform for all serious inquiries. ВАЖНО Все обсуждения, детали проектов, примеры, предоставление тестирования, демонстрации исходников, технические вопросы и условия сотрудничества обсуждаются строго только в Telegram. Публично на форуме приватная разработка не обсуждается. Telegram — основная и приоритетная платформа для связи по всем серьёзным вопросам. All questions are discussable. We work for the best Lineage 2 projects in the world.
  • 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..