Skip to content

The new subclass stuck skills protection

Featured Replies

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);

What protection provided by this code? read all the character skills?

  • Author

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.