Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2jNetwork_gameserver
- Index: config/server.properties
- ===================================================================
- --- config/server.properties (revision 5)
- +++ config/server.properties (working copy)
- @@ -302,4 +302,7 @@
- ShowServerNews = False
- # Disable tutorial on new player game entrance. Default: False.
- -DisableTutorial = False
- \ No newline at end of file
- +DisableTutorial = False
- +
- +# If true, players will keep all subclass skills.
- +StuckSubs = True
- \ No newline at end of file
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 5)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -641,6 +641,7 @@
- public static boolean SERVER_NEWS;
- public static int ZONE_TOWN;
- public static boolean DISABLE_TUTORIAL;
- + public static boolean STUCK_SUBS;
- // --------------------------------------------------
- // Those "hidden" settings haven't configs to avoid admins to fuck their server
- @@ -1224,6 +1225,7 @@
- ZONE_TOWN = server.getProperty("ZoneTown", 0);
- SERVER_NEWS = server.getProperty("ShowServerNews", false);
- DISABLE_TUTORIAL = server.getProperty("DisableTutorial", false);
- + STUCK_SUBS = server.getProperty("StuckSubs", true);
- }
- else if (Server.serverMode == Server.MODE_LOGINSERVER)
- {
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 5)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -303,6 +303,7 @@
- }
- 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 STUCK_SUBS = "SELECT skill_id,skill_level FROM character_skills WHERE char_obj_id=? ORDER BY (skill_level+0)";
- private static final String ADD_NEW_SKILL = "INSERT INTO character_skills (char_obj_id,skill_id,skill_level,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=?";
- @@ -4084,7 +4085,7 @@
- for (L2Character character : getKnownList().getKnownType(L2Character.class))
- if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
- character.abortCast();
- -
- +
- if (isInParty() && getParty().isInDimensionalRift())
- getParty().getDimensionalRift().getDeadMemberList().add(this);
- @@ -5740,6 +5741,10 @@
- // Retrieve from the database all skills of this L2PcInstance and add them to _skills.
- restoreSkills();
- + // If config true, character can keep all sub skills.
- + if (Config.STUCK_SUBS)
- + restoreSubSkills();
- +
- // Retrieve from the database all macroses of this L2PcInstance and add them to _macroses.
- _macroses.restore();
- @@ -6222,6 +6227,40 @@
- }
- }
- + private void restoreSubSkills()
- + {
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement(STUCK_SUBS);
- + statement.setInt(1, getObjectId());
- + 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");
- +
- + if (id > 9000)
- + 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);
- + }
- +
- + rset.close();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warning("Could not restore character skills: " + e);
- + }
- +
- + }
- +
- /**
- * Retrieve from the database all skills of this L2PcInstance and add them to _skills.
- */
- @@ -6229,6 +6268,9 @@
- {
- try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- {
- + if (Config.STUCK_SUBS)
- + return;
- +
- PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR);
- statement.setInt(1, getObjectId());
- statement.setInt(2, getClassIndex());
- @@ -6890,7 +6932,7 @@
- switch (sklTargetType)
- {
- - // Target the player if skill type is AURA, PARTY, CLAN or SELF
- + // Target the player if skill type is AURA, PARTY, CLAN or SELF
- case TARGET_AURA:
- case TARGET_FRONT_AURA:
- case TARGET_BEHIND_AURA:
- @@ -8150,7 +8192,7 @@
- else
- for (L2Skill s : SkillTable.getNobleSkills())
- super.removeSkill(s); // Just Remove skills without deleting from Sql
- -
- +
- _noble = val;
- sendSkillList();
- @@ -8496,7 +8538,7 @@
- for (L2Character character : getKnownList().getKnownType(L2Character.class))
- if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
- character.abortCast();
- -
- +
- store();
- _reuseTimeStamps.clear();
- @@ -8541,6 +8583,9 @@
- restoreRecipeBook();
- restoreSkills();
- + // If config true, character can keep all sub skills.
- + if (Config.STUCK_SUBS)
- + restoreSubSkills();
- rewardSkills();
- regiveTemporarySkills();
- @@ -9113,7 +9158,7 @@
- for (L2Character character : getKnownList().getKnownType(L2Character.class))
- if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
- character.abortCast();
- -
- +
- // Stop signets & toggles effects.
- for (L2Effect effect : getAllEffects())
- {
- @@ -9170,7 +9215,7 @@
- // If the L2PcInstance is a GM, remove it from the GM List
- if (isGM())
- GmListTable.getInstance().deleteGm(this);
- -
- +
- // Check if the L2PcInstance is in observer mode to set its position to its position
- // before entering in observer mode
- if (inObserverMode())
- @@ -9285,13 +9330,13 @@
- case 7809: // yellow for beginners
- case 8486: // prize-winning for beginners
- return 0;
- -
- +
- case 8485: // prize-winning luminous
- case 8506: // green luminous
- case 8509: // purple luminous
- case 8512: // yellow luminous
- return 2;
- -
- +
- default:
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement