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

    • rename the l2.bin into l2.exe
    • L2LIVE.PRO- Dynamic Mid-rates Essence Seven Signs GRAND OPENING - July 5, 20:00 GMT+3 (EEST) TEST SERVER IS OPEN - COME AND CHECK IT OUT TODAY! Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu   Server description * EXP/SP: Dynamic (x1- x100 based on your level, *before* Sayha and EXP buffs * Adena: x50 / Item Drop: x10 / Fishing EXP increased / Attribute EXP increased * Simplified gameplay to stay in the loop while not spending hours and hours farming * Starter Pack containing very useful items for beginners * MP replenishing potions with auto-consumption * No overpowered donations L2LIVE shop * All spellbook coupons, pet spellbook coupons and master books are sold via Game Assistant * Additionally you can buy SP pouches, enchanted talismans, pet training guides and various other consumables for Adena and L-Coin * More items such as cloaks, more talismans, agathions, belts, pendants, enchantment scrolls of various grades, evolution stones, etc will be added! Shop server as a shortcut, and all retail-like ways of earning items are still here! L-Coins * Drops with small change and in random amounts from Lv60+ monsters  * All raidbosses drop random amount of L-Coin Pouches generating up to 420 Lcoin per unit. **Grand Olympiad and Events** * Grand Olympiad is held week day * Format is 1v1, unlimited weekly fights  * Heroes are declared weekly at Sunday * There are three automated events - TvT, CTF and Deathmatch, running at evenings * Orc Fortress, Battle with Balok, Keber Hunter, Archievements Box, Daily Gift Calendar provisional events are active too Custom user commands * .offlineplay command, your character will keep playing till death or server restart * .offlineshop command, keeps your shop sitting until all items are purchased * .apon / .apoff - enable/disable HP/MP autoconsume And lots of other small improvements are waiting for you!   Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu
    • I can use this folder system for High Five offline server?   The folder does not have a l2.exe file.   Thank you very much if anyone can help me.   https://drive.google.com/file/d/13kU-g_4JJ-sP-kg2F7pqkUOVKmQdubFm/view
  • Topics

×
×
  • Create New...