Entry to timed hunting zones only from peace areas.

This commit is contained in:
MobiusDevelopment 2021-07-01 22:30:09 +00:00
parent 063f4ea998
commit df605dec7d
8 changed files with 48 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager; import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@ -53,6 +54,11 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if (!player.isInsideZone(ZoneId.PEACE))
{
player.sendPacket(SystemMessageId.CANNOT_MOVE_FROM_THE_CURRENT_LOCATION);
return;
}
if (player.isInCombat()) if (player.isInCombat())
{ {
player.sendMessage("You can only enter in time-limited hunting zones while not in combat."); player.sendMessage("You can only enter in time-limited hunting zones while not in combat.");

View File

@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager; import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@ -53,6 +54,11 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if (!player.isInsideZone(ZoneId.PEACE))
{
player.sendPacket(SystemMessageId.CANNOT_MOVE_FROM_THE_CURRENT_LOCATION);
return;
}
if (player.isInCombat()) if (player.isInCombat())
{ {
player.sendMessage("You can only enter in time-limited hunting zones while not in combat."); player.sendMessage("You can only enter in time-limited hunting zones while not in combat.");

View File

@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager; import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@ -53,6 +54,11 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if (!player.isInsideZone(ZoneId.PEACE))
{
player.sendPacket(SystemMessageId.CANNOT_MOVE_FROM_THE_CURRENT_LOCATION);
return;
}
if (player.isInCombat()) if (player.isInCombat())
{ {
player.sendMessage("You can only enter in time-limited hunting zones while not in combat."); player.sendMessage("You can only enter in time-limited hunting zones while not in combat.");

View File

@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager; import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@ -53,6 +54,11 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if (!player.isInsideZone(ZoneId.PEACE))
{
player.sendPacket(SystemMessageId.CANNOT_MOVE_FROM_THE_CURRENT_LOCATION);
return;
}
if (player.isInCombat()) if (player.isInCombat())
{ {
player.sendMessage("You can only enter in time-limited hunting zones while not in combat."); player.sendMessage("You can only enter in time-limited hunting zones while not in combat.");

View File

@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager; import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@ -53,6 +54,11 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if (!player.isInsideZone(ZoneId.PEACE))
{
player.sendMessage("Cannot move from the current location.");
return;
}
if (player.isInCombat()) if (player.isInCombat())
{ {
player.sendMessage("You can only enter in time-limited hunting zones while not in combat."); player.sendMessage("You can only enter in time-limited hunting zones while not in combat.");

View File

@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager; import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@ -53,6 +54,11 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if (!player.isInsideZone(ZoneId.PEACE))
{
player.sendPacket(SystemMessageId.CANNOT_MOVE_FROM_THE_CURRENT_LOCATION);
return;
}
if (player.isInCombat()) if (player.isInCombat())
{ {
player.sendMessage("You can only enter in time-limited hunting zones while not in combat."); player.sendMessage("You can only enter in time-limited hunting zones while not in combat.");

View File

@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager; import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@ -53,6 +54,11 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if (!player.isInsideZone(ZoneId.PEACE))
{
player.sendPacket(SystemMessageId.CANNOT_MOVE_FROM_THE_CURRENT_LOCATION);
return;
}
if (player.isInCombat()) if (player.isInCombat())
{ {
player.sendMessage("You can only enter in time-limited hunting zones while not in combat."); player.sendMessage("You can only enter in time-limited hunting zones while not in combat.");

View File

@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager; import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@ -53,6 +54,11 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return; return;
} }
if (!player.isInsideZone(ZoneId.PEACE))
{
player.sendPacket(SystemMessageId.CANNOT_MOVE_FROM_THE_CURRENT_LOCATION);
return;
}
if (player.isInCombat()) if (player.isInCombat())
{ {
player.sendMessage("You can only enter in time-limited hunting zones while not in combat."); player.sendMessage("You can only enter in time-limited hunting zones while not in combat.");