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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...