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.


×
×
  • Create New...