More minor duel related changes.
This commit is contained in:
@@ -91,8 +91,6 @@ public class Duel
|
|||||||
|
|
||||||
if (_partyDuel)
|
if (_partyDuel)
|
||||||
{
|
{
|
||||||
// increase countdown so that start task can teleport players
|
|
||||||
_countdown++;
|
|
||||||
// inform players that they will be ported shortly
|
// 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);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -588,7 +586,7 @@ public class Duel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* teleport all players
|
* Teleports all players to a free arena.
|
||||||
*/
|
*/
|
||||||
public void teleportPlayers()
|
public void teleportPlayers()
|
||||||
{
|
{
|
||||||
@@ -813,6 +811,8 @@ public class Duel
|
|||||||
stopFighting();
|
stopFighting();
|
||||||
// Don't restore hp, mp, cp
|
// Don't restore hp, mp, cp
|
||||||
restorePlayerConditions(true);
|
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);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -822,7 +822,9 @@ public class Duel
|
|||||||
case TIMEOUT:
|
case TIMEOUT:
|
||||||
{
|
{
|
||||||
stopFighting();
|
stopFighting();
|
||||||
|
// hp,mp,cp seem to be restored in a timeout too...
|
||||||
restorePlayerConditions(false);
|
restorePlayerConditions(false);
|
||||||
|
// send SystemMessage
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
|
@@ -91,8 +91,6 @@ public class Duel
|
|||||||
|
|
||||||
if (_partyDuel)
|
if (_partyDuel)
|
||||||
{
|
{
|
||||||
// increase countdown so that start task can teleport players
|
|
||||||
_countdown++;
|
|
||||||
// inform players that they will be ported shortly
|
// 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);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -588,7 +586,7 @@ public class Duel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* teleport all players
|
* Teleports all players to a free arena.
|
||||||
*/
|
*/
|
||||||
public void teleportPlayers()
|
public void teleportPlayers()
|
||||||
{
|
{
|
||||||
@@ -813,6 +811,8 @@ public class Duel
|
|||||||
stopFighting();
|
stopFighting();
|
||||||
// Don't restore hp, mp, cp
|
// Don't restore hp, mp, cp
|
||||||
restorePlayerConditions(true);
|
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);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -822,7 +822,9 @@ public class Duel
|
|||||||
case TIMEOUT:
|
case TIMEOUT:
|
||||||
{
|
{
|
||||||
stopFighting();
|
stopFighting();
|
||||||
|
// hp,mp,cp seem to be restored in a timeout too...
|
||||||
restorePlayerConditions(false);
|
restorePlayerConditions(false);
|
||||||
|
// send SystemMessage
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
|
@@ -91,8 +91,6 @@ public class Duel
|
|||||||
|
|
||||||
if (_partyDuel)
|
if (_partyDuel)
|
||||||
{
|
{
|
||||||
// increase countdown so that start task can teleport players
|
|
||||||
_countdown++;
|
|
||||||
// inform players that they will be ported shortly
|
// 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);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -588,7 +586,7 @@ public class Duel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* teleport all players
|
* Teleports all players to a free arena.
|
||||||
*/
|
*/
|
||||||
public void teleportPlayers()
|
public void teleportPlayers()
|
||||||
{
|
{
|
||||||
@@ -813,6 +811,8 @@ public class Duel
|
|||||||
stopFighting();
|
stopFighting();
|
||||||
// Don't restore hp, mp, cp
|
// Don't restore hp, mp, cp
|
||||||
restorePlayerConditions(true);
|
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);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -822,7 +822,9 @@ public class Duel
|
|||||||
case TIMEOUT:
|
case TIMEOUT:
|
||||||
{
|
{
|
||||||
stopFighting();
|
stopFighting();
|
||||||
|
// hp,mp,cp seem to be restored in a timeout too...
|
||||||
restorePlayerConditions(false);
|
restorePlayerConditions(false);
|
||||||
|
// send SystemMessage
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
|
@@ -91,8 +91,6 @@ public class Duel
|
|||||||
|
|
||||||
if (_partyDuel)
|
if (_partyDuel)
|
||||||
{
|
{
|
||||||
// increase countdown so that start task can teleport players
|
|
||||||
_countdown++;
|
|
||||||
// inform players that they will be ported shortly
|
// 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);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -588,7 +586,7 @@ public class Duel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* teleport all players
|
* Teleports all players to a free arena.
|
||||||
*/
|
*/
|
||||||
public void teleportPlayers()
|
public void teleportPlayers()
|
||||||
{
|
{
|
||||||
@@ -813,6 +811,8 @@ public class Duel
|
|||||||
stopFighting();
|
stopFighting();
|
||||||
// Don't restore hp, mp, cp
|
// Don't restore hp, mp, cp
|
||||||
restorePlayerConditions(true);
|
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);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -822,7 +822,9 @@ public class Duel
|
|||||||
case TIMEOUT:
|
case TIMEOUT:
|
||||||
{
|
{
|
||||||
stopFighting();
|
stopFighting();
|
||||||
|
// hp,mp,cp seem to be restored in a timeout too...
|
||||||
restorePlayerConditions(false);
|
restorePlayerConditions(false);
|
||||||
|
// send SystemMessage
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
|
@@ -289,7 +289,7 @@ public class Duel
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
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
|
else
|
||||||
{
|
{
|
||||||
// Set duel state and team
|
// set isInDuel() state
|
||||||
_playerA.setIsInDuel(_duelId);
|
_playerA.setIsInDuel(_duelId);
|
||||||
_playerA.setTeam(Team.BLUE);
|
_playerA.setTeam(Team.BLUE);
|
||||||
_playerB.setIsInDuel(_duelId);
|
_playerB.setIsInDuel(_duelId);
|
||||||
_playerB.setTeam(Team.RED);
|
_playerB.setTeam(Team.RED);
|
||||||
|
|
||||||
// Send duel Start packets
|
|
||||||
// Send duel packets
|
// Send duel packets
|
||||||
broadcastToTeam1(ExDuelReady.PLAYER_DUEL);
|
broadcastToTeam1(ExDuelReady.PLAYER_DUEL);
|
||||||
broadcastToTeam2(ExDuelReady.PLAYER_DUEL);
|
broadcastToTeam2(ExDuelReady.PLAYER_DUEL);
|
||||||
@@ -461,7 +460,7 @@ public class Duel
|
|||||||
broadcastToTeam1(B04_S01);
|
broadcastToTeam1(B04_S01);
|
||||||
broadcastToTeam2(B04_S01);
|
broadcastToTeam2(B04_S01);
|
||||||
|
|
||||||
// start dueling task
|
// start duelling task
|
||||||
ThreadPoolManager.schedule(new ScheduleDuelTask(this), 1000);
|
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()
|
public void playKneelAnimation()
|
||||||
{
|
{
|
||||||
@@ -1053,11 +1052,10 @@ public class Duel
|
|||||||
else
|
else
|
||||||
// teleport the player back & delete his PlayerCondition record
|
// 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)
|
if (cond != null)
|
||||||
{
|
{
|
||||||
cond.teleportBack();
|
cond.teleportBack();
|
||||||
_playerConditions.remove(player.getObjectId());
|
|
||||||
}
|
}
|
||||||
player.setIsInDuel(0);
|
player.setIsInDuel(0);
|
||||||
}
|
}
|
||||||
|
@@ -91,8 +91,6 @@ public class Duel
|
|||||||
|
|
||||||
if (_partyDuel)
|
if (_partyDuel)
|
||||||
{
|
{
|
||||||
// increase countdown so that start task can teleport players
|
|
||||||
_countdown++;
|
|
||||||
// inform players that they will be ported shortly
|
// 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);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IN_A_MOMENT_YOU_WILL_BE_TRANSPORTED_TO_THE_SITE_WHERE_THE_DUEL_WILL_TAKE_PLACE);
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -588,7 +586,7 @@ public class Duel
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* teleport all players
|
* Teleports all players to a free arena.
|
||||||
*/
|
*/
|
||||||
public void teleportPlayers()
|
public void teleportPlayers()
|
||||||
{
|
{
|
||||||
@@ -813,6 +811,8 @@ public class Duel
|
|||||||
stopFighting();
|
stopFighting();
|
||||||
// Don't restore hp, mp, cp
|
// Don't restore hp, mp, cp
|
||||||
restorePlayerConditions(true);
|
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);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
@@ -822,7 +822,9 @@ public class Duel
|
|||||||
case TIMEOUT:
|
case TIMEOUT:
|
||||||
{
|
{
|
||||||
stopFighting();
|
stopFighting();
|
||||||
|
// hp,mp,cp seem to be restored in a timeout too...
|
||||||
restorePlayerConditions(false);
|
restorePlayerConditions(false);
|
||||||
|
// send SystemMessage
|
||||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
|
||||||
|
|
||||||
broadcastToTeam1(sm);
|
broadcastToTeam1(sm);
|
||||||
|
Reference in New Issue
Block a user