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

    • 📜 • Mass PVP – Craft – Progressive Server (ITEMS, ARMOR, WEAPONS, ETC) 🕹️ • Chronicles: Lineage 2 - Interlude (C6) 🛠️ • Retail status 🕒 • Server Time: GMT -3 🏙️ • Main Town: Giran ✨ • Teleportation for all Towns, Gk Global 🛡️ • NPC BUFFER - GMSHOP B-GRADE - DONATION SHOP - AUCTION MANAGER 🐉 • Epic Bosses: Chaotic Zones 🔁 • Protection respawn: 15 seconds ⏰ • Restart Server: 05:00 AM Today 💸 • RTM allowed between players (ask Staff if in doubt) 📊 SERVER RATES: • EXP: x8 • SP: x10 • Adena: x3 • Seal Stone: x3 • Drop: x3 • Spoil: x5 • Raid EXP/SP/Drop: x3 • Premium Rates: x2 🌐 Website: https://www.l2roosters.com 💬 Discord: https://discord.gg/cUyYXrfy 🔥 Join us now and forge your legacy at Roosters Gaming!
    • Hello, lovely people, how are you? I just finished compiling the L2jFrozen project Rev: 1132 (very old). I don't mind it being too old, since the project is for me and my children. (LAN/Offline) it's not meant to be put online. I want to learn and give my children more comfort when playing. And for my part, I also experiment with the game. My problem is that I don't know much about the subject. I was able to make some basic configurations to my liking and that of my children, but it never compiles or anything like that... I would really need help from you, the community... I simply want to remove all subclass restrictions, remove the restriction on "Overlord, Warsmith, and Dark Elf subclasses with White Elves and vice versa." Thank you very much in advance! Greetings, community.
    • Warriors, prepare for a new era! We are pleased to announce that on July 12, with the morning restart, Airin will be updated to Chronicle 4: Scions of Destiny. - Open Beta Testing (OBT) will begin on July 9. Everyone will be able to test the update in advance, including class mechanics, quests, and new content. - The Clan Hall Auction will take place on July 13. We’ve also prepared a traditional bonus start - details will be shared in the coming days. The full list of changes is available in the official patch notes. Thank you for your support and participation in the project. See you in Chronicle 4! The game client download will be available soon.
    • We are taking new orders. Kindly DM us on Telegram!
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock