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

    • Thank you for your reply. I have removed it from the L2Server.exe file, but the L2Server still crashes. It doesn't crash if I don't start l2npc, otherwise it will crash within a few days at the latest.
    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore1 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11
    • L2 ArenaWar: Low Rate PvP Server with Free Buffs & Autofarm [PVP]⚔️ [Free]🆓 Classic Interlude with  3x XP rates! Free starter pack(no grade) to kickstart your adventure! Autofarm for convenient grinding! Free buffs to keep you fighting fit! (2 job buffs) No experience loss on death! (Except with Karma) Clear Karma system to keep things fair! ⚖️ Active community of 800-1k players! Join our Discord to learn more! >> Discord <<     Server website: https://l2arenawar.com/en/    
    • This is dedication! 2 years working on a problem. Congratulations!
    • You indeed have to save player position over Enterworld to properly clean it up later (if you don't, even trying to delete packet content would eventually keep it up), that's what we do with debug packet (which is a reusable Map of ExServerPrimitive packets) on aCis.   It doesn't solve the FPS stuttering - more you draw/delete lines, more your client becomes laggy. It's like if client wasn't deleting drawn points/lines properly, but instead simply hide them and redrawn content above.   If you got a solution, I would happy to integrate it.   You should check aCis#Player _debug packet integration, it allows very big amount of lines/points to be drawn, it is also reusable.   https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java?ref_type=heads https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java?ref_type=heads  
  • Topics

×
×
  • Create New...