Jump to content
  • 0

[HELP] Subclass stack


Question

Posted

hi there guys I manage to add this to my server but want to change the subclass... When you do subclass it will only stack the active skill not the passive skill.... I know you'll edit somewhere in the code.. Please help..

 

=========================================

 

try

      {

        boolean isAcumulative = Config.ACUMULATIVE_SUBCLASS_SKILLS;

 

        // Retrieve all skills of this L2PcInstance from the database

        con = L2DatabaseFactory.getInstance().getConnection();

        PreparedStatement statement = con.prepareStatement(isAcumulative ? ACUMULATE_SKILLS_FOR_CHAR_SUB : RESTORE_SKILLS_FOR_CHAR);

       

        statement.setInt(1, getObjectId());

        if (!isAcumulative)

            statement.setInt(2, getClassIndex());

        ResultSet rset = statement.executeQuery();

 

============================================================

 

 

maybe you have some idea where to edit to make the stack subclass work only for active skill not the passive skill... THANKS GUYS

8 answers to this question

Recommended Posts

  • 0
Posted

change

+ private static final String ACUMULATE_SKILLS_FOR_CHAR_SUB = "SELECT skill_id,skill_level FROM character_skills WHERE charId=? ORDER BY skill_id , skill_level ASC";

to

+ private static final String ACUMULATE_SKILLS_FOR_CHAR_SUB = "SELECT skill_id,skill_level,class_index FROM character_skills WHERE charId=? ORDER BY class_index ,skill_id , skill_level ASC";

and

		while (rset.next())
		{
			int id = rset.getInt("skill_id");
			int level = rset.getInt("skill_level");

			if (id > 9000 && id < 9007)
				continue; // fake skills for base stats

			// Create a L2Skill object for each record
			L2Skill skill = SkillTable.getInstance().getInfo(id, level);

			// Add the L2Skill object to the L2Character _skills and its Func objects to the calculator set of the L2Character
			super.addSkill(skill);
		}

to

		while (rset.next())
		{
			int id = rset.getInt("skill_id");
			int level = rset.getInt("skill_level");
                                int classindex = rset.getInt("class_index");

			if (id > 9000 && id < 9007)
				continue; // fake skills for base stats

			// Create a L2Skill object for each record
			L2Skill skill = SkillTable.getInstance().getInfo(id, level);

                                //check if it is passive and now of our class
                                if (skill.isPassive() && classindex != getClassIndex() )
                                          continue;

			// Add the L2Skill object to the L2Character _skills and its Func objects to the calculator set of the L2Character
			super.addSkill(skill);
		}

 

im not completely sure of this (ACUMULATE_SKILLS_FOR_CHAR_SUB most of all) but maybe it will work :)

  • 0
Posted

take this it works

 

Index: /Server/SkyLanceR's_IL_GS/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- /Server/SkyLanceR's_IL_GS/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 345)
+++ /Server/SkyLanceR's_IL_GS/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 346)
@@ -8425,4 +8425,6 @@
     public boolean addSubClass(int classId, int classIndex)
     {
     	if (getTotalSubClasses() == 3 || classIndex == 0)
     		return false;
@@ -8430,4 +8432,8 @@
     	if (getSubClasses().containsKey(classIndex))
     		return false;
+    	
+    	startAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_1);
+    	setIsParalyzed(true);
+    	sendMessage("You are paralized untill your subclass load.");

     	// Note: Never change _classIndex in any method other than setActiveClass().
@@ -8492,4 +8498,8 @@
         if (Config.DEBUG)
             _log.info(getName() + " was given " + getAllSkills().length + " skills for their new sub class.");
+        
+        setIsParalyzed(false);
+        stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_1);
+        sendMessage("You are unparalized.");

         return true;

 

freezes players when changing sub in order to prevent stuck

  • 0
Posted

maybe you have some idea where to edit to make the stack subclass work only for active skill not the passive skill

 

freezes players when changing sub in order to prevent stuck

 

Guest
This topic is now closed to further replies.


  • Posts

    • Hi players ! Meet our project Lineage 2 Hiro Classic ! A low rate classic pvp oriented with many features. No pay to win, RB/AoE, group clan pvp castle etc ...  Dynamic rates, RB Xp 4x and soon massive update with auto farm ! Join now !  https://www.lineage2hiro.com/ Can't wait to see you online !
    • To all first time buyers we give a bonus + 10% of the order. 
    • 🔥 Looking for a powerful, clean, and player-friendly Auction House system for your Lineage 2 server? This fully-featured module is ready to plug into your project and provide your players with a modern, centralized marketplace!   💼 What is it? A complete Auction House system designed for fixed-price item sales between players. Forget about private stores and spammed zones—this system offers a smooth, secure, and offline-friendly way to buy and sell items across your server.   Photo Library: https://imgur.com/a/zLlUQbW   ✅ Main Features: 🔹 Fixed-Price Listings Only: Players list items at a set price. No bidding, no delays—just fast, clean trades. 🔹 Multi-Currency Support: Works with Adena, event coins, custom currencies—fully configurable. 🔹 Dynamic Interface: Players can filter items by name, type, and price. Easy-to-use HTML layout with smooth pagination. 🔹 Sell While Offline: Post items and receive payments even if you're not online—true passive trading. 🔹 Safety First: Full validation: no equipped/augmented/restricted items unless allowed. Prevents scams, mispricing, and listing errors. 🔹 Expiration Timer (Optional): Set listing time limits. Expired items go to warehouse/mail automatically. 🔹 Spam & Duplication Protection: Prevents multiple listings of identical items and unnecessary database load. 🔹 Performance Optimized: Clean, indexed SQL structure. No lag or bloating even with thousands of listings.   ⚙️ Plug & Play Clean Java code (compatible with aCis & derivatives). Easy setup with full instructions and sample configurations. Includes SQL, HTML files, and all Java classes – fully working out of the box.   💰 Pricing & Contact 📦 50 euro - One-time purchase with full support for setup & basic customization. 💬 Contact me here via PM or on Discord: @Luminous 🔐 Serious buyers only – source is clean, secure, and tested on live servers.     Give your server the next-level economy it deserves. No more chaotic trade zones. No more confusion. Just clean, efficient, server-wide trading.
    • We are certainly not an ambulance, but we will definitely cure you of blacklists and empty pockets. Live freely with SX! Each of you will receive a trial version of SX to familiarize yourself with the product, all you have to do is post in this thread
  • Topics

×
×
  • Create New...