diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Duel.java index 0833c1715a..09536b2aef 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Duel.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/entity/Duel.java @@ -91,8 +91,6 @@ public class Duel if (_partyDuel) { - // increase countdown so that start task can teleport players - _countdown++; // inform players that they will be ported shortly final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE); broadcastToTeam1(sm); @@ -588,7 +586,7 @@ public class Duel } /** - * teleport all players + * Teleports all players to a free arena. */ public void teleportPlayers() { @@ -813,6 +811,8 @@ public class Duel stopFighting(); // Don't restore hp, mp, cp restorePlayerConditions(true); + // TODO: is there no other message for a canceled duel? + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm); @@ -822,7 +822,9 @@ public class Duel case TIMEOUT: { stopFighting(); + // hp,mp,cp seem to be restored in a timeout too... restorePlayerConditions(false); + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java index 0833c1715a..09536b2aef 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/entity/Duel.java @@ -91,8 +91,6 @@ public class Duel if (_partyDuel) { - // increase countdown so that start task can teleport players - _countdown++; // inform players that they will be ported shortly final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE); broadcastToTeam1(sm); @@ -588,7 +586,7 @@ public class Duel } /** - * teleport all players + * Teleports all players to a free arena. */ public void teleportPlayers() { @@ -813,6 +811,8 @@ public class Duel stopFighting(); // Don't restore hp, mp, cp restorePlayerConditions(true); + // TODO: is there no other message for a canceled duel? + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm); @@ -822,7 +822,9 @@ public class Duel case TIMEOUT: { stopFighting(); + // hp,mp,cp seem to be restored in a timeout too... restorePlayerConditions(false); + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Duel.java index 0833c1715a..09536b2aef 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Duel.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/entity/Duel.java @@ -91,8 +91,6 @@ public class Duel if (_partyDuel) { - // increase countdown so that start task can teleport players - _countdown++; // inform players that they will be ported shortly final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE); broadcastToTeam1(sm); @@ -588,7 +586,7 @@ public class Duel } /** - * teleport all players + * Teleports all players to a free arena. */ public void teleportPlayers() { @@ -813,6 +811,8 @@ public class Duel stopFighting(); // Don't restore hp, mp, cp restorePlayerConditions(true); + // TODO: is there no other message for a canceled duel? + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm); @@ -822,7 +822,9 @@ public class Duel case TIMEOUT: { stopFighting(); + // hp,mp,cp seem to be restored in a timeout too... restorePlayerConditions(false); + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Duel.java index 0833c1715a..09536b2aef 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Duel.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/entity/Duel.java @@ -91,8 +91,6 @@ public class Duel if (_partyDuel) { - // increase countdown so that start task can teleport players - _countdown++; // inform players that they will be ported shortly final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE); broadcastToTeam1(sm); @@ -588,7 +586,7 @@ public class Duel } /** - * teleport all players + * Teleports all players to a free arena. */ public void teleportPlayers() { @@ -813,6 +811,8 @@ public class Duel stopFighting(); // Don't restore hp, mp, cp restorePlayerConditions(true); + // TODO: is there no other message for a canceled duel? + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm); @@ -822,7 +822,9 @@ public class Duel case TIMEOUT: { stopFighting(); + // hp,mp,cp seem to be restored in a timeout too... restorePlayerConditions(false); + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Duel.java index 21c132b362..fb73121d69 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Duel.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/Duel.java @@ -289,7 +289,7 @@ public class Duel } catch (Exception e) { - _log.log(Level.SEVERE, "", e); + _log.log(Level.SEVERE, "There has been a problem while runing a duel end task!", e); } } } @@ -437,13 +437,12 @@ public class Duel } else { - // Set duel state and team + // set isInDuel() state _playerA.setIsInDuel(_duelId); _playerA.setTeam(Team.BLUE); _playerB.setIsInDuel(_duelId); _playerB.setTeam(Team.RED); - // Send duel Start packets // Send duel packets broadcastToTeam1(ExDuelReady.PLAYER_DUEL); broadcastToTeam2(ExDuelReady.PLAYER_DUEL); @@ -461,7 +460,7 @@ public class Duel broadcastToTeam1(B04_S01); broadcastToTeam2(B04_S01); - // start dueling task + // start duelling task ThreadPoolManager.schedule(new ScheduleDuelTask(this), 1000); } @@ -720,7 +719,7 @@ public class Duel } /** - * Playback the bow animation for all looser + * Playback the bow animation for all loosers */ public void playKneelAnimation() { @@ -1053,11 +1052,10 @@ public class Duel else // teleport the player back & delete his PlayerCondition record { - final PlayerCondition cond = _playerConditions.get(player.getObjectId()); + final PlayerCondition cond = _playerConditions.remove(player.getObjectId()); if (cond != null) { cond.teleportBack(); - _playerConditions.remove(player.getObjectId()); } player.setIsInDuel(0); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Duel.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Duel.java index 0833c1715a..09536b2aef 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Duel.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/entity/Duel.java @@ -91,8 +91,6 @@ public class Duel if (_partyDuel) { - // increase countdown so that start task can teleport players - _countdown++; // inform players that they will be ported shortly final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE); broadcastToTeam1(sm); @@ -588,7 +586,7 @@ public class Duel } /** - * teleport all players + * Teleports all players to a free arena. */ public void teleportPlayers() { @@ -813,6 +811,8 @@ public class Duel stopFighting(); // Don't restore hp, mp, cp restorePlayerConditions(true); + // TODO: is there no other message for a canceled duel? + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm); @@ -822,7 +822,9 @@ public class Duel case TIMEOUT: { stopFighting(); + // hp,mp,cp seem to be restored in a timeout too... restorePlayerConditions(false); + // send SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE); broadcastToTeam1(sm);