Addition of Player isInTimedHuntingZone method.
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user