diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini index 48962b4467..f8c18aaa84 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Character.ini @@ -750,10 +750,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Default: False +TeleportWhileSiegeInProgress = False + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java index 1bfb3ad2cd..8d49c57c56 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java @@ -283,6 +283,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1854,6 +1855,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index d2d12e869d..181ae1992e 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini b/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini index 1f152443d8..01ba701cff 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/Character.ini @@ -750,10 +750,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Default: False +TeleportWhileSiegeInProgress = False + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java index 05966ec89b..af7cb4c3cf 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java @@ -289,6 +289,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1870,6 +1871,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index 8709693199..cdc8678e30 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini b/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini index 1f152443d8..01ba701cff 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/Character.ini @@ -750,10 +750,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Default: False +TeleportWhileSiegeInProgress = False + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java index 3134828d42..8a33a03e80 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java @@ -289,6 +289,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1883,6 +1884,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index 8709693199..cdc8678e30 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini index d31e686269..4fa9776ca9 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Character.ini @@ -726,10 +726,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Default: False +TeleportWhileSiegeInProgress = False + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java index cf86104404..14c2e12e79 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java @@ -283,6 +283,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1864,6 +1865,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index 8709693199..cdc8678e30 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/config/Character.ini b/L2J_Mobius_5.0_Salvation/dist/game/config/Character.ini index cde6621151..16056d1fe6 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/config/Character.ini +++ b/L2J_Mobius_5.0_Salvation/dist/game/config/Character.ini @@ -726,10 +726,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Default: False +TeleportWhileSiegeInProgress = False + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java index 2bb8a0ff70..4d1a3d5166 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java @@ -290,6 +290,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1865,6 +1866,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index 8709693199..cdc8678e30 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/config/Character.ini b/L2J_Mobius_5.5_EtinasFate/dist/game/config/Character.ini index cde6621151..16056d1fe6 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/config/Character.ini +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/config/Character.ini @@ -726,10 +726,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Default: False +TeleportWhileSiegeInProgress = False + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java index 2809546fe2..d0996df3a0 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java @@ -290,6 +290,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1872,6 +1873,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index 8709693199..cdc8678e30 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/config/Character.ini b/L2J_Mobius_6.0_Fafurion/dist/game/config/Character.ini index 4bf1639177..14fa4c2436 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/config/Character.ini +++ b/L2J_Mobius_6.0_Fafurion/dist/game/config/Character.ini @@ -746,10 +746,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Default: False +TeleportWhileSiegeInProgress = False + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java index 11ee99ec8f..d696604e73 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java @@ -291,6 +291,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1911,6 +1912,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index 8709693199..cdc8678e30 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Character.ini b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Character.ini index ba8a206238..32e1ededb3 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Character.ini +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Character.ini @@ -756,10 +756,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Default: False +TeleportWhileSiegeInProgress = False + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java index c8c2f47390..240e6622ee 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java @@ -292,6 +292,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1923,6 +1924,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index 8709693199..cdc8678e30 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java index 267e6be22c..8b32ea9e7c 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java @@ -63,11 +63,14 @@ public class ExRequestTeleport implements IClientIncomingPacket return; } - final Castle castle = CastleManager.getInstance().getCastle(teleport.getX(), teleport.getY(), teleport.getZ()); - if ((castle != null) && castle.getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + final Castle castle = CastleManager.getInstance().getCastle(teleport.getX(), teleport.getY(), teleport.getZ()); + if ((castle != null) && castle.getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } if (player.getLevel() > Config.MAX_FREE_TELEPORT_LEVEL) diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini index ad19de86c1..9e39928205 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini @@ -665,10 +665,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Classic: True +TeleportWhileSiegeInProgress = True + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java index cd448c3d80..3a19bd1f7f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java @@ -288,6 +288,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1780,6 +1781,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index d2d12e869d..181ae1992e 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini index 7456900e16..018407c1ac 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini @@ -665,10 +665,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Classic: True +TeleportWhileSiegeInProgress = True + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java index fea9018dfe..51f0377f72 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java @@ -288,6 +288,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1784,6 +1785,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index d2d12e869d..181ae1992e 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini index e7294ae19b..ce2c30e315 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini @@ -665,10 +665,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Classic: True +TeleportWhileSiegeInProgress = True + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java index fea9018dfe..51f0377f72 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java @@ -288,6 +288,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1784,6 +1785,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index d2d12e869d..181ae1992e 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Character.ini index e7294ae19b..ce2c30e315 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Character.ini @@ -665,10 +665,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Classic: True +TeleportWhileSiegeInProgress = True + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java index 4771477473..f533921b93 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java @@ -288,6 +288,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1785,6 +1786,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index d2d12e869d..181ae1992e 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Character.ini index 7c9ed2a2a5..f5e076de19 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Character.ini @@ -681,10 +681,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Classic: True +TeleportWhileSiegeInProgress = True + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java index 53c7a56349..bd7be679bb 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java @@ -288,6 +288,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1794,6 +1795,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index d2d12e869d..181ae1992e 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Character.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Character.ini index 1eaf556a98..160d088285 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Character.ini @@ -681,10 +681,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Classic: True +TeleportWhileSiegeInProgress = True + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java index e1b2501018..e5250bc045 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java @@ -289,6 +289,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1801,6 +1802,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index d2d12e869d..181ae1992e 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm"); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java index 4ea894448c..02a6c2afc1 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java @@ -63,11 +63,14 @@ public class ExRequestTeleport implements IClientIncomingPacket return; } - final Castle castle = CastleManager.getInstance().getCastle(teleport.getX(), teleport.getY(), teleport.getZ()); - if ((castle != null) && castle.getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + final Castle castle = CastleManager.getInstance().getCastle(teleport.getX(), teleport.getY(), teleport.getZ()); + if ((castle != null) && castle.getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } if (player.getLevel() > Config.MAX_FREE_TELEPORT_LEVEL) diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/Character.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/Character.ini index 3211eb05b1..4733e17f14 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/Character.ini @@ -666,10 +666,14 @@ RandomRespawnInTownEnabled = True # Default: True OffsetOnTeleportEnabled = True -# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled . +# Maximum offset for base teleport location when OffsetOnTeleportEnabled is enabled. # Default: 50 MaxOffsetOnTeleport = 50 +# Enable teleporting while siege in progress. +# Default: False +TeleportWhileSiegeInProgress = False + # This option is to enable or disable the use of in game petitions. # The MaxPetitionsPerPlayer is the amount of petitions a player can make. # The MaximumPendingPetitions is the total amount of petitions in the server. diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java index 01b87505b7..9a3471b150 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java @@ -289,6 +289,7 @@ public class Config public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED; public static boolean OFFSET_ON_TELEPORT_ENABLED; public static int MAX_OFFSET_ON_TELEPORT; + public static boolean TELEPORT_WHILE_SIEGE_IN_PROGRESS; public static boolean PETITIONING_ALLOWED; public static int MAX_PETITIONS_PER_PLAYER; public static int MAX_PETITIONS_PENDING; @@ -1798,6 +1799,7 @@ public class Config RANDOM_RESPAWN_IN_TOWN_ENABLED = Character.getBoolean("RandomRespawnInTownEnabled", true); OFFSET_ON_TELEPORT_ENABLED = Character.getBoolean("OffsetOnTeleportEnabled", true); MAX_OFFSET_ON_TELEPORT = Character.getInt("MaxOffsetOnTeleport", 50); + TELEPORT_WHILE_SIEGE_IN_PROGRESS = Character.getBoolean("TeleportWhileSiegeInProgress", true); PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true); MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5); MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25); diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java index d2d12e869d..181ae1992e 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/teleporter/TeleportHolder.java @@ -206,19 +206,22 @@ public class TeleportHolder } // Check if castle is in siege - for (int castleId : loc.getCastleId()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS) { - if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + for (int castleId : loc.getCastleId()) { - player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); - return; + if (CastleManager.getInstance().getCastleById(castleId).getSiege().isInProgress()) + { + player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE); + return; + } } } // Validate conditions for NORMAL teleport if (isNormalTeleport()) { - if (npc.getCastle().getSiege().isInProgress()) + if (!Config.TELEPORT_WHILE_SIEGE_IN_PROGRESS && npc.getCastle().getSiege().isInProgress()) { final NpcHtmlMessage msg = new NpcHtmlMessage(npc.getObjectId()); msg.setFile(player, "data/html/teleporter/castleteleporter-busy.htm");