Addition of timed hunting zones.

This commit is contained in:
MobiusDevelopment
2020-10-28 21:23:18 +00:00
parent a9f4efffd0
commit 14c5c79053
52 changed files with 420 additions and 156 deletions

View File

@@ -135,7 +135,7 @@ public class CallPc extends AbstractEffect
return false;
}
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp() || target.isInTimedHuntingZone() || effector.isInTimedHuntingZone())
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp() || target.isInsideZone(ZoneId.TIMED_HUNTING) || effector.isInsideZone(ZoneId.TIMED_HUNTING))
{
effector.sendPacket(SystemMessageId.YOU_CANNOT_USE_SUMMONING_OR_TELEPORTING_IN_THIS_AREA);
return false;
@@ -158,7 +158,7 @@ public class CallPc extends AbstractEffect
}
final Instance instance = effector.getInstanceWorld();
if (((instance != null) && !instance.isPlayerSummonAllowed()) || effector.isInTimedHuntingZone())
if ((instance != null) && !instance.isPlayerSummonAllowed())
{
effector.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_FROM_YOUR_CURRENT_LOCATION);
return false;

View File

@@ -109,7 +109,7 @@ public class TeleportToPlayer extends AbstractEffect
}
final Instance instance = target.getInstanceWorld();
if (((instance != null) && !instance.isPlayerSummonAllowed()) || target.isInTimedHuntingZone())
if (((instance != null) && !instance.isPlayerSummonAllowed()) || target.isInsideZone(ZoneId.TIMED_HUNTING))
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING_OR_TELEPORTING);
sm.addString(target.getName());

View File

@@ -173,6 +173,7 @@
<xs:enumeration value="SayuneZone" />
<xs:enumeration value="UndyingZone" />
<xs:enumeration value="TeleportZone" />
<xs:enumeration value="TimedHuntingZone" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/zones.xsd">
<!-- Timed Hunting Zones -->
<zone name="storm_isle_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="10000">
<node X="163840" Y="176604" />
<node X="196607" Y="196607" />
</zone>
<zone name="primeval_isle_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="10000">
<node X="0" Y="-32768" />
<node X="32767" Y="-1" />
</zone>
</list>

View File

@@ -79,6 +79,7 @@ import org.l2jmobius.gameserver.model.zone.type.SpawnTerritory;
import org.l2jmobius.gameserver.model.zone.type.SwampZone;
import org.l2jmobius.gameserver.model.zone.type.TaxZone;
import org.l2jmobius.gameserver.model.zone.type.TeleportZone;
import org.l2jmobius.gameserver.model.zone.type.TimedHuntingZone;
import org.l2jmobius.gameserver.model.zone.type.UndyingZone;
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
@@ -457,6 +458,7 @@ public class ZoneManager implements IXmlReader
_classZones.put(SwampZone.class, new ConcurrentHashMap<>());
_classZones.put(TaxZone.class, new ConcurrentHashMap<>());
_classZones.put(TeleportZone.class, new ConcurrentHashMap<>());
_classZones.put(TimedHuntingZone.class, new ConcurrentHashMap<>());
_classZones.put(UndyingZone.class, new ConcurrentHashMap<>());
_classZones.put(WaterZone.class, new ConcurrentHashMap<>());
_spawnTerritories.clear();

View File

@@ -10332,7 +10332,7 @@ public class PlayerInstance extends Playable
}
// Close time limited zone window.
if (!isInTimedHuntingZone())
if (!isInsideZone(ZoneId.TIMED_HUNTING))
{
stopTimedHuntingZoneTask();
}
@@ -14168,11 +14168,6 @@ public class PlayerInstance extends Playable
return _autoUseSettings;
}
public boolean isInTimedHuntingZone()
{
return isInTimedHuntingZone(getX(), getY());
}
public boolean isInTimedHuntingZone(int x, int y)
{
return isInTimedHuntingZone(1, x, y) // Storm Isle

View File

@@ -48,7 +48,8 @@ public enum ZoneId
SAYUNE,
FISHING,
UNDYING,
TAX;
TAX,
TIMED_HUNTING;
public static int getZoneCount()
{

View File

@@ -0,0 +1,72 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.model.zone.type;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneType;
/**
* @author Mobius
*/
public class TimedHuntingZone extends ZoneType
{
public TimedHuntingZone(int id)
{
super(id);
}
@Override
protected void onEnter(Creature creature)
{
final PlayerInstance player = creature.getActingPlayer();
if (player != null)
{
player.setInsideZone(ZoneId.TIMED_HUNTING, true);
final long currentTime = System.currentTimeMillis();
final long stormIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 1, 0);
final long primevalIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 6, 0);
if ((stormIsleExitTime > currentTime) && player.isInTimedHuntingZone(1))
{
player.startTimedHuntingZone(1, stormIsleExitTime - currentTime);
}
else if ((primevalIsleExitTime > currentTime) && player.isInTimedHuntingZone(6))
{
player.startTimedHuntingZone(6, primevalIsleExitTime - currentTime);
}
else
{
player.teleToLocation(MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN));
}
}
}
@Override
protected void onExit(Creature creature)
{
final PlayerInstance player = creature.getActingPlayer();
if (player != null)
{
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
}
}
}

View File

@@ -40,7 +40,6 @@ import org.l2jmobius.gameserver.instancemanager.FortManager;
import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
@@ -652,26 +651,6 @@ public class EnterWorld implements IClientIncomingPacket
player.updateAbnormalVisualEffects();
}
// Check if in time limited hunting zone.
if (player.isInTimedHuntingZone())
{
final long currentTime = System.currentTimeMillis();
final long stormIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 1, 0);
final long primevalIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 6, 0);
if ((stormIsleExitTime > currentTime) && player.isInTimedHuntingZone(1))
{
player.startTimedHuntingZone(1, stormIsleExitTime - currentTime);
}
else if ((primevalIsleExitTime > currentTime) && player.isInTimedHuntingZone(6))
{
player.startTimedHuntingZone(6, primevalIsleExitTime - currentTime);
}
else
{
player.teleToLocation(MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN));
}
}
if (Config.ENABLE_ATTENDANCE_REWARDS)
{
ThreadPool.schedule(() ->

View File

@@ -23,6 +23,7 @@ import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.entity.Castle;
import org.l2jmobius.gameserver.model.holders.TeleportListHolder;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
@@ -57,7 +58,7 @@ public class ExRequestTeleport implements IClientIncomingPacket
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInTimedHuntingZone())
if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_RIGHT_NOW);
return;

View File

@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
/**
@@ -48,7 +49,7 @@ public class RequestSaveBookMarkSlot implements IClientIncomingPacket
return;
}
if (player.isInTimedHuntingZone())
if (player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendMessage("You cannot bookmark this location.");
return;

View File

@@ -110,6 +110,8 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return;
}
player.getVariables().set(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, endTime);
switch (_zoneId)
{
case 1: // Storm Isle
@@ -123,9 +125,6 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
break;
}
}
player.getVariables().set(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, endTime);
player.startTimedHuntingZone(_zoneId, endTime - currentTime);
}
else
{

View File

@@ -20,6 +20,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
@@ -34,7 +35,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
public TimedHuntingZoneList(PlayerInstance player)
{
_player = player;
_isInTimedHuntingZone = player.isInTimedHuntingZone();
_isInTimedHuntingZone = player.isInsideZone(ZoneId.TIMED_HUNTING);
}
@Override

View File

@@ -135,7 +135,7 @@ public class CallPc extends AbstractEffect
return false;
}
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp() || target.isInTimedHuntingZone() || effector.isInTimedHuntingZone())
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp() || target.isInsideZone(ZoneId.TIMED_HUNTING) || effector.isInsideZone(ZoneId.TIMED_HUNTING))
{
effector.sendPacket(SystemMessageId.YOU_CANNOT_USE_SUMMONING_OR_TELEPORTING_IN_THIS_AREA);
return false;
@@ -158,7 +158,7 @@ public class CallPc extends AbstractEffect
}
final Instance instance = effector.getInstanceWorld();
if (((instance != null) && !instance.isPlayerSummonAllowed()) || effector.isInTimedHuntingZone())
if ((instance != null) && !instance.isPlayerSummonAllowed())
{
effector.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_FROM_YOUR_CURRENT_LOCATION);
return false;

View File

@@ -109,7 +109,7 @@ public class TeleportToPlayer extends AbstractEffect
}
final Instance instance = target.getInstanceWorld();
if (((instance != null) && !instance.isPlayerSummonAllowed()) || target.isInTimedHuntingZone())
if (((instance != null) && !instance.isPlayerSummonAllowed()) || target.isInsideZone(ZoneId.TIMED_HUNTING))
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING_OR_TELEPORTING);
sm.addString(target.getName());

View File

@@ -173,6 +173,7 @@
<xs:enumeration value="SayuneZone" />
<xs:enumeration value="UndyingZone" />
<xs:enumeration value="TeleportZone" />
<xs:enumeration value="TimedHuntingZone" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/zones.xsd">
<!-- Timed Hunting Zones -->
<zone name="storm_isle_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="10000">
<node X="163840" Y="176604" />
<node X="196607" Y="196607" />
</zone>
<zone name="primeval_isle_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="10000">
<node X="0" Y="-32768" />
<node X="32767" Y="-1" />
</zone>
<zone name="golden_altar_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="10000">
<node X="-131072" Y="65536" />
<node X="-98305" Y="98303" />
</zone>
<zone name="coal_mines_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="10000">
<node X="131072" Y="-196608" />
<node X="163839" Y="-163841" />
</zone>
<zone name="toi_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="10000">
<node X="-98304" Y="0" />
<node X="-65537" Y="32767" />
</zone>
<zone name="imperial_tomb_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="10000">
<node X="163840" Y="-98304" />
<node X="196607" Y="-65537" />
</zone>
</list>

View File

@@ -79,6 +79,7 @@ import org.l2jmobius.gameserver.model.zone.type.SpawnTerritory;
import org.l2jmobius.gameserver.model.zone.type.SwampZone;
import org.l2jmobius.gameserver.model.zone.type.TaxZone;
import org.l2jmobius.gameserver.model.zone.type.TeleportZone;
import org.l2jmobius.gameserver.model.zone.type.TimedHuntingZone;
import org.l2jmobius.gameserver.model.zone.type.UndyingZone;
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
@@ -457,6 +458,7 @@ public class ZoneManager implements IXmlReader
_classZones.put(SwampZone.class, new ConcurrentHashMap<>());
_classZones.put(TaxZone.class, new ConcurrentHashMap<>());
_classZones.put(TeleportZone.class, new ConcurrentHashMap<>());
_classZones.put(TimedHuntingZone.class, new ConcurrentHashMap<>());
_classZones.put(UndyingZone.class, new ConcurrentHashMap<>());
_classZones.put(WaterZone.class, new ConcurrentHashMap<>());
_spawnTerritories.clear();

View File

@@ -10335,7 +10335,7 @@ public class PlayerInstance extends Playable
}
// Close time limited zone window.
if (!isInTimedHuntingZone())
if (!isInsideZone(ZoneId.TIMED_HUNTING))
{
stopTimedHuntingZoneTask();
}
@@ -14126,11 +14126,6 @@ public class PlayerInstance extends Playable
return _autoUseSettings;
}
public boolean isInTimedHuntingZone()
{
return isInTimedHuntingZone(getX(), getY());
}
public boolean isInTimedHuntingZone(int x, int y)
{
return isInTimedHuntingZone(1, x, y) // Storm Isle

View File

@@ -48,7 +48,8 @@ public enum ZoneId
SAYUNE,
FISHING,
UNDYING,
TAX;
TAX,
TIMED_HUNTING;
public static int getZoneCount()
{

View File

@@ -0,0 +1,92 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.model.zone.type;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneType;
/**
* @author Mobius
*/
public class TimedHuntingZone extends ZoneType
{
public TimedHuntingZone(int id)
{
super(id);
}
@Override
protected void onEnter(Creature creature)
{
final PlayerInstance player = creature.getActingPlayer();
if (player != null)
{
player.setInsideZone(ZoneId.TIMED_HUNTING, true);
final long currentTime = System.currentTimeMillis();
final long stormIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 1, 0);
final long primevalIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 6, 0);
final long goldenAltarExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 7, 0);
final long coalMinesExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 11, 0);
final long toiExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 8, 0);
final long imperialTombExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 12, 0);
if ((stormIsleExitTime > currentTime) && player.isInTimedHuntingZone(1))
{
player.startTimedHuntingZone(1, stormIsleExitTime - currentTime);
}
else if ((primevalIsleExitTime > currentTime) && player.isInTimedHuntingZone(6))
{
player.startTimedHuntingZone(6, primevalIsleExitTime - currentTime);
}
else if ((goldenAltarExitTime > currentTime) && player.isInTimedHuntingZone(7))
{
player.startTimedHuntingZone(7, goldenAltarExitTime - currentTime);
}
else if ((coalMinesExitTime > currentTime) && player.isInTimedHuntingZone(11))
{
player.startTimedHuntingZone(11, coalMinesExitTime - currentTime);
}
else if ((toiExitTime > currentTime) && player.isInTimedHuntingZone(8))
{
player.startTimedHuntingZone(8, toiExitTime - currentTime);
}
else if ((imperialTombExitTime > currentTime) && player.isInTimedHuntingZone(12))
{
player.startTimedHuntingZone(12, imperialTombExitTime - currentTime);
}
else
{
player.teleToLocation(MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN));
}
}
}
@Override
protected void onExit(Creature creature)
{
final PlayerInstance player = creature.getActingPlayer();
if (player != null)
{
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
}
}
}

View File

@@ -40,7 +40,6 @@ import org.l2jmobius.gameserver.instancemanager.FortManager;
import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
@@ -660,46 +659,6 @@ public class EnterWorld implements IClientIncomingPacket
player.updateAbnormalVisualEffects();
}
// Check if in time limited hunting zone.
if (player.isInTimedHuntingZone())
{
final long currentTime = System.currentTimeMillis();
final long stormIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 1, 0);
final long primevalIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 6, 0);
final long goldenAltarExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 7, 0);
final long coalMinesExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 11, 0);
final long toiExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 8, 0);
final long imperialTombExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 12, 0);
if ((stormIsleExitTime > currentTime) && player.isInTimedHuntingZone(1))
{
player.startTimedHuntingZone(1, stormIsleExitTime - currentTime);
}
else if ((primevalIsleExitTime > currentTime) && player.isInTimedHuntingZone(6))
{
player.startTimedHuntingZone(6, primevalIsleExitTime - currentTime);
}
else if ((goldenAltarExitTime > currentTime) && player.isInTimedHuntingZone(7))
{
player.startTimedHuntingZone(7, goldenAltarExitTime - currentTime);
}
else if ((coalMinesExitTime > currentTime) && player.isInTimedHuntingZone(11))
{
player.startTimedHuntingZone(11, coalMinesExitTime - currentTime);
}
else if ((toiExitTime > currentTime) && player.isInTimedHuntingZone(11))
{
player.startTimedHuntingZone(8, toiExitTime - currentTime);
}
else if ((imperialTombExitTime > currentTime) && player.isInTimedHuntingZone(11))
{
player.startTimedHuntingZone(12, imperialTombExitTime - currentTime);
}
else
{
player.teleToLocation(MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN));
}
}
if (Config.ENABLE_ATTENDANCE_REWARDS)
{
ThreadPool.schedule(() ->

View File

@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
/**
@@ -48,7 +49,7 @@ public class RequestSaveBookMarkSlot implements IClientIncomingPacket
return;
}
if (player.isInTimedHuntingZone())
if (player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendMessage("You cannot bookmark this location.");
return;

View File

@@ -114,6 +114,8 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return;
}
player.getVariables().set(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, endTime);
switch (_zoneId)
{
case 1: // Storm Isle
@@ -147,9 +149,6 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
break;
}
}
player.getVariables().set(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, endTime);
player.startTimedHuntingZone(_zoneId, endTime - currentTime);
}
else
{

View File

@@ -23,6 +23,7 @@ import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.entity.Castle;
import org.l2jmobius.gameserver.model.holders.TeleportListHolder;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -58,7 +59,7 @@ public class ExRequestTeleport implements IClientIncomingPacket
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInTimedHuntingZone())
if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_RIGHT_NOW);
return;

View File

@@ -20,6 +20,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
@@ -34,7 +35,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
public TimedHuntingZoneList(PlayerInstance player)
{
_player = player;
_isInTimedHuntingZone = player.isInTimedHuntingZone();
_isInTimedHuntingZone = player.isInsideZone(ZoneId.TIMED_HUNTING);
}
@Override

View File

@@ -135,7 +135,7 @@ public class CallPc extends AbstractEffect
return false;
}
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp() || target.isInTimedHuntingZone() || effector.isInTimedHuntingZone())
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp() || target.isInsideZone(ZoneId.TIMED_HUNTING) || effector.isInsideZone(ZoneId.TIMED_HUNTING))
{
effector.sendPacket(SystemMessageId.YOU_CANNOT_USE_SUMMONING_OR_TELEPORTING_IN_THIS_AREA);
return false;

View File

@@ -109,7 +109,7 @@ public class TeleportToPlayer extends AbstractEffect
}
final Instance instance = target.getInstanceWorld();
if (((instance != null) && !instance.isPlayerSummonAllowed()) || target.isInTimedHuntingZone())
if (((instance != null) && !instance.isPlayerSummonAllowed()) || target.isInsideZone(ZoneId.TIMED_HUNTING))
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING_OR_TELEPORTING);
sm.addString(target.getName());

View File

@@ -173,6 +173,7 @@
<xs:enumeration value="SayuneZone" />
<xs:enumeration value="UndyingZone" />
<xs:enumeration value="TeleportZone" />
<xs:enumeration value="TimedHuntingZone" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/zones.xsd">
<!-- Timed Hunting Zones -->
<zone name="pirate_tomb_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="-5000">
<node X="0" Y="-98304" />
<node X="32767" Y="-65537" />
</zone>
</list>

View File

@@ -79,6 +79,7 @@ import org.l2jmobius.gameserver.model.zone.type.SpawnTerritory;
import org.l2jmobius.gameserver.model.zone.type.SwampZone;
import org.l2jmobius.gameserver.model.zone.type.TaxZone;
import org.l2jmobius.gameserver.model.zone.type.TeleportZone;
import org.l2jmobius.gameserver.model.zone.type.TimedHuntingZone;
import org.l2jmobius.gameserver.model.zone.type.UndyingZone;
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
@@ -457,6 +458,7 @@ public class ZoneManager implements IXmlReader
_classZones.put(SwampZone.class, new ConcurrentHashMap<>());
_classZones.put(TaxZone.class, new ConcurrentHashMap<>());
_classZones.put(TeleportZone.class, new ConcurrentHashMap<>());
_classZones.put(TimedHuntingZone.class, new ConcurrentHashMap<>());
_classZones.put(UndyingZone.class, new ConcurrentHashMap<>());
_classZones.put(WaterZone.class, new ConcurrentHashMap<>());
_spawnTerritories.clear();

View File

@@ -10224,7 +10224,7 @@ public class PlayerInstance extends Playable
}
// Close time limited zone window.
if (!isInTimedHuntingZone())
if (!isInsideZone(ZoneId.TIMED_HUNTING))
{
stopTimedHuntingZoneTask();
}
@@ -14115,11 +14115,6 @@ public class PlayerInstance extends Playable
return _autoUseSettings;
}
public boolean isInTimedHuntingZone()
{
return isInTimedHuntingZone(getX(), getY());
}
public boolean isInTimedHuntingZone(int x, int y)
{
return isInTimedHuntingZone(2, x, y); // Ancient Pirates' Tomb

View File

@@ -48,7 +48,8 @@ public enum ZoneId
SAYUNE,
FISHING,
UNDYING,
TAX;
TAX,
TIMED_HUNTING;
public static int getZoneCount()
{

View File

@@ -0,0 +1,67 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.model.zone.type;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneType;
/**
* @author Mobius
*/
public class TimedHuntingZone extends ZoneType
{
public TimedHuntingZone(int id)
{
super(id);
}
@Override
protected void onEnter(Creature creature)
{
final PlayerInstance player = creature.getActingPlayer();
if (player != null)
{
player.setInsideZone(ZoneId.TIMED_HUNTING, true);
final long currentTime = System.currentTimeMillis();
final long pirateTombExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 2, 0);
if ((pirateTombExitTime > currentTime) && player.isInTimedHuntingZone(2))
{
player.startTimedHuntingZone(2, pirateTombExitTime - currentTime);
}
else
{
player.teleToLocation(MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN));
}
}
}
@Override
protected void onExit(Creature creature)
{
final PlayerInstance player = creature.getActingPlayer();
if (player != null)
{
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
}
}
}

View File

@@ -39,7 +39,6 @@ import org.l2jmobius.gameserver.instancemanager.FortManager;
import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
@@ -637,21 +636,6 @@ public class EnterWorld implements IClientIncomingPacket
player.updateAbnormalVisualEffects();
}
// Check if in time limited hunting zone.
if (player.isInTimedHuntingZone())
{
final long currentTime = System.currentTimeMillis();
final long pirateTombExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 2, 0);
if ((pirateTombExitTime > currentTime) && player.isInTimedHuntingZone(2))
{
player.startTimedHuntingZone(1, pirateTombExitTime - currentTime);
}
else
{
player.teleToLocation(MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN));
}
}
if (Config.ENABLE_ATTENDANCE_REWARDS)
{
ThreadPool.schedule(() ->

View File

@@ -23,6 +23,7 @@ import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.entity.Castle;
import org.l2jmobius.gameserver.model.holders.TeleportListHolder;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
@@ -57,7 +58,7 @@ public class ExRequestTeleport implements IClientIncomingPacket
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInTimedHuntingZone())
if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendMessage("You cannot teleport right now.");
return;

View File

@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
/**
@@ -48,7 +49,7 @@ public class RequestSaveBookMarkSlot implements IClientIncomingPacket
return;
}
if (player.isInTimedHuntingZone())
if (player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendMessage("You cannot bookmark this location.");
return;

View File

@@ -107,6 +107,8 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return;
}
player.getVariables().set(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, endTime);
switch (_zoneId)
{
case 2: // Ancient Pirates' Tomb
@@ -115,9 +117,6 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
break;
}
}
player.getVariables().set(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, endTime);
player.startTimedHuntingZone(_zoneId, endTime - currentTime);
}
else
{

View File

@@ -20,6 +20,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
@@ -34,7 +35,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
public TimedHuntingZoneList(PlayerInstance player)
{
_player = player;
_isInTimedHuntingZone = player.isInTimedHuntingZone();
_isInTimedHuntingZone = player.isInsideZone(ZoneId.TIMED_HUNTING);
}
@Override

View File

@@ -135,7 +135,7 @@ public class CallPc extends AbstractEffect
return false;
}
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp() || target.isInTimedHuntingZone() || effector.isInTimedHuntingZone())
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp() || target.isInsideZone(ZoneId.TIMED_HUNTING) || effector.isInsideZone(ZoneId.TIMED_HUNTING))
{
effector.sendPacket(SystemMessageId.YOU_CANNOT_USE_SUMMONING_OR_TELEPORTING_IN_THIS_AREA);
return false;

View File

@@ -109,7 +109,7 @@ public class TeleportToPlayer extends AbstractEffect
}
final Instance instance = target.getInstanceWorld();
if (((instance != null) && !instance.isPlayerSummonAllowed()) || target.isInTimedHuntingZone())
if (((instance != null) && !instance.isPlayerSummonAllowed()) || target.isInsideZone(ZoneId.TIMED_HUNTING))
{
final SystemMessage sm = new SystemMessage(SystemMessageId.C1_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING_OR_TELEPORTING);
sm.addString(target.getName());

View File

@@ -173,6 +173,7 @@
<xs:enumeration value="SayuneZone" />
<xs:enumeration value="UndyingZone" />
<xs:enumeration value="TeleportZone" />
<xs:enumeration value="TimedHuntingZone" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/zones.xsd">
<!-- Timed Hunting Zones -->
<zone name="primeval_isle_hz" type="TimedHuntingZone" shape="Cuboid" minZ="-16000" maxZ="10000">
<node X="0" Y="-32768" />
<node X="32767" Y="-1" />
</zone>
</list>

View File

@@ -79,6 +79,7 @@ import org.l2jmobius.gameserver.model.zone.type.SpawnTerritory;
import org.l2jmobius.gameserver.model.zone.type.SwampZone;
import org.l2jmobius.gameserver.model.zone.type.TaxZone;
import org.l2jmobius.gameserver.model.zone.type.TeleportZone;
import org.l2jmobius.gameserver.model.zone.type.TimedHuntingZone;
import org.l2jmobius.gameserver.model.zone.type.UndyingZone;
import org.l2jmobius.gameserver.model.zone.type.WaterZone;
@@ -457,6 +458,7 @@ public class ZoneManager implements IXmlReader
_classZones.put(SwampZone.class, new ConcurrentHashMap<>());
_classZones.put(TaxZone.class, new ConcurrentHashMap<>());
_classZones.put(TeleportZone.class, new ConcurrentHashMap<>());
_classZones.put(TimedHuntingZone.class, new ConcurrentHashMap<>());
_classZones.put(UndyingZone.class, new ConcurrentHashMap<>());
_classZones.put(WaterZone.class, new ConcurrentHashMap<>());
_spawnTerritories.clear();

View File

@@ -10262,7 +10262,7 @@ public class PlayerInstance extends Playable
}
// Close time limited zone window.
if (!isInTimedHuntingZone())
if (!isInsideZone(ZoneId.TIMED_HUNTING))
{
stopTimedHuntingZoneTask();
}
@@ -14198,11 +14198,6 @@ public class PlayerInstance extends Playable
return _autoUseSettings;
}
public boolean isInTimedHuntingZone()
{
return isInTimedHuntingZone(getX(), getY());
}
public boolean isInTimedHuntingZone(int x, int y)
{
return isInTimedHuntingZone(1, x, y); // Primeval Isle

View File

@@ -48,7 +48,8 @@ public enum ZoneId
SAYUNE,
FISHING,
UNDYING,
TAX;
TAX,
TIMED_HUNTING;
public static int getZoneCount()
{

View File

@@ -0,0 +1,67 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.model.zone.type;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneType;
/**
* @author Mobius
*/
public class TimedHuntingZone extends ZoneType
{
public TimedHuntingZone(int id)
{
super(id);
}
@Override
protected void onEnter(Creature creature)
{
final PlayerInstance player = creature.getActingPlayer();
if (player != null)
{
player.setInsideZone(ZoneId.TIMED_HUNTING, true);
final long currentTime = System.currentTimeMillis();
final long primevalIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 1, 0);
if ((primevalIsleExitTime > currentTime) && player.isInTimedHuntingZone(1))
{
player.startTimedHuntingZone(1, primevalIsleExitTime - currentTime);
}
else
{
player.teleToLocation(MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN));
}
}
}
@Override
protected void onExit(Creature creature)
{
final PlayerInstance player = creature.getActingPlayer();
if (player != null)
{
player.setInsideZone(ZoneId.TIMED_HUNTING, false);
}
}
}

View File

@@ -39,7 +39,6 @@ import org.l2jmobius.gameserver.instancemanager.FortManager;
import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.MapRegionManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
@@ -649,21 +648,6 @@ public class EnterWorld implements IClientIncomingPacket
player.updateAbnormalVisualEffects();
}
// Check if in time limited hunting zone.
if (player.isInTimedHuntingZone())
{
final long currentTime = System.currentTimeMillis();
final long primevalIsleExitTime = player.getVariables().getLong(PlayerVariables.HUNTING_ZONE_RESET_TIME + 1, 0);
if ((primevalIsleExitTime > currentTime) && player.isInTimedHuntingZone(1))
{
player.startTimedHuntingZone(1, primevalIsleExitTime - currentTime);
}
else
{
player.teleToLocation(MapRegionManager.getInstance().getTeleToLocation(player, TeleportWhereType.TOWN));
}
}
if (Config.ENABLE_ATTENDANCE_REWARDS)
{
ThreadPool.schedule(() ->

View File

@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
/**
@@ -48,7 +49,7 @@ public class RequestSaveBookMarkSlot implements IClientIncomingPacket
return;
}
if (player.isInTimedHuntingZone())
if (player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendMessage("You cannot bookmark this location.");
return;

View File

@@ -107,6 +107,8 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
return;
}
player.getVariables().set(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, endTime);
switch (_zoneId)
{
case 1: // Primeval Isle
@@ -115,9 +117,6 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
break;
}
}
player.getVariables().set(PlayerVariables.HUNTING_ZONE_RESET_TIME + _zoneId, endTime);
player.startTimedHuntingZone(_zoneId, endTime - currentTime);
}
else
{

View File

@@ -23,6 +23,7 @@ import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.entity.Castle;
import org.l2jmobius.gameserver.model.holders.TeleportListHolder;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
@@ -58,7 +59,7 @@ public class ExRequestTeleport implements IClientIncomingPacket
}
// Players should not be able to teleport if in combat, or in a special location.
if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInTimedHuntingZone())
if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInsideZone(ZoneId.TIMED_HUNTING))
{
player.sendMessage("You cannot teleport right now.");
return;

View File

@@ -20,6 +20,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.variables.PlayerVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.OutgoingPackets;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
@@ -34,7 +35,7 @@ public class TimedHuntingZoneList implements IClientOutgoingPacket
public TimedHuntingZoneList(PlayerInstance player)
{
_player = player;
_isInTimedHuntingZone = player.isInTimedHuntingZone();
_isInTimedHuntingZone = player.isInsideZone(ZoneId.TIMED_HUNTING);
}
@Override