Addition of configuration TeleportWhilePlayerInCombat.

This commit is contained in:
MobiusDevelopment 2021-10-24 15:49:32 +00:00
parent 8f2a0b0133
commit 848872ae4c
18 changed files with 90 additions and 12 deletions

View File

@ -764,6 +764,10 @@ MaxOffsetOnTeleport = 50
# Default: False
TeleportWhileSiegeInProgress = False
# Enable teleporting while player in combat.
# Default: False
TeleportWhilePlayerInCombat = 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.

View File

@ -296,6 +296,7 @@ public class Config
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 TELEPORT_WHILE_PLAYER_IN_COMBAT;
public static boolean PETITIONING_ALLOWED;
public static int MAX_PETITIONS_PER_PLAYER;
public static int MAX_PETITIONS_PENDING;
@ -1949,6 +1950,7 @@ public class Config
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);
TELEPORT_WHILE_PLAYER_IN_COMBAT = Character.getBoolean("TeleportWhilePlayerInCombat", false);
PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true);
MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5);
MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25);

View File

@ -65,13 +65,20 @@ public class ExRequestTeleport implements IClientIncomingPacket
return;
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isImmobilized() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
// Players should not be able to teleport if in a special location.
if ((player.getMovieHolder() != null) || player.isFishing() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_RIGHT_NOW);
return;
}
// Teleport in combat configuration.
if (!Config.TELEPORT_WHILE_PLAYER_IN_COMBAT && (player.isInCombat() || player.isCastingNow()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_IN_COMBAT);
return;
}
// Karma related configurations.
if ((!Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT || !Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK) && (player.getReputation() < 0))
{

View File

@ -764,6 +764,10 @@ MaxOffsetOnTeleport = 50
# Default: False
TeleportWhileSiegeInProgress = False
# Enable teleporting while player in combat.
# Default: False
TeleportWhilePlayerInCombat = 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.

View File

@ -296,6 +296,7 @@ public class Config
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 TELEPORT_WHILE_PLAYER_IN_COMBAT;
public static boolean PETITIONING_ALLOWED;
public static int MAX_PETITIONS_PER_PLAYER;
public static int MAX_PETITIONS_PENDING;
@ -1947,6 +1948,7 @@ public class Config
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);
TELEPORT_WHILE_PLAYER_IN_COMBAT = Character.getBoolean("TeleportWhilePlayerInCombat", false);
PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true);
MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5);
MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25);

View File

@ -66,13 +66,20 @@ public class ExRequestTeleport implements IClientIncomingPacket
return;
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isImmobilized() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
// Players should not be able to teleport if in a special location.
if ((player.getMovieHolder() != null) || player.isFishing() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_RIGHT_NOW);
return;
}
// Teleport in combat configuration.
if (!Config.TELEPORT_WHILE_PLAYER_IN_COMBAT && (player.isInCombat() || player.isCastingNow()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_IN_COMBAT);
return;
}
// Karma related configurations.
if ((!Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT || !Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK) && (player.getReputation() < 0))
{

View File

@ -764,6 +764,10 @@ MaxOffsetOnTeleport = 50
# Default: False
TeleportWhileSiegeInProgress = False
# Enable teleporting while player in combat.
# Default: False
TeleportWhilePlayerInCombat = 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.

View File

@ -296,6 +296,7 @@ public class Config
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 TELEPORT_WHILE_PLAYER_IN_COMBAT;
public static boolean PETITIONING_ALLOWED;
public static int MAX_PETITIONS_PER_PLAYER;
public static int MAX_PETITIONS_PENDING;
@ -1947,6 +1948,7 @@ public class Config
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);
TELEPORT_WHILE_PLAYER_IN_COMBAT = Character.getBoolean("TeleportWhilePlayerInCombat", false);
PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true);
MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5);
MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25);

View File

@ -66,13 +66,20 @@ public class ExRequestTeleport implements IClientIncomingPacket
return;
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isImmobilized() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
// Players should not be able to teleport if in a special location.
if ((player.getMovieHolder() != null) || player.isFishing() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_RIGHT_NOW);
return;
}
// Teleport in combat configuration.
if (!Config.TELEPORT_WHILE_PLAYER_IN_COMBAT && (player.isInCombat() || player.isCastingNow()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_IN_COMBAT);
return;
}
// Karma related configurations.
if ((!Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT || !Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK) && (player.getReputation() < 0))
{

View File

@ -689,6 +689,10 @@ MaxOffsetOnTeleport = 50
# Classic: True
TeleportWhileSiegeInProgress = True
# Enable teleporting while player in combat.
# Default: False
TeleportWhilePlayerInCombat = 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.

View File

@ -295,6 +295,7 @@ public class Config
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 TELEPORT_WHILE_PLAYER_IN_COMBAT;
public static boolean PETITIONING_ALLOWED;
public static int MAX_PETITIONS_PER_PLAYER;
public static int MAX_PETITIONS_PENDING;
@ -1863,6 +1864,7 @@ public class Config
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);
TELEPORT_WHILE_PLAYER_IN_COMBAT = Character.getBoolean("TeleportWhilePlayerInCombat", false);
PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true);
MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5);
MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25);

View File

@ -65,13 +65,20 @@ public class ExRequestTeleport implements IClientIncomingPacket
return;
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isImmobilized() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
// Players should not be able to teleport if in a special location.
if ((player.getMovieHolder() != null) || player.isFishing() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendMessage("You cannot teleport right now.");
return;
}
// Teleport in combat configuration.
if (!Config.TELEPORT_WHILE_PLAYER_IN_COMBAT && (player.isInCombat() || player.isCastingNow()))
{
player.sendMessage("You cannot teleport in combat.");
return;
}
// Karma related configurations.
if ((!Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT || !Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK) && (player.getReputation() < 0))
{

View File

@ -689,6 +689,10 @@ MaxOffsetOnTeleport = 50
# Default: True
TeleportWhileSiegeInProgress = True
# Enable teleporting while player in combat.
# Default: False
TeleportWhilePlayerInCombat = 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.

View File

@ -297,6 +297,7 @@ public class Config
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 TELEPORT_WHILE_PLAYER_IN_COMBAT;
public static boolean PETITIONING_ALLOWED;
public static int MAX_PETITIONS_PER_PLAYER;
public static int MAX_PETITIONS_PENDING;
@ -1880,6 +1881,7 @@ public class Config
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);
TELEPORT_WHILE_PLAYER_IN_COMBAT = Character.getBoolean("TeleportWhilePlayerInCombat", false);
PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true);
MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5);
MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25);

View File

@ -68,13 +68,20 @@ public class ExRequestTeleport implements IClientIncomingPacket
return;
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isImmobilized() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
// Players should not be able to teleport if in a special location.
if ((player.getMovieHolder() != null) || player.isFishing() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_RIGHT_NOW);
return;
}
// Teleport in combat configuration.
if (!Config.TELEPORT_WHILE_PLAYER_IN_COMBAT && (player.isInCombat() || player.isCastingNow()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_IN_COMBAT);
return;
}
// Karma related configurations.
if ((!Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT || !Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK) && (player.getReputation() < 0))
{

View File

@ -689,6 +689,10 @@ MaxOffsetOnTeleport = 50
# Default: True
TeleportWhileSiegeInProgress = True
# Enable teleporting while player in combat.
# Default: False
TeleportWhilePlayerInCombat = 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.

View File

@ -297,6 +297,7 @@ public class Config
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 TELEPORT_WHILE_PLAYER_IN_COMBAT;
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
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);
TELEPORT_WHILE_PLAYER_IN_COMBAT = Character.getBoolean("TeleportWhilePlayerInCombat", false);
PETITIONING_ALLOWED = Character.getBoolean("PetitioningAllowed", true);
MAX_PETITIONS_PER_PLAYER = Character.getInt("MaxPetitionsPerPlayer", 5);
MAX_PETITIONS_PENDING = Character.getInt("MaxPetitionsPending", 25);

View File

@ -69,13 +69,20 @@ public class ExRequestTeleport implements IClientIncomingPacket
return;
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isImmobilized() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
// Players should not be able to teleport if in a special location.
if ((player.getMovieHolder() != null) || player.isFishing() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_RIGHT_NOW);
return;
}
// Teleport in combat configuration.
if (!Config.TELEPORT_WHILE_PLAYER_IN_COMBAT && (player.isInCombat() || player.isCastingNow()))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_IN_COMBAT);
return;
}
// Karma related configurations.
if ((!Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT || !Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK) && (player.getReputation() < 0))
{