Addition of teleport while siege in progress configuration.
Thanks to Iris.
This commit is contained in:
@ -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);
|
||||
|
@ -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");
|
||||
|
Reference in New Issue
Block a user