Jump to content

[Share] java code stuck Skill in sub


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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

 

Link to comment
Share on other sites

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.



  • Posts

    • thats 26_21... i have it and 26_19... only 26_20 missing is the town arcan part
    • his link still working here , or are they different ?
    • Hello everyone,   We're shifting our focus away from implementing as much as possible from the Essence gameplay. Instead, the server will now be Interlude, but using the Essence client.   This should be good news for everyone.   The Beta phase will most likely take place in November, with the grand opening to follow shortly after.   Cheers!
    • We remind you that the opening will take place today, on September 28 at: 19:00 (UTC+3) - server time Check current server time(UTC +3) On 17:00 (UTC +3) We allow you login to create character! Dear friends, this topic important! So please take time to read it. First we want to thank all players who took part in the Open Beta testing, was good activity and nice Olympiad Event yesterday, we all get a lot of fun  Thanks to all who conducted tests with us and prepared this game world! You are amazing!  On 17:00 (UTC +3) We allow you to login for create character! To restrict your name and transfer ToDs/Season Pack to your character. Make it before start! On start, we can have problems with WEB! Everything you need to start on the server: It is IMPORTANT to prepare everything for starting the game RIGHT NOW, do not postpone for later, during the opening there may be problems with the web part of the project, and you simply can not register. - Registration and files Download archive unzip it, run launcher, choose SEASON x25 server and press FULL CHECK What you need to know at the start: Registration for 7 seals from Monday, September 30, full cycle 1 week. First Mammons on Friday October 4 All Epic Raid Bosses dead on start. First epic QA will appear on Monday, next day Core + Zaken + QA and so on by schedule All other RBs alive on server start (including Sub and Nobl RB) - Full RoadMap   About possible attacks on server start. We have prepared as good as we can. We will control the start of the server together with you. Want to ask you, in the case of a problem, don't panic, panic is the worst possible thing that could be, even worse than any attack. We have enough specialists to solve any problems, all that will need from you is patience and trust. Wish you all a smooth start and months of enjoyable play in new Season Interlude x25! Have a fun!
  • Topics

×
×
  • Create New...