Jump to content
  • 0

Subclass Cumulative + Skilles Accumulated


Question

Posted
I have to make a server with subclass accumulative (principal + 3 subs)

of any class and race.

and that skilles se accumulate between of a subclass and another.

 

I do it with this SP:

 



set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[lin_SetAquireSkill]
(
@char_id INT,
@subjob_id INT,
@skill_id INT,
@skill_level TINYINT
)
AS
DECLARE @subjob_acu INT

SET NOCOUNT ON

set @subjob_acu = 0

WHILE (@subjob_acu < 3)

BEGIN

SET @subjob_acu = @subjob_acu + 1
IF EXISTS(SELECT skill_lev FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id = @subjob_acu)
UPDATE user_skill SET skill_lev = @skill_level WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id <= @subjob_acu

ELSE
INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, @subjob_acu, @skill_id, @skill_level);
IF NOT EXISTS(SELECT skill_id FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND skill_lev = @skill_level AND subjob_id = 0)
INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, 0, @skill_id, @skill_level);

END



 

But only accumulate when "switch subclass".

When you subclass, the skilles of previous class  is cleared and starts loading the skilles of the new class, I need you to stay all skilles of all subclass.

is it possible?

15 answers to this question

Recommended Posts

  • 0
Posted

1. 4 jobs exist - not 3.

 

2. You already set subjob_acu to 1 before even making the loop effectively skipping all skills learned for the main\base class.

 

3.

 

 IF EXISTS(SELECT skill_lev FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id = @subjob_acu)
   UPDATE user_skill SET skill_lev = @skill_level WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id = @subjob_acu
 ELSE
   INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, @subjob_acu, @skill_id, @skill_level)

 set @subjob_fer = (@subjob_acu + 1)

 

 

Done.

  • 0
Posted
When a subclass ago erased all skilles and start to load the new class skilles.

I need not to delete, that are accumulated.

In the database yes accumulate.

But the player can see all skilles only when restarting the server.

Or when you "switch subclass".

It's like the player needs to do a refresh to the database so you can see all skilles. -

  • 0
Posted

lin_GetAquireSkill:

ALTER PROCEDURE [dbo].[lin_GetAquireSkill]
(
	@char_id	INT,
	@subjob_id	INT
)
AS
SET NOCOUNT ON

SELECT skill_id, skill_lev, is_lock FROM user_skill WHERE char_id = @char_id AND ISNULL(subjob_id, 0) = @subjob_id ORDER BY 1, 2

Edit it to:

ALTER PROCEDURE [dbo].[lin_GetAquireSkill]
(
	@char_id	INT,
	@subjob_id	INT
)
AS
SET NOCOUNT ON

SELECT skill_id, skill_lev, is_lock FROM user_skill WHERE char_id = @char_id ORDER BY 1, 2

Haven't tested but might work ;)

  • 0
Posted (edited)
Thank you very much for answering!

With this function you can do, I only need to add the turn of the subjob0_class, as I do?

 



function setCharacterData2($char_id, $genderId, $raceId, $classId, $faceId, $hairShapeId, $hairColorId)
{

global $cached_errors, $admin_name;
global $cached_ip, $cached_port;
$buf=pack("cVVVVVVV", 0x10, $char_id, $genderId, $raceId, $classId, $faceId, $hairShapeId, $hairColorId).tounicode_UA($admin_name);
$cachedsocket=@fsockopen($cached_ip, $cached_port, $errno, $errstr, 1) or die($notconnected);
fwrite($cachedsocket,pack("s",(strlen($buf)+2)).$buf);
$len=unpack("v",fread($cachedsocket,2));
$rid=unpack("c",fread($cachedsocket,1));
for($i=0;$i<(($len[1]-4)/4);$i++){
$read=unpack("i",fread($cachedsocket,4));
$rs.=$read[1];
}
fclose($cachedsocket);
return $rs;

}

Edited by WaLas
  • 0
Posted

well i guess,do you wanna to save main class skills in your subclass?when you changed over 3 subclass,you will get 4 class skills?right?

 

yes, I want them to go accumulating skilles

  • 0
Posted (edited)

then you want incremental change -

 

so main = main

 

1st = main + 1st

 

2nd = main + 1st + 2nd

 

3rd = main + 1st + 2nd

 

correct?

 

haha....

 

@WaLas

will you make it via extend l2server?why not via ai.obj? DNS system?

anyway,via extend l2server is the best way,but its not so easy.

Edited by sandeagle
  • 0
Posted

then you want incremental change -

 

so main = main

 

1st = main + 1st

 

2nd = main + 1st + 2nd

 

3rd = main + 1st + 2nd

 

correct?

 

Yes, i need this. with extender or php.-

 

 

haha....

 

@WaLas

will you make it via extend l2server?why not via ai.obj? DNS system?

anyway,via extend l2server is the best way,but its not so easy.

 

The DN system fails when you switch to another race. -

  • 0
Posted

You can script it with tSQL - in GetAquireSkill.

 

 

Might possibly need a cacheD hook to refresh char on subjobchange\create for cached internal memory block.

 

(I can't remember if  that's needed but i believe i did it just with SQL alone).

  • 0
Posted

hey guys i got this at the moment

 

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[lin_SetAquireSkill]
(
@char_id INT,
@subjob_id INT,
@skill_id INT,
@skill_level TINYINT
)
AS
DECLARE @subjob_acu INT

SET NOCOUNT ON

set @subjob_acu = 0

WHILE (@subjob_acu < 3)

BEGIN

SET @subjob_acu = @subjob_acu + 1
IF EXISTS(SELECT skill_lev FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id = @subjob_acu)
UPDATE user_skill SET skill_lev = @skill_level WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id <= @subjob_acu

ELSE
INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, @subjob_acu, @skill_id, @skill_level);
IF NOT EXISTS(SELECT skill_id FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND skill_lev = @skill_level AND subjob_id = 0)
INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, 0, @skill_id, @skill_level);

END

 

 

 

i would like to do the same thing but with out changing the skin of the character

as now i can change subclass with out changing the skin but skills desapierd with subclass :(

  • 0
Posted

not very good on codding etc is there any thing that I need to change? like above ?

 

trying to save some $$ :( otherways devs will be doing it my Skype is sirblackx1 if anyone can guide me will be grate thanks

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

    • For others that would like to understand in more details:   The login server also uses a protocol (sent by the server to the client in the very first packet). For instance, the C4 client (the one I'm developing my emulator for) expects the protocol number `50721` (or `0xc621`) which works as follow (from what I've gathered): Preamble: L2 packets are divided into two parts: size and payload; As mentioned, every packet starts with two bytes containing the whole packet size (thus including those two bytes, e.g. a packet of size 15 will have the number `15` written onto its first two bytes and a following payload of 13 bytes); For login server, first byte of the payload is the opcode (game server must deal with variable-sized opcodes); Next bytes are the packet content; Before sending the packet, its buffer size (minus the initial two bytes) is padded to 8 bytes (required by upcoming Blowfish encoding); A checksum of the packet is appended at the end, then the payload is again padded to 8 bytes; If the opcode is not `0` (also written as `0x00`), then the payload is encoded by Blowfish; Packet is sent over the network. You can have a look at my implementation (in C++) here (do note I'm assuming little-endian).   In this protocol, the auth packet (`0x00`) sent back by the client is RSA encrypted using the RSA modulus sent in the first server packet, inserted right after the protocol number.  
    • Hello guys I wanna buy some  Lessons for an L2J Developer
    • Let me give you something for inspiration and get you addicted to bot AI     And a siege 😛     What I have notice helps a lot the LLM to act real, is to give it a real-persons background. So for each LLM in the context beggining, besides the L2 facts, give it a real-life back story "You are a 67 years old retired nurse who plays Lineage 2 while her husband reads his newspaper, you are calm, collected but get mad if insulted". But that makes for a creative bot but its repetitive. So what you can also do, is pick random 20 news sites and for each bot every 2-3 days, initialize a context that is affected by the "news" the bot reads in the "real world".  So for example there's Iran - US war ok ? You take the news, put it in an LLM and ask it, extract the "abstract feelings" that this news piece invokes into you without mentioning anything related to the news. Then you take the result and inject it to the bots LLM prompt after its backstory.  This leads to some VERY human-like behavior from bots. 
    • 🚀 Telonyx Contest Platform Telegram Native Giveaway & Contest System for Modern Communities 💎 White-Label • Self-Hosted • Telegram Mini App • Monetization Ready 🧠 Product Overview Telonyx Contest Platform is a production-ready Telegram Mini App system designed for running modern contests, giveaways and engagement campaigns directly inside Telegram. It replaces outdated bot-based mechanics with a fully interactive application experience — no commands, no chat spam, no external websites. Users interact with a clean, fast and mobile-first interface inside Telegram. ⚡ Core Experience Participants can: • 🚀 instantly join contests inside Telegram Mini App • 🎁 view prizes and participation rules • 📊 track real-time contest status • ✅ verify task completion automatically • 🏆 receive winner results and notifications • 💰 participate in free or paid campaigns Everything is fully native to Telegram. 🧩 Key Platform Capabilities 🎯 Contest Engine • advanced contest creation system • multiple winners and reward tiers • scheduled launches and auto-finish logic • contest duplication and templates • real-time participant tracking • flexible rule configuration 📱 Mini App Interface • modern Telegram Mini App UX • mobile-first optimized layout • fast loading and smooth transitions • participant counter & live status • prize showcase system • one-click participation flow 🔎 Task Verification System Automated validation of participation rules: • Telegram channel subscriptions • sponsor channel requirements • multi-channel verification logic • YouTube subscription checks • TikTok task validation ❌ Zero manual moderation required 🛡 Anti-Fraud & Security Layer • duplicate entry prevention • bot detection system • CAPTCHA integration • rule enforcement engine • participation integrity checks 🏆 Automated Winner Selection • fully automated draw system • transparent winner selection logic • instant result publishing • winner notification system • historical archive of all contests 💎 Telegram Stars Monetization • optional paid participation via Telegram Stars • native Telegram checkout integration • flexible entry pricing per campaign • direct monetization of engagement traffic 🌍 Multi-Language Architecture Built with localization in mind. Supported out of the box: • 🇬🇧 English • 🇷🇺 Russian • 🇺🇦 Ukrainian • 🇹🇷 Turkish • 🇪🇸 Spanish • 🇵🇹 Portuguese • ➕ extensible language system for custom localization All UI layers, notifications and admin panel can be fully translated per deployment. 🎯 Ideal Use Cases 🎮 Gaming Projects / Lineage II Servers • pre-launch hype campaigns • donation reward giveaways • VIP / premium account distribution • promo code campaigns • server opening events 🎥 Streamers & Creators • subscriber engagement campaigns • live stream giveaways • audience growth funnels • partnership promotions 🌐 Communities & Brands • automated engagement systems • viral marketing campaigns • audience retention mechanics 🏗 Architecture & Deployment • Telegram Mini App frontend • FastAPI backend architecture • PostgreSQL database layer • Redis caching system • Docker-based deployment • WebSocket real-time updates • REST API integration layer 📦 Self-hosted deployment — full control over infrastructure and data 🎨 White-Label & Customization Each installation can be fully customized: • complete UI/UX rebranding • project-specific visual identity • custom engagement mechanics • referral & viral systems • loyalty & progression systems • seasonal campaign modules • custom API integrations   💡 Why This Platform Traditional contest bots are limited, noisy and inefficient. Telonyx Contest Platform is a modern engagement layer for Telegram ecosystems — combining UX, automation and monetization in one system. ✔ Higher participation rate ✔ Lower friction ✔ Direct revenue via Telegram Stars ✔ Full control via self-hosted deployment 💼 Commercial Model • Single License (Self-Hosted Deployment) • White-Label Branding Rights • Optional Custom Development • Installation & Setup Service 📩 Contact For demo access, licensing details or custom implementation: @se1dhe @telonyx_dev  
    • https://discord.gg/acvqx9rbhy Added intelligent agent that reads scripts and config and provides infos to players regarding gameplay Like where to farm/max enchants etc etc   Added auto translate to En/ES/BR htmls without api
  • 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..