Jump to content

Recommended Posts

Posted

autos o code einai gia otan kanoune subs na kratane ola ta skills apo ta class

pame ston config.java kai bazoume to exis..

 

Index: Config.java
===================================================================
--- Config.java	(revision 836)
+++ Config.java	(working copy)
@@ -242,6 +242,9 @@
     /** Alternative gaming - allow free teleporting around the world. */
     public static boolean ALT_GAME_FREE_TELEPORT;
     
+    /**Alternative gaming - allow to keep skils after sub-class**/
+    public static boolean ALT_SUBCLASS_SKILLS;
+    
     /** Alternative gaming - allow sub-class addition without quest completion. */
     public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
     
@@ -1763,6 +1766,7 @@
                 ALT_PLAYER_PROTECTION_LEVEL                         = Integer.parseInt(altSettings.getProperty("AltPlayerProtectionLevel","0"));
                 ALT_GAME_FREE_TELEPORT                              = Boolean.parseBoolean(altSettings.getProperty("AltFreeTeleporting", "False"));
                 ALT_GAME_SUBCLASS_WITHOUT_QUESTS                    = Boolean.parseBoolean(altSettings.getProperty("AltSubClassWithoutQuests", "False"));
+                ALT_SUBCLASS_SKILLS									= Boolean.parseBoolean(altSettings.getProperty("AltSubClassSkills", "False"));
                 ALT_GAME_VIEWNPC                    				= Boolean.parseBoolean(altSettings.getProperty("AltGameViewNpc", "False"));
                 ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE                  = Boolean.parseBoolean(altSettings.getProperty("AltNewCharAlwaysIsNewbie", "False"));
                 ALT_MAX_NUM_OF_CLANS_IN_ALLY                        = Integer.parseInt(altSettings.getProperty("AltMaxNumOfClansInAlly", "3"));
@@ -2304,6 +2308,7 @@
         else if (pName.equalsIgnoreCase("AltRequireCastleForDawn")) ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.valueOf(pValue);
         else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.valueOf(pValue);
         else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.valueOf(pValue);
+        else if (pName.equalsIgnoreCase("AltSubClassSkills")) ALT_SUBCLASS_SKILLS = Boolean.valueOf(pValue);
         else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.valueOf(pValue);
         else if (pName.equalsIgnoreCase("AltNewCharAlwaysIsNewbie")) ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.valueOf(pValue);
         else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);

 

 

meta pame sto L2PcInstance.java kai bazoume to exis..

Index: L2PcInstance.java
===================================================================
--- L2PcInstance.java	(revision 836)
+++ L2PcInstance.java	(working copy)
@@ -203,6 +203,7 @@
     private final static Log _log = LogFactory.getLog(L2PcInstance.class.getName());
     
     private static final String RESTORE_SKILLS_FOR_CHAR = "SELECT skill_id,skill_level FROM character_skills WHERE char_obj_id=? AND class_index=?";
+    private static final String RESTORE_SKILLS_FOR_CHAR_ALT_SUBCLASS = "SELECT skill_id,skill_level FROM character_skills WHERE char_obj_id=?";
     private static final String ADD_NEW_SKILL = "INSERT INTO character_skills (char_obj_id,skill_id,skill_level,skill_name,class_index) VALUES (?,?,?,?,?)";
     private static final String UPDATE_CHARACTER_SKILL_LEVEL = "UPDATE character_skills SET skill_level=? WHERE skill_id=? AND char_obj_id=? AND class_index=?";
     private static final String DELETE_SKILL_FROM_CHAR = "DELETE FROM character_skills WHERE skill_id=? AND char_obj_id=? AND class_index=?";
@@ -6092,29 +6093,34 @@

         try
         {
-            // Retrieve all skills of this L2PcInstance from the database
-            con = L2DatabaseFactory.getInstance().getConnection();
-            PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR);
-            statement.setInt(1, getObjectId());
-            statement.setInt(2, getClassIndex());
-            ResultSet rset = statement.executeQuery();
+    		// Retrieve all skills of this L2PcInstance from the database
+    		con = L2DatabaseFactory.getInstance().getConnection();
+    		PreparedStatement statement = con.prepareStatement(
+    				Config.ALT_SUBCLASS_SKILLS ? RESTORE_SKILLS_FOR_CHAR_ALT_SUBCLASS : RESTORE_SKILLS_FOR_CHAR);
+    		
+    		statement.setInt(1, getObjectId());
+    		
+    		if(!Config.ALT_SUBCLASS_SKILLS)
+    			statement.setInt(2, getClassIndex());
+    		
+    		ResultSet rset = statement.executeQuery();

-            // Go though the recordset of this SQL query
-            while (rset.next())
-            {
-                int id = rset.getInt("skill_id");
-                int level = rset.getInt("skill_level");
+    		// Go though the recordset of this SQL query
+    		while (rset.next())
+    		{
+    			int id = rset.getInt("skill_id");
+    			int level = rset.getInt("skill_level");

-                if (id > 9000) continue; // fake skills for base stats
+    			if (id > 9000) continue; // fake skills for base stats

-                // Create a L2Skill object for each record
-                L2Skill skill = SkillTable.getInstance().getInfo(id, level);
+    			// 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);
-            }
+    			// Add the L2Skill object to the L2Character _skills and its Func objects to the calculator set of the L2Character
+    			super.addSkill(skill);
+    		}

-            rset.close();
+        	rset.close();
             statement.close();
            
             //restore clan skills

 

 

stin sinexia pame sta alsettings.properties sta config ta txt dld tou server kai bazoume

AltSubClassSkills=true 

 

 

*Gredits phusho

*Real Post http://www.l2jfree.com/index.php?topic=156.0

Posted

Very Nice poli kali douleia kai poli xrisimo gia multiserver :)

 

Edit: Kai einai gg doulebei mia xara :)

Posted

Me auto to patch/modify diladi mporei kapoios na kanei enan character Hierophant/Sagitarius/Phoenix Knight kai na exei kai apo tis 3 classes (me tin proipothesi oti sto altsettings.properties to MaxSubclass = 3)ola ta passive kai active skills stackables?An katalaba lathos diorthoste me.

Posted

nai me auto to code krataei ta skill p.x ama balis na kanei prapano subs apo 3 perni kai alla skills kai pasive ama to kaneis omws false stin ka8e class perni ta kanonika skill tis class diladi ginontai delete ta alla den menoune..

  • 4 weeks later...
  • 2 years later...
Posted

kalimera paidia exw ena megalo provlima me ton server pou prospa8w na aniksw i char dn mporoun na energopioisoun pano apo 2 augmend skill ean mporei kapoios na me help pite m pws to kanw sas parakalw polu fenete pws 3erete apo eclipse polu kala ean exete tin euxaristisi na me voi8isete euxaristo!!!

 

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