Addition of Player isInTimedHuntingZone method.
This commit is contained in:
parent
98166d7d78
commit
54578fc855
@ -1102,7 +1102,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
||||
sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_WHILE_FISHING;
|
||||
canRegister = false;
|
||||
}
|
||||
else if (player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
else if (player.isInTimedHuntingZone())
|
||||
{
|
||||
sm = SystemMessageId.CANNOT_USE_TIME_LIMITED_HUNTING_ZONES_WHILE_WAITING_FOR_THE_CEREMONY_OF_CHAOS;
|
||||
canRegister = false;
|
||||
|
@ -10591,7 +10591,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Close time limited zone window.
|
||||
if (!isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (!isInTimedHuntingZone())
|
||||
{
|
||||
stopTimedHuntingZoneTask();
|
||||
}
|
||||
@ -11053,7 +11053,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Exit timed hunting zone.
|
||||
if (isInTimedHuntingZone(getX(), getY()))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
teleToLocation(TeleportWhereType.TOWN);
|
||||
storeCharBase();
|
||||
@ -14603,6 +14603,11 @@ public class Player extends Playable
|
||||
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone()
|
||||
{
|
||||
return isInTimedHuntingZone(getX(), getY());
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int x, int y)
|
||||
{
|
||||
for (TimedHuntingZoneHolder holder : TimedHuntingZoneData.getInstance().getAllHuntingZones())
|
||||
|
@ -90,7 +90,7 @@ public class TimedHuntingZone extends ZoneType
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
player.sendMessage("Cannot use time-limited hunting zones while registered on an event.");
|
||||
return;
|
||||
}
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendMessage("Cannot use time-limited hunting zones while in an instance.");
|
||||
return;
|
||||
|
@ -1102,7 +1102,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
||||
sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_WHILE_FISHING;
|
||||
canRegister = false;
|
||||
}
|
||||
else if (player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
else if (player.isInTimedHuntingZone())
|
||||
{
|
||||
sm = SystemMessageId.CANNOT_USE_TIME_LIMITED_HUNTING_ZONES_WHILE_WAITING_FOR_THE_CEREMONY_OF_CHAOS;
|
||||
canRegister = false;
|
||||
|
@ -10737,7 +10737,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Close time limited zone window.
|
||||
if (!isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (!isInTimedHuntingZone())
|
||||
{
|
||||
stopTimedHuntingZoneTask();
|
||||
}
|
||||
@ -11204,7 +11204,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Exit timed hunting zone.
|
||||
if (isInTimedHuntingZone(getX(), getY()))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
teleToLocation(TeleportWhereType.TOWN);
|
||||
storeCharBase();
|
||||
@ -14714,6 +14714,11 @@ public class Player extends Playable
|
||||
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone()
|
||||
{
|
||||
return isInTimedHuntingZone(getX(), getY());
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int x, int y)
|
||||
{
|
||||
for (TimedHuntingZoneHolder holder : TimedHuntingZoneData.getInstance().getAllHuntingZones())
|
||||
|
@ -90,7 +90,7 @@ public class TimedHuntingZone extends ZoneType
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
player.sendMessage("Cannot use time-limited hunting zones while registered on an event.");
|
||||
return;
|
||||
}
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendMessage("Cannot use time-limited hunting zones while in an instance.");
|
||||
return;
|
||||
|
@ -1102,7 +1102,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
||||
sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_WHILE_FISHING;
|
||||
canRegister = false;
|
||||
}
|
||||
else if (player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
else if (player.isInTimedHuntingZone())
|
||||
{
|
||||
sm = SystemMessageId.CANNOT_USE_TIME_LIMITED_HUNTING_ZONES_WHILE_WAITING_FOR_THE_CEREMONY_OF_CHAOS;
|
||||
canRegister = false;
|
||||
|
@ -10764,7 +10764,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Close time limited zone window.
|
||||
if (!isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (!isInTimedHuntingZone())
|
||||
{
|
||||
stopTimedHuntingZoneTask();
|
||||
}
|
||||
@ -11231,7 +11231,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Exit timed hunting zone.
|
||||
if (isInTimedHuntingZone(getX(), getY()))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
teleToLocation(TeleportWhereType.TOWN);
|
||||
storeCharBase();
|
||||
@ -14752,6 +14752,11 @@ public class Player extends Playable
|
||||
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone()
|
||||
{
|
||||
return isInTimedHuntingZone(getX(), getY());
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int x, int y)
|
||||
{
|
||||
for (TimedHuntingZoneHolder holder : TimedHuntingZoneData.getInstance().getAllHuntingZones())
|
||||
|
@ -90,7 +90,7 @@ public class TimedHuntingZone extends ZoneType
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
player.sendMessage("Cannot use time-limited hunting zones while registered on an event.");
|
||||
return;
|
||||
}
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendMessage("Cannot use time-limited hunting zones while in an instance.");
|
||||
return;
|
||||
|
@ -1102,7 +1102,7 @@ public class CeremonyOfChaos extends AbstractNpcAI
|
||||
sm = SystemMessageId.YOU_CANNOT_PARTICIPATE_IN_THE_CEREMONY_OF_CHAOS_WHILE_FISHING;
|
||||
canRegister = false;
|
||||
}
|
||||
else if (player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
else if (player.isInTimedHuntingZone())
|
||||
{
|
||||
sm = SystemMessageId.SESSION_ZONES_ARE_UNAVAILABLE_WHILE_YOU_ARE_IN_QUEUE_FOR_THE_CEREMONY_OF_CHAOS;
|
||||
canRegister = false;
|
||||
|
@ -572,7 +572,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
if (isPlayer())
|
||||
{
|
||||
if (isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (getActingPlayer().isInTimedHuntingZone())
|
||||
{
|
||||
getActingPlayer().stopTimedHuntingZoneTask();
|
||||
abortCast();
|
||||
|
@ -5090,7 +5090,7 @@ public class Player extends Playable
|
||||
setReputation(newRep < -20 ? newRep : 0);
|
||||
}
|
||||
|
||||
if (isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
DecayTaskManager.getInstance().add(this);
|
||||
sendPacket(new TimeRestrictFieldDieLimitTime());
|
||||
@ -10836,7 +10836,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Close time limited zone window.
|
||||
if (!isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (!isInTimedHuntingZone())
|
||||
{
|
||||
stopTimedHuntingZoneTask();
|
||||
}
|
||||
@ -11303,7 +11303,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Exit timed hunting zone.
|
||||
if (isInTimedHuntingZone(getX(), getY()))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
teleToLocation(TeleportWhereType.TOWN);
|
||||
storeCharBase();
|
||||
@ -14836,6 +14836,11 @@ public class Player extends Playable
|
||||
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone()
|
||||
{
|
||||
return isInTimedHuntingZone(getX(), getY());
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int x, int y)
|
||||
{
|
||||
for (TimedHuntingZoneHolder holder : TimedHuntingZoneData.getInstance().getAllHuntingZones())
|
||||
|
@ -90,7 +90,7 @@ public class TimedHuntingZone extends ZoneType
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
player.sendMessage("Cannot use time-limited hunting zones while registered on an event.");
|
||||
return;
|
||||
}
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendMessage("Cannot use time-limited hunting zones while in an instance.");
|
||||
return;
|
||||
|
@ -25,7 +25,6 @@ import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@ -92,14 +91,14 @@ public class DecayTaskManager implements Runnable
|
||||
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
if (Config.DISCONNECT_AFTER_DEATH)
|
||||
{
|
||||
delay = 3600; // 1 hour
|
||||
}
|
||||
if (creature.isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (creature.getActingPlayer().isInTimedHuntingZone())
|
||||
{
|
||||
delay = 60; // 10 minutes
|
||||
}
|
||||
else if (Config.DISCONNECT_AFTER_DEATH)
|
||||
{
|
||||
delay = 3600; // 1 hour
|
||||
}
|
||||
}
|
||||
|
||||
// Add to decay schedules.
|
||||
|
@ -10386,7 +10386,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Close time limited zone window.
|
||||
if (!isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (!isInTimedHuntingZone())
|
||||
{
|
||||
stopTimedHuntingZoneTask();
|
||||
}
|
||||
@ -10848,7 +10848,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Exit timed hunting zone.
|
||||
if (isInTimedHuntingZone(getX(), getY()))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
teleToLocation(TeleportWhereType.TOWN);
|
||||
storeCharBase();
|
||||
@ -14516,6 +14516,11 @@ public class Player extends Playable
|
||||
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone()
|
||||
{
|
||||
return isInTimedHuntingZone(getX(), getY());
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int x, int y)
|
||||
{
|
||||
for (TimedHuntingZoneHolder holder : TimedHuntingZoneData.getInstance().getAllHuntingZones())
|
||||
|
@ -90,7 +90,7 @@ public class TimedHuntingZone extends ZoneType
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
player.sendMessage("Cannot use time-limited hunting zones while registered on an event.");
|
||||
return;
|
||||
}
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendMessage("Cannot use time-limited hunting zones while in an instance.");
|
||||
return;
|
||||
|
@ -10562,7 +10562,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Close time limited zone window.
|
||||
if (!isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (!isInTimedHuntingZone())
|
||||
{
|
||||
stopTimedHuntingZoneTask();
|
||||
}
|
||||
@ -11034,7 +11034,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Exit timed hunting zone.
|
||||
if (isInTimedHuntingZone(getX(), getY()))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
teleToLocation(TeleportWhereType.TOWN);
|
||||
storeCharBase();
|
||||
@ -14802,6 +14802,11 @@ public class Player extends Playable
|
||||
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone()
|
||||
{
|
||||
return isInTimedHuntingZone(getX(), getY());
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int x, int y)
|
||||
{
|
||||
for (TimedHuntingZoneHolder holder : TimedHuntingZoneData.getInstance().getAllHuntingZones())
|
||||
|
@ -90,7 +90,7 @@ public class TimedHuntingZone extends ZoneType
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
player.sendMessage("Cannot use time-limited hunting zones while registered on an event.");
|
||||
return;
|
||||
}
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendMessage("Cannot use time-limited hunting zones while in an instance.");
|
||||
return;
|
||||
|
@ -10619,7 +10619,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Close time limited zone window.
|
||||
if (!isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (!isInTimedHuntingZone())
|
||||
{
|
||||
stopTimedHuntingZoneTask();
|
||||
}
|
||||
@ -11091,7 +11091,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Exit timed hunting zone.
|
||||
if (isInTimedHuntingZone(getX(), getY()))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
teleToLocation(TeleportWhereType.TOWN);
|
||||
storeCharBase();
|
||||
@ -14885,6 +14885,11 @@ public class Player extends Playable
|
||||
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone()
|
||||
{
|
||||
return isInTimedHuntingZone(getX(), getY());
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int x, int y)
|
||||
{
|
||||
for (TimedHuntingZoneHolder holder : TimedHuntingZoneData.getInstance().getAllHuntingZones())
|
||||
|
@ -90,7 +90,7 @@ public class TimedHuntingZone extends ZoneType
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
player.sendMessage("Cannot use time-limited hunting zones while registered on an event.");
|
||||
return;
|
||||
}
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendMessage("Cannot use time-limited hunting zones while in an instance.");
|
||||
return;
|
||||
|
@ -573,7 +573,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
if (isPlayer())
|
||||
{
|
||||
if (isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (getActingPlayer().isInTimedHuntingZone())
|
||||
{
|
||||
getActingPlayer().stopTimedHuntingZoneTask();
|
||||
abortCast();
|
||||
|
@ -5100,7 +5100,7 @@ public class Player extends Playable
|
||||
setReputation(newRep < -20 ? newRep : 0);
|
||||
}
|
||||
|
||||
if (isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
DecayTaskManager.getInstance().add(this);
|
||||
sendPacket(new TimeRestrictFieldDieLimitTime());
|
||||
@ -10834,7 +10834,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Close time limited zone window.
|
||||
if (!isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (!isInTimedHuntingZone())
|
||||
{
|
||||
stopTimedHuntingZoneTask();
|
||||
}
|
||||
@ -11306,7 +11306,7 @@ public class Player extends Playable
|
||||
}
|
||||
|
||||
// Exit timed hunting zone.
|
||||
if (isInTimedHuntingZone(getX(), getY()))
|
||||
if (isInTimedHuntingZone())
|
||||
{
|
||||
teleToLocation(TeleportWhereType.TOWN);
|
||||
storeCharBase();
|
||||
@ -15139,6 +15139,11 @@ public class Player extends Playable
|
||||
return (holder.getMapX() == (((locX - World.WORLD_X_MIN) >> 15) + World.TILE_X_MIN)) && (holder.getMapY() == (((locY - World.WORLD_Y_MIN) >> 15) + World.TILE_Y_MIN));
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone()
|
||||
{
|
||||
return isInTimedHuntingZone(getX(), getY());
|
||||
}
|
||||
|
||||
public boolean isInTimedHuntingZone(int x, int y)
|
||||
{
|
||||
for (TimedHuntingZoneHolder holder : TimedHuntingZoneData.getInstance().getAllHuntingZones())
|
||||
|
@ -90,7 +90,7 @@ public class TimedHuntingZone extends ZoneType
|
||||
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (!player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
|
||||
player.sendMessage("Cannot use time-limited hunting zones while registered on an event.");
|
||||
return;
|
||||
}
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone(player.getX(), player.getY()))
|
||||
if (player.isInInstance() || player.isInTimedHuntingZone())
|
||||
{
|
||||
player.sendMessage("Cannot use time-limited hunting zones while in an instance.");
|
||||
return;
|
||||
|
@ -25,7 +25,6 @@ import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@ -100,14 +99,14 @@ public class DecayTaskManager implements Runnable
|
||||
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
if (Config.DISCONNECT_AFTER_DEATH)
|
||||
{
|
||||
delay = 3600; // 1 hour
|
||||
}
|
||||
if (creature.isInsideZone(ZoneId.TIMED_HUNTING))
|
||||
if (creature.getActingPlayer().isInTimedHuntingZone())
|
||||
{
|
||||
delay = 60; // 10 minutes
|
||||
}
|
||||
else if (Config.DISCONNECT_AFTER_DEATH)
|
||||
{
|
||||
delay = 3600; // 1 hour
|
||||
}
|
||||
}
|
||||
|
||||
// Add to decay schedules.
|
||||
|
Loading…
Reference in New Issue
Block a user