From f42ef7a77fc1cc484e0f698133b8a96ce1810721 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 6 May 2018 22:37:47 +0000 Subject: [PATCH] Remove revelation skills before subclass removal. --- .../gameserver/model/actor/instance/L2PcInstance.java | 5 ++++- .../gameserver/model/actor/instance/L2PcInstance.java | 5 ++++- .../gameserver/model/actor/instance/L2PcInstance.java | 5 ++++- .../gameserver/model/actor/instance/L2PcInstance.java | 5 ++++- .../gameserver/model/actor/instance/L2PcInstance.java | 5 ++++- .../gameserver/model/actor/instance/L2PcInstance.java | 5 ++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 4a45342017..e173b6255a 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9633,7 +9633,7 @@ public final class L2PcInstance extends L2Playable EventDispatcher.getInstance().notifyEventAsync(new OnPlayerProfessionCancel(this, classId), this); } - final SubClass subClass = getSubClasses().remove(classIndex); + final SubClass subClass = getSubClasses().get(classIndex); if (subClass == null) { return false; @@ -9655,6 +9655,9 @@ public final class L2PcInstance extends L2Playable } } + // Remove after stats are recalculated. + getSubClasses().remove(classIndex); + try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement deleteHennas = con.prepareStatement(DELETE_CHAR_HENNAS); PreparedStatement deleteShortcuts = con.prepareStatement(DELETE_CHAR_SHORTCUTS); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 812a01c61e..396d399daa 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9640,7 +9640,7 @@ public final class L2PcInstance extends L2Playable EventDispatcher.getInstance().notifyEventAsync(new OnPlayerProfessionCancel(this, classId), this); } - final SubClass subClass = getSubClasses().remove(classIndex); + final SubClass subClass = getSubClasses().get(classIndex); if (subClass == null) { return false; @@ -9662,6 +9662,9 @@ public final class L2PcInstance extends L2Playable } } + // Remove after stats are recalculated. + getSubClasses().remove(classIndex); + try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement deleteHennas = con.prepareStatement(DELETE_CHAR_HENNAS); PreparedStatement deleteShortcuts = con.prepareStatement(DELETE_CHAR_SHORTCUTS); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 6ca0bb8abf..22241985b4 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9650,7 +9650,7 @@ public final class L2PcInstance extends L2Playable EventDispatcher.getInstance().notifyEventAsync(new OnPlayerProfessionCancel(this, classId), this); } - final SubClass subClass = getSubClasses().remove(classIndex); + final SubClass subClass = getSubClasses().get(classIndex); if (subClass == null) { return false; @@ -9672,6 +9672,9 @@ public final class L2PcInstance extends L2Playable } } + // Remove after stats are recalculated. + getSubClasses().remove(classIndex); + try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement deleteHennas = con.prepareStatement(DELETE_CHAR_HENNAS); PreparedStatement deleteShortcuts = con.prepareStatement(DELETE_CHAR_SHORTCUTS); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 56ab6e755d..7dbb262b44 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9643,7 +9643,7 @@ public final class L2PcInstance extends L2Playable EventDispatcher.getInstance().notifyEventAsync(new OnPlayerProfessionCancel(this, classId), this); } - final SubClass subClass = getSubClasses().remove(classIndex); + final SubClass subClass = getSubClasses().get(classIndex); if (subClass == null) { return false; @@ -9665,6 +9665,9 @@ public final class L2PcInstance extends L2Playable } } + // Remove after stats are recalculated. + getSubClasses().remove(classIndex); + try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement deleteHennas = con.prepareStatement(DELETE_CHAR_HENNAS); PreparedStatement deleteShortcuts = con.prepareStatement(DELETE_CHAR_SHORTCUTS); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index f4821c3751..ce0b6805a1 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9574,7 +9574,7 @@ public final class L2PcInstance extends L2Playable EventDispatcher.getInstance().notifyEventAsync(new OnPlayerProfessionCancel(this, classId), this); } - final SubClass subClass = getSubClasses().remove(classIndex); + final SubClass subClass = getSubClasses().get(classIndex); if (subClass == null) { return false; @@ -9596,6 +9596,9 @@ public final class L2PcInstance extends L2Playable } } + // Remove after stats are recalculated. + getSubClasses().remove(classIndex); + try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement deleteHennas = con.prepareStatement(DELETE_CHAR_HENNAS); PreparedStatement deleteShortcuts = con.prepareStatement(DELETE_CHAR_SHORTCUTS); diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 3348201ec9..b80a6567c4 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9574,7 +9574,7 @@ public final class L2PcInstance extends L2Playable EventDispatcher.getInstance().notifyEventAsync(new OnPlayerProfessionCancel(this, classId), this); } - final SubClass subClass = getSubClasses().remove(classIndex); + final SubClass subClass = getSubClasses().get(classIndex); if (subClass == null) { return false; @@ -9596,6 +9596,9 @@ public final class L2PcInstance extends L2Playable } } + // Remove after stats are recalculated. + getSubClasses().remove(classIndex); + try (Connection con = DatabaseFactory.getInstance().getConnection(); PreparedStatement deleteHennas = con.prepareStatement(DELETE_CHAR_HENNAS); PreparedStatement deleteShortcuts = con.prepareStatement(DELETE_CHAR_SHORTCUTS);