Jump to content

Recommended Posts

Posted

Hello community

 

This is the new protection i came up with for subclass skills stuck!

I hope you find it usefull

All credits go to me!

 

@ instance/L2VillageMasterInstance.java

                case 5: // Change Class - Action
+                        if(!player.canLearnSkills())
+                        {
+                        	player.sendMessage("Wait until you learn all your skills.");
+                        	return;
+                        }

                    if (Olympiad.getInstance().isRegisteredInComp(player)
                        || player.getOlympiadGameId() > 0)


---------------------------------------------------------
                case 7: // Change Subclass - Action
+                        if(!player.canLearnSkills())
+                        {
+                        	player.sendMessage("Wait until you learn all your skills.");
+                        	return;
+                        }

                    if (player.modifySubClass(paramOne, paramTwo))
                    {

---------------------------------------------------------
                case 4: // Add Subclass - Action (Subclass 4 x[x])

+                        if(!player.canLearnSkills())
+                        {
+                        	player.sendMessage("Wait until you learn all your skills.");
+                        	return;
+                        }
+
                    boolean allowAddition = true;
                    /*
                     * If the character is less than level 75 on any of their previously chosen

 

@ instance/L2PcInstance.java

	for (int i = 0; i < COMMON_CRAFT_LEVELS.length; i++)
	{
		if ((lvl >= COMMON_CRAFT_LEVELS[i]) && (getSkillLevel(1320) < (i + 1)))
		{
			L2Skill skill = SkillTable.getInstance().getInfo(1320, (i + 1));
			addSkill(skill, true);
		}
	}

+		canLearnSkills(false);
	// Auto-Learn skills if activated
-    		if (Config.AUTO_LEARN_SKILLS)
+		if (Config.AUTO_LEARN_SKILLS && !canLearnSkills())
	{
		giveAvailableSkills();
	}
	sendSkillList();
+		canLearnSkills(true);
	// This function gets called on login, so not such a bad place to check weight
	refreshOverloaded(); // Update the overloaded status of the L2PcInstance
	refreshExpertisePenalty(); // Update the expertise status of the L2PcInstance
}

/**
---------------------------------------------------------

+   private boolean _canLearnSkills =true;
+
+   public void canLearnSkills(boolean b)
+   {
+	   _canLearnSkills = b;
+   }
+   
+   public boolean canLearnSkills()
+   {
+      return _canLearnSkills;
+   }
/**
 * Gets the cubics.
 * @return the cubics
 */
public Map<Integer, L2CubicInstance> getCubics()
{
	return _cubics;
}

 

@ instance/L2ClassMasterInstance.java

            sb.append("You have now become a <font color=\"LEVEL\">" + CharTemplateTable.getClassNameById(player.getClassId().getId()) + "</font>.");
            sb.append("</body></html>");
            html.setHtml(sb.toString());
            player.sendPacket(html);
+            player.canLearnSkills(false);
            
-    		if (Config.AUTO_LEARN_SKILLS)
+    		if (Config.AUTO_LEARN_SKILLS && !player.canLearnSkills())
    		{
    			player.giveAvailableSkills();
    		}
    		player.sendSkillList();
+    		player.canLearnSkills(true);
       }
       else
       {
           super.onBypassFeedback(player, command);

Posted

Well skills stuck when you chance class and still learning skills (by leveling up or changing subclass).

With this code if you are still learning skills (still in the learning proccess) you can not chance subclass

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
×
×
  • 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..

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