Jump to content
  • 0

Cancel subclass keep skills


Question

Posted

Hello fooooolks, i have one and big problem. I have stacksub server based on l2j-mobius. And i have npc Maximilian where player can add/change/cancel a subclass. All good. But, when player cancel a subclass to do another instead, skills from canceled subclass are retained. How i can make this to disappear one with cancel?

 

Thank you !

7 answers to this question

Recommended Posts

  • 0
Posted

            player.giveAvailableSkills();
            player.sendSkillList();

            player.checkAllowedSkills();

 

maybe this will help you 

  • 0
Posted

look one way is go to player.java or pcisntance.java what you have and search for

 

public boolean setActiveClass(int classIndex)

 

search for

restoreHenna(); or

 

            restoreSkills();
            rewardSkills();
            regiveTemporarySkills();  

and try to add checkAllowedSkills();  or restoreSkills();

  • 0
Posted

This is method available to restore player skills. An here should be a check for all subclasses available. And for that available subclasses to give their skills. And rest of skills to be deleted

 

private void restoreSkills()
	{
		try (Connection con = DatabaseFactory.getConnection();
			PreparedStatement ps = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
		{
			// Retrieve all skills of this PlayerInstance from the database
			ps.setInt(1, getObjectId());
			try (ResultSet rs = ps.executeQuery())
			{
				while (rs.next())
				{
					final int id = rs.getInt("skill_id");
					final int level = rs.getInt("skill_level");
					
					// Create a Skill object for each record
					final Skill skill = SkillData.getInstance().getSkill(id, level);
					if (skill == null)
					{
						LOGGER.warning("Skipped null skill Id: " + id + " Level: " + level + " while restoring player skills for playerObjId: " + getObjectId());
						continue;
					}
					
					// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
					addSkill(skill);
					
					if (Config.SKILL_CHECK_ENABLE && (!canOverrideCond(PlayerCondOverride.SKILL_CONDITIONS) || Config.SKILL_CHECK_GM) && !SkillTreeData.getInstance().isSkillAllowed(this, skill))
					{
						Util.handleIllegalPlayerAction(this, "Player " + getName() + " has invalid skill " + skill.getName() + " (" + skill.getId() + "/" + skill.getLevel() + "), class:" + ClassListData.getInstance().getClass(getClassId()).getClassName(), IllegalActionPunishmentType.BROADCAST);
						if (Config.SKILL_CHECK_REMOVE)
						{
							removeSkill(skill);
						}
					}
				}
			}
		}
		catch (Exception e)
		{
			LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
		}
	}

 

  • 0
Posted

yes this is what it does but you need to make it run when players get class changed , you need to search for "public boolean setActiveClass(int classIndex)" or something like this fiind exact moment when class is changed and after that add 

checkAllowedSkills(); or  restoreSkills();

 

i try to help you but i have 0 experience in substack type servers

 

 

Guest
This topic is now closed to further replies.


  • Posts

    • Tool that allows you to download the Lineage 2 game client directly from the official publisher CDNs. It fetches the CDN's file list and downloads every patch file, decompresses it (LZMA / Zip) and writes the finished client to disk — and can resume or repair an existing installation instead of starting over. It runs several client downloads at once through a batch queue, so you can prepare multiple regions or versions in a single session.   Supported: NCSoft CDNs (TW / KR / JP / NA) and  4game CDNs(RU / EU)   Download: https://drive.google.com/file/d/11SDcNASqO2GKOBT79LFu7mqvSRSJZvBS
    • https://l2avokado.com/ Hello everyone,   After some time of development, we've decided to open L2Avokado to the public in its current development stage. We're looking for players who enjoy Interlude and would like to help shape the project before its official release.   This isn't a "launch" announcement. Instead, we're inviting the community to log in, explore the server, test the systems we've built, and provide honest feedback. Whether it's bug reports, balance suggestions, progression ideas, or quality-of-life improvements, we'd love to hear them.   Our goal has always been to create an Interlude server that feels familiar while offering a fresh progression experience. We've intentionally avoided custom weapons, armor, and client modifications. Instead, we've focused on redesigning progression through reworked hunting grounds, quests, crafting, and gameplay systems while remaining compatible with a clean Interlude client.   At this stage, the core progression path has been implemented, including the main hunting grounds, quests, custom systems, and events. However, as the project is still under active development, there will inevitably be bugs, balance issues, and areas that require further polishing.   This is exactly why we'd like your help.   We're looking for players who are willing to: Test gameplay and progression. Report bugs and exploits. Suggest balance improvements. Share ideas for new features or quality-of-life changes. Help us build a server that the community genuinely enjoys playing.   The Client and System downloads are already available on our website, so you can jump straight into the game. We're also working on a dedicated launcher that will simplify installation and future updates.   If you're interested in helping develop a unique Interlude project and want your feedback to genuinely influence the direction of the server, we'd love to have you with us.   We look forward to seeing you in-game and hearing your thoughts on Discord. https://l2avokado.com/
  • 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..